Physics and networking

Started by
0 comments, last by teamonkey 20 years, 7 months ago
I''m trying to write a simple (gameplay-wise) multiplayer game which uses ODE for physics. I''m stuck trying to work out which is the best way to handle the multiplayerness. What would you do, for example, if you were writing a pool game, but wanted to allow the players to hit the balls when ever they liked (even when they were moving). Things would get very hairy on the networking side of things, surely? So far I''ve come to the following conclusions: * The integration timestep should be constant for server, and probably clients too. * The clients should perform a physical interpolation to allow for lag. * The server is always right and will send out information on the physical systems. what have people done to tackle networking for physical games? [teamonkey]
[teamonkey] [blog] [tinyminions]
Advertisement
Yes, you need that (especially consistent time step).

You also need a way of time warping, because when a player hits a cue ball on his machine, the command won''t be at your machine until 400 milliseconds later (depending on networking) so you have to go back to that point in time and re-simulate.

You also need to watch out for subtle differences in floating point handling between different CPUs, rounding mode, whether the graphics card changes FPU flags when you call it, etc. Assert early and often! In debug mode, send periodic checkpoints of all state at time X, and verify that it''s the same on the other side (won''t work over a modem, though :-)

This topic is closed to new replies.

Advertisement