[ODE] Networking (Client-Side Prediction)
Robert Pröpper
Coramoor at web.de
Wed Apr 26 15:09:22 MST 2006
Hi,
I am trying to program a multiplayer game using ODE (float version).
I've got many things running already, most important to this question is that I can jump to a previously saved state, simulate the intermediate steps again and arrive at EXACTLY the same result.
I have now begun to build a Client-Server System. The client sends only his Inputs(with a timestamp) to the server. When he receives an Input, the server jumps back to the tick where the input happened and re-simulates. Now, since I can get the same results from the same starting conditions in my "Single Player" application, I would expect that the server also arrives at the same results, but this is not the case.
For example, I have turned off gravitation in my application. As long as no force is applied to my body, the client and the server stay perfectly in sync (obviously, neither the position nor the rotation changes). They also stay the same if I apply a force at
the center of the body (like gravitation) - I get a linear velocity and the positions stay the same (the rotations again don't change). Now, as soon as I apply a force at any other point than the center, the two simulations go out of sync.
For testing purposes, I only apply the force for 1 step. Immediately, the client and the server rotations are very slightly off - in the order of 1e-8.
I can't explain this, I have followed all the Save and Restore FAQ and, as I mentioned, have no problems in the same application or until the body begins to rotate. For a good client-side prediction, I need the server and the client to arrive at the exactly same results, so this inaccuracies are a big problem for me.
So, do you have any ideas what could be causing this problem, or even better, how to solve it?
PS: For the moment, both the client and the server run on the same computer.
_______________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
More information about the ODE
mailing list