fix: Prevent resimulating physics ticks before bodies existed - #645
Open
realpoke wants to merge 1 commit into
Open
fix: Prevent resimulating physics ticks before bodies existed#645realpoke wants to merge 1 commit into
realpoke wants to merge 1 commit into
Conversation
Bodies that spawn mid-game (projectiles, pickups) were resimulated from the earliest rollback tick, running them through physics states that predate their existence. Add a resim floor to NetworkRollback: drivers track bodies in the network_rigid_body group and pin the earliest resimulable tick to the tick a body first appeared in. Also guard space snapshotting behind rollback_physics_space, and resim from the start of the frame's tick loop so multi-tick frames replay their full physics sequence.
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.
Bodies spawning mid-game (projectiles, pickups) were being resimulated from the earliest rollback tick, running physics states that predate their existence.
The driver now tracks the
network_rigid_bodygroup and raises a resim floor through the newNetworkRollback.notify_resim_floor()when a body first appears, so rollback never goes earlier than a body's spawn tick.Rollback also starts from the frame's first tick so multi-tick frames replay their full physics sequence, and space snapshotting is skipped when
rollback_physics_spaceis off.