Syncing State of two simulations via Network IO

Hi!

After some hours of tinkering and coding I managed to create a deterministic simulation with Box2D (Fixed Timestep, etc). I can restart the program and it yields always the exact result. (I'm using a MD5 hash digested from each bodys position and angle to verify this)

As the simulation appears the be deterministic, I thought i could easily send the state of each body over the network for an arbitrary frame and let the client simulate the next frames. But, as you may guess, it does not work. 🙁 If I send the body data for the first frame to the client, it yields the same result as the server. But if I use a later frame, lets say the 5th, the simulation get off beginning with the 6th. I already verify that the data I receive from the server and there are no rounding errors, etc.

Am I missing some important body state information? Currently, I sync the following:
  • My own representation of the BodyDefinition.
  • The position of the body.
  • The angle of the body.
  • The Angular Velocity.
  • The Linear Velocity.

Thank you!
Mozartkugel
As has been stated many times on these forums, this is not a supported use of Box2d (though I'd love to see a patch that actually makes it work). Box2D has internal state not publicly acessible or modifiable, you would have to track it all down yourself. Specifically, the ordering of virtually every list make a difference.
The only promise is that the same inputs gives the same outputs on the same architecture - basic determinism.
It won't work anyway unless you have the same CPU and run-time libraries on both machines. This has been discussed before.

I have no plans to try to support this in Box2D.

Original thread: https://box2d.org/forum/viewtopic.php?t=4489