fix: Fix per-physics-step tick jitter under sync_to_physics#626
Merged
elementbound merged 5 commits intoJul 8, 2026
Merged
Conversation
elementbound
reviewed
Jul 7, 2026
Under netfox/time/sync_to_physics = true, the tick loop runs inside _physics_process, but it still decides how many ticks to run from netfox's own wall-clock scheduler rather than from the physics step it's running in. Because that wall clock drifts against Godot's physics accumulator, individual physics steps end up running 0 or 2 ticks instead of 1, several times per second. At the same time, when sync_to_physics is on, tick_factor is derived from Engine.get_physics_interpolation_fraction() — i.e. the physics-step timeline. So every 0/2-tick slip produces a from/to interpolation pair that disagrees with the fraction: TickInterpolator renders a backward snap followed by a double-speed catch-up. It reads as intermittent movement jitter. The severity is set by the phase between the two clocks, which is frozen at NetworkTime.start() — so the same project stutters on some launches and is smooth on others, and the state persists for the whole session.
62510ec to
dbe9a50
Compare
Contributor
|
Kudos for the PR! |
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.
Under netfox/time/sync_to_physics = true, the tick loop runs inside _physics_process, but it still decides how many ticks to run from netfox's own wall-clock scheduler rather than from the physics step it's running in. Because that wall clock drifts against Godot's physics accumulator, individual physics steps end up running 0 or 2 ticks instead of 1, several times per second.
At the same time, when sync_to_physics is on, tick_factor is derived from Engine.get_physics_interpolation_fraction() — i.e. the physics-step timeline. So every 0/2-tick slip produces a from/to interpolation pair that disagrees with the fraction: TickInterpolator renders a backward snap followed by a double-speed catch-up. It reads as intermittent movement jitter.
The severity is set by the phase between the two clocks, which is frozen at NetworkTime.start() — so the same project stutters on some launches and is smooth on others, and the state persists for the whole session.