-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Sync local time with server more accurately #3028
fix: Sync local time with server more accurately #3028
Conversation
@BenHamrick |
@NoelStephensUnity I am really glad to hear that! We are using the tick in our own custom physics engine to do predictive rollback on the server and client. I have been so confused for a long time about why the tick is not in sync between the client and the server. We even started to write our own syncing system that worked around this problem like people are in this thread: https://discussions.unity.com/t/network-messaging-latencies-very-high/912504/2 . I probably spent more than 40 hours trying to work around the issue by dynamically changing the NetworkManager.NetworkTimeSystem.LocalBufferSec Btw to figure this problem out I used the relay server with 2 instances of unity running on the same machine. Then I was able to use local epoch time to see if each of the ticks are in sync between the server and client. They where not! |
@NoelStephensUnity how long does it take to merge and backport a simple change like this? |
@NoelStephensUnity any updates on this? Is the fix valid? |
I am up-ticking the status and we will get it migrated to run through the CI process. Thank you for your patience and the contribution. 👍 |
@BenHamrick I am closing this PR at this time since. Once again, thank you for taking the time and for your patience on getting your contribution merged. 🥇 Happy Netcoding! |
When syncing the local time from the server to the client we need to use half the RTT time to get the local time in sync with the server. Otherwise the local time drifts relative to how long the RTT time is.
Changelog
Testing and Documentation