Date Time variables are not replicated

Date Time variables are not replicated when set to replicated. Quite simple.

Hi Rudy,

I’m not only one having problem: Date Time variables do not replicate - Blueprint - Epic Developer Community Forums

I have not tried to replicate (:D) this issue in a new project because I saw that I’m not only one seeing it.
It’s really strange that you got it working. There is no special setup I used, just having a DateTime variable in PlayerState and trying to replicate it, I printed out variable on RepNotify and it did never change on client, rep notify function was not even called on client. Then I switched to using a MulticastRPC with DateTime variable inside and there I saw event is called on client, but variable I send with it is not correct on client. Then I changed event so that I don’t send DateTime variable but instead broken DateTime variable (so a lot of floats) and that worked fine.

Hello,

I was able to to get this variable to replicate by creating a new actor and then having that actor and it’s variable set to replicate. When using a print string to print out variables I was able get both client and Server to print out correct variables.

Quick questions:

  1. Can you replicate this issue in a clean project?
  2. Could you provide exact steps that you are using when you run into issue?
  3. Could you provide screen shots of blueprint that you are currently using?

Note: During investigation of this issue I found and reported a crash (UE-22011) that happens when splitting back end of a Date and Time variable’s set node. If this crash occurs you will need to be sure that all values that are being set are VALID values or else this will end in a crash.

Could you try opening a new project and running same setup that I am using?

Steps:

  1. Create a new player state
  2. Create a new Date time Variable for player state
  3. Open game mode blueprint
  4. Assign new player state to player state class within game mode

  1. Save
  2. Open player state
  3. Set Date Time variable to RepNotify
  4. Open RepNotify function and place a print string within to notify you when a change has occurred

62510-datetimerepnotify3.png

  1. In Event graph on Begin play set Date Time Variable

  1. Play in Editor with at least 1 client and 1 server
  2. Notice that print string is printed out on both client and server

Hi Rudy, instead of setting it only on begin play, do something like adding 1 day on each tick or on a timer. And then print out DateTime variable in OnRepNotify.

I tired using a tick and other methods of changing Date and time variable and then printing it out to screen. variables returned correctly and consistently on both client and sever. Are you using any other nodes such as the “Now” node that gives current date and time?

Are you sure you are not changing date on both client and server locally? I have just tried in a new project and OnRepNotify is never called on Client. This is how my tick looks like:

http://puu.sh/kLvl4/c8516f3201.png

And thats RepNotify:

http://puu.sh/kLvmB/190a130231.png

Hello,

After looking over your screen shots I was able to find that this is a known issue (UE-11876) and that it has been submitted to developers for further consideration. I will be sure to bump up community interest for this issue. Thank you for your time and information

Make it a great day

Thanks Rudy. Could you tell me what exactly “UE-11876” is named? Does it only affect DateTime variables or is it a more general issue?

Hello,

It’s a more general issue dealing with RepNotify function not firing on clients.

Hey Rudy, why does it only happen with DateTime variables then? I can get all other variables to replicate correctly, at moment I just break DateTime and send individual floats with a Multicast to every client and that works.

If “UE-11876” is not specifically for regarding DateTime variables it’s not fitting bug report for this.

Hi,

bug report in question involves OnRep functions and Switch Has Authority node. If you can repro this without using Switch Has Authority node with other variable types, please let me know and we will add that information to report; there is a related report that does not involve Switch Has Authority node and two reports are linked. Otherwise we have updated bug to include notes you’ve provided thus far.

In either case, please stop questioning my staff with regards to bug reports. It is not up to you whether what you are reporting suits a bug report we have in our system. You are welcome to give us additional information, and we welcome that, but I would appreciate some trust in our system.

Regardless of whether particulars of DateTime struct variable are involved, it is clearly related as reproduction and result are identical. We added your notes to report, and if one example is fixed but your example is still not working, bug will fail verification until it is fixed or developers ask us to open a separate bug. We do not clog our system with multiple instances of same issue.

Thank you for understanding.

Hey and Rudy,

I am quite sure I wrote a comment to this 2 hours ago, have you seen it? I can’t see it now and it might be a bug with answerhub, I think I already had same problem some months ago… Maybe you got a mail notification about it? It’s a strange bug, and I surely can’t reproduce it :slight_smile:

I haven’t seen any notifications about a reply in my email. Do you remember what you were commenting?

Ohh, that’s sad, then I have to write it again. It’s really strange, maybe I clicked accidentally on “cancel” instead of “comment”? I can’t believe I could do that without noticing…

Well, regarding topic:

I actually had a lot of trust in your system, and you probably know I have reported quite a lot of bugs during last year, so I have a lot of experiences with this. And unfortunately there were more than one case where answer I received was that its a known bug and already fixed in master branch or that it’s a known bug named UE-XXXXX, but then after waiting a few months when I asked about a update I noticed that Epic think it’s fixed, and bug which is entered is fixed, but bug I reported was actually something different.

And that’s quite sad because then many month have passed without developers even having a chance to fix it since they never knew about bug. So I learned that I should always ask a few more times about what exactly a JIRA number is about to make sure it’s correct one. It’s good for you since you get more precise bug reports which result in a more stable engine and it’s good for me since I would really like to see all game breaking bugs I experience fixed at some time :slight_smile: And a bug which is not entered correctly will probably never get fixed by developers.

This bug is one of cases where if I would not have asked about what UE-XXXXX really stands for, in 6 months you might have said it’s fixed but real bug would still be there. Which would not be a huge problem in this case since it’s really a minor bug and I have a fully working workaround. Just splitting DateTime into floats and replicate floats.

It’s quite simple to tell that bug is not about “RepNotify function not firing on clients”, because I can reproduce this without using any RepNotify functions :slight_smile: It makes sense that bug with RepNotify might also affect DateTime variables since it affects all variables, but this does not mean it’s same one.

Just print Date variable in Tick of Server and Client and you will see that if Server updates it, it will not replicate to Client. I just used RepNotify in screenshots above because it looks better than printing something in Tick :slight_smile: I like clean code.

Hello,

Could you make sure that Variable is being replicated to all clients. I did this by calling a custom event and I then had that custom event set Replicates to “Multicast”.

Let me know if this works for you.

Hey Rudy,

you are setting DateTime locally to local “Now” time - that works since you never replicate variable, you only replicate event so that every client sets it locally. In that case you also don’t need RepNotify on variable since a client can never replicate anything to Server.

You have to set DateTime variable on Server and then replicate it to Client. That is what’s not working. Either with trying to pass it through a multicast with variable as input or with just setting it to replicate, both will not work.

This would be an example:

http://puu.sh/kTLAm/9868917b4a.png

Increase Date by one day on each tick on server and client will never print out updated value.

After further investigation I was able to reproduce this issue on our end. I have written up a report ( UE-22533) and I have submitted it to developers for further consideration. Thank you for your time and information.

Make it a great day