x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How reliable is replicated property?

Hi buds,

Assume a situation, where the server randomly set a replicated variable very fast , say, bool CoinFlip 5 times in one second. And the network condition is terrible, so the package may arrive at different time.

e.g. During the one second, bool CoinFlip on server side was set to 1, 0, 1, 1, 0

But Client received 1, 0, 1, 0, 1 due to lag / package loss

Does the replication system go out of way to make sure the client's version gets corrected to 0 ?

Would love to see some insight here, thanks!

Product Version: UE 4.18
Tags:
more ▼

asked Feb 03 '18 at 08:50 PM in C++ Programming

avatar image

Vuthric
22 4 9 11

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Replicated variables don't provide direct communication like that. The network is not sending out every change to the variable so there's no one-to-one correlations between set and get. If you want to do something like that you will need to use a reliable RPC function.

more ▼

answered Feb 03 '18 at 08:57 PM

avatar image

Jin_VE
4.4k 32 77 40

avatar image Vuthric Feb 04 '18 at 04:34 AM

I understand. My question is whether the final result on client side is guaranteed to be the same as server, under any horrible network conditions. Is it?

avatar image Jin_VE Feb 04 '18 at 04:52 AM

No. The network system will do its best to keep them synced but there are many factors that come into play. You are guaranteed that if you set it on the server then eventually the change will be reflected on the clients. But lag, bandwidth and the volume of communications, at any given time are always factors. Under ideal network conditions you can be pretty sure the values are synced, but even the best network conditions will have some latency.

But don't take my word for it. It's not hard to do an experiment: setup a timer that just flips a rep-notify bool, and on the client print the bool when the notify event fires. Speed up the timer until you see the server making changes that the client doesn't get. You can add lag using console commands to see how lag affects the system.

avatar image Vuthric Feb 04 '18 at 05:59 AM

Thanks a lot for the insight! It's always better to hear from an awesome experienced guy on these in-reality-very-complex issues.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question