Properly achieving determinism (on same machine)
Posted: Fri Feb 17, 2023 1:51 pm
I'm working on a networked game so I need totally deterministic simulations even when resetting a given physics state (transform + velocities).
However, to achieve determinism, I currently have to delete all rigidbodies and recreate them, which is a bit slow.
It appears that something about the rigidbodies is cached from the previous frame but I couldn't figure it out.
Things that I already tried and failed the determinism test:
- calling resetPool on the broadphase
- calling refreshBroadphaseProxy for every collision object
- calling cleanProxyFromPairs passing each collision object
- calling reset on the constraint solver
- disabling warmstaring on the m_solverMode
Is there nothing else I can do to make deterministic simulations on reset? Or do I really have to delete everything and recreate?
However, to achieve determinism, I currently have to delete all rigidbodies and recreate them, which is a bit slow.
It appears that something about the rigidbodies is cached from the previous frame but I couldn't figure it out.
Things that I already tried and failed the determinism test:
- calling resetPool on the broadphase
- calling refreshBroadphaseProxy for every collision object
- calling cleanProxyFromPairs passing each collision object
- calling reset on the constraint solver
- disabling warmstaring on the m_solverMode
Is there nothing else I can do to make deterministic simulations on reset? Or do I really have to delete everything and recreate?