- Home /
Multiplayer Physics Extrapolation
We're working on a smartfox multiplayer game with awkward latency (worst case ~200ms). On previous projects, we modified Box2D to extrapolate the position of a single body.
E.g. if I receive a position/momentum message which I know from its timestamp is 155ms old, then I can simulate that single body forward to "current time".
Is there a way to realize this with RigidBodies in Unity? Or will we have to script our own custom physics? I've experimented with an euler prediction step, e.g.
mBody.MovePosition(mBody.position + dt*mBody.velocity);
mBody.MoveRotation(Quaternion.Slerp(...));
However, the results have been less than acceptable (even if I take multiple smaller steps, the linear/angular velocity isn't integrated correctly).
Answer by Techsuport · Aug 28, 2011 at 07:39 PM
what i ended ujp doing is have the movement of the player update quite often to keep the network better synced, and did all my physics calculations on the server and just updated the position on the client.
To smooth out the jump from between network updates to the movement I had the client actually effect its object in real time and interpolate between the received server movement and the current players movement actions
Your answer
Follow this Question
Related Questions
Predicting A Trajectory 1 Answer
Auth Server or not? -1 Answers
Network particle collision 1 Answer
Networked Physics 0 Answers