|
|
|
|
|
by dustbunny
29 days ago
|
|
Hey Glenn, what do you mean by 'rollback determinism'? Is there some particular thing missing from Box3D now that makes it difficult to synchronize with solely the inputs? My reading of Box3D's docs is that it has 'cross platform determinism', and 'recording/replay'? Isn't that sufficient? Synchronize inputs, determine if inputs were 'mispredicted', if so, rollback the physics world, apply the changed inputs and resimulate? Just for context: I implemented state-sync netcode into box2d in 2018 and shipped multiple real games using it - and I work on netcode professionally. I'm planning on adding full netcode support for box3d and releasing it as part of a larger framework. https://box2d.org/documentation3d/md_simulation.html#autotoc... |
|
https://box2d.org/posts/2024/08/determinism/
Physics engines like Box3D have a significant amount of internal state and caching, like contact caching, and other things to speed things up.
I've talked to Erin a lot about stuff like: "Hey, what if I want to do an FPS or a vehicle, but I want to roll back only the character or vehicle, like in an FPS?"
From these discussions (and many other inputs I'm sure) Erin has had a big think about determinism, and come up with his own determinism and replay stuff.
In the article he uses the term "rollback determinism" to mean you'd be able to synchronize (or at least invalidate) any of this caching so that it doesn't affect the way the simulation replays if you were to rollback the simulation fully and then change the state only for a few objects.
For example, if you were to rewind and replay a physics simulation just for say the player predicted object like a vehicle and any objects that it happens to touch, expanding these objects out recursively as they touch other things.
Or if you were to do rollback on the player controller like we normally do in FPS, and the player started predicting a physically simulated door they push into, and then any other object the door pushes and so on, this sort of thing.
This should not affect you if you only step the physics simulation ahead with inputs, and do the GGPO thing where you copy fork, and step that sim ahead with predicted inputs, throw away, copy fork and predict again... that's already deterministic today.
cheers