Hi there,
I'm using Newton Game Dynamics for my networked game, which does State Synchronization to synchronize server/client simulations (which basically calls NewtonBodySetMatrix/NewtonBodySetLinearVelocity/NewtonBodySetAngularVelocity on the client on a regular basis).
To provide lag-proof inputs, I implemented client-side prediction earlier (before integrating physics) which was working quite well; it worked like this:
1) Player presses a key; generate an input
2) This input is applied to the controlled entity and stored in a "pending inputs" vector
3) Input is sent to server with an incremented ID
4) When the server sends an entity snapshots, it includes the last input id it processed
5) Client receive snapshot,apply snapshot position/rotation to predicted entity, remove processed inputs and apply every input which has not yet been processed by the server
It was fine until I had to put physics in there, now I'm using state synchronization and I'm stuck on how I should implement it, especially how to reconciliate client and server (step 5), how can I simulate only one body in Newton without simulating the others?
Thanks in advance