Repository navigation
fix: late time sync no longer steps client time back (back-port) - #4263
Open
NoelStephensUnity wants to merge 2 commits into
Open
NoelStephensUnity wants to merge 2 commits into
NoelStephensUnity wants to merge 2 commits into
Conversation
NetworkTimeSystem.Advance only hard-resets forward. A sync that puts the desired time more than HardResetThresholdSec behind now slews back at AdjustmentRatio instead. Reset() can still step time back. NetworkTransform's tick driver skips only a repeated tick; if the tick goes back it keeps sending with ticks above the last one sent, so receivers do not drop the states.
3 of 6 tasks
NoelStephensUnity
marked this pull request as ready for review
November 30, 2026 18:11
Contributor
There was a problem hiding this comment.
💡 Harness Review
The change makes automatic time resets forward-only and preserves increasing transform ticks after a clock rewind. I examined the timing arithmetic, tick scheduling, receiver interpolation, and regression tests and found no actionable issues.
Reviewed commit be83536
🤖 Helpful? 👍/👎
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop-2.0.0 #4263 +/- ##
=================================================
+ Coverage 74.78% 74.79% +0.01%
=================================================
Files 172 172
Lines 28400 28415 +15
=================================================
+ Hits 21239 21254 +15
Misses 7161 7161
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes
|
EmandM
approved these changes
Dec 2, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a back-port of #4262
Purpose of this PR
A late time sync no longer steps a client's network time back, and a
NetworkTransformkeeps sending state updates if the time does step back.Fixes #4249.
What needed fixing: a time sync that arrives late (a resend under packet loss, or one read after a long frame) makes the server look further behind than it is. When the gap passed
HardResetThresholdSec(0.2 s),NetworkTimeSystem.Advancehard-reset the client's time backwards. Owner authoritativeNetworkTransforms skipped every tick at or below the last one sent, so they sent no state updates until the client's time caught up again.What changes:
NetworkTimeSystem.Advanceonly hard-resets forward. When a sync puts the desired time more thanHardResetThresholdSecbehind, time slows down byAdjustmentRatiountil it catches up.Reset()can still step time back.NetworkTransformskips only a repeated tick. If the tick goes back, it keeps sending with ticks above the last one sent, so non-authority instances do not drop the states as old.TimeSyncMessagestays reliable (all messages share one delivery soNetworkMessageManagerkeeps their order).PR Scope:
NetworkTimeSystemhard reset direction.NetworkTransformtick gate.Jira ticket:
MTT-16795
Changelog
NetworkTransforms it owns sent no state updates until its time caught up again. A late time sync now slows the client's time down instead, and aNetworkTransformkeeps sending with increasing ticks if the time does step back.Documentation
Testing & QA (How your changes can be verified during release Playtest)
Functional Testing
Manual testing :
Manual testing done(on fix: late time sync no longer steps client time back (#4249) #4262, develop-3.x.x)Automated tests:
Covered by existing automated testsCovered by new automated testsNew tests:
ClientNetworkTimeSystemTests(late sync slows time instead of stepping back, forward reset,Resetcan step back) andNetworkTransformClockStepBackTests.OwnerKeepsSendingAfterClockStepsBack.Does the change require QA team to:
Review automated tests?Execute manual tests?Provide feedback about the PR?Up-port
#4262
Backports
N/A (this is the develop-2.0.0 backport)