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!

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.

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.

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?

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