Game network physics collision

Posted by Jonas Byström on Stack Overflow See other posts from Stack Overflow or by Jonas Byström
Published on 2009-05-07T15:47:07Z Indexed on 2010/05/22 9:00 UTC
Read the original article Hit count: 135

How to simulating two client-controlled vehicles colliding (sensibly) in a typical client/server setup for a network game? I did read this eminent blog post on how to do distributed network physics in general (without traditional client prediction), but this question is specifically on how to handle collisions of owned objects.

Example

Say client A is 20 ms ahead of server, client B 300 ms ahead of server (counting both latency and maximum jitter). This means that when the two vehicles collide, both clients will see the other as 320 ms behind - in the opposite direction of the velocity of the other vehicle. Head-to-head on a Swedish highway means a difference of 16 meters/17.5 yards!

What not to try

It is virtually impossible to extrapolate the positions, since I also have very complex vehicles with joints and bodies all over, which in turn have linear and angular positions, velocities and accelerations, not to mention states from user input.

© Stack Overflow or respective owner

Related posts about game-development

Related posts about network-programming