Just a thought…
For car racing, lots of movement computation has to done even for the remote cars in any case. This is due to the fact that car motion is heavily contrained (e.g. by the road
). So ‘normal’ extrapolation of 3D motion data doesn’t take you anywhere at all. You have to make sure that the car stays on the ground.
The same way you always have to do local collision detection and response. Let your cars collide locally and even perform the bounce locally and then let a smoothing of motion care for the consistency with the information from the network.
If damage data has to be handled, I’d prefer to calc that only for your own car. A collision might not even take place on each machine involved than, but if you encounter a collision on your machine, you also get the damage.
Thats pretty much how JPilot works (concerning collision with bullets).
I have another sample that could help to keep cars on track, which I thought was a nice idea but I’m not sure wether it holds for a true game: as most track consist of flat triangles or quads anyway, just work with 2D coordinates [0…1;0…1] that just describe the position on a certain triangle. So position [9.2,0.5] places your car at the beginning of the 9th quad just in the middle of the road.
You will have to use non-orthogonal coordinate systems for that. I have a small sample showing that:
http://www.hardcode.de/applets/hqDriver.html
The ‘cars’ positions are just computed as [t,sin(t)] and see how it moves…