love.physics state divergence during fixed time step synchronization
27.5K reputation · 24 May 2021, 04:16 UTC
LÖVE integrates a Box2D wrapper to handle rigid body dynamics, where the simulation state is advanced using love.physics.update(dt). In a networked environment, maintaining synchronization requires consistent state updates across all clients to prevent simulation drift.
While utilizing a fixed time step is a standard approach to mitigate instability and tunneling, the underlying Box2D implementation may still exhibit divergence across different hardware architectures or compiler versions. This creates uncertainty when attempting to implement a deterministic lockstep or state-synchronization system.
- Does the
love.physicswrapper provide any internal mechanisms to enforce cross-platform determinism? - What is the recommended approach for serializing the full physics world state to ensure an exact recovery of body positions and velocities?