[ODE] networking

John Butterfield johnb003 at hotmail.com
Mon Oct 14 19:35:02 2002


>Also, out of curiousity, how are you doing the networking?  Does all of
>the simulation take place on a server, or do the clients do some of the
>simulation math?  I've been pondering a networked application using ODE
>for a while and I'm looking for ideas.

I have not actually implemented my netcode but I thoroughly thought about it 
and decided on how I'm going to do it.  There are several trades offs I 
could see from server-side to client-side and who tells who what collisions 
happen. Thought the implementation you use is dependent on what your program 
is modeling.  I am doing a remote-controlled racing game, but not like 
revolt... if you're curious just check out my page: 
http://web.csuchico.edu/~jb393/urgent

I started thinking about client-side physics, but being a racing game it 
could be really weird.  Here is an example:  Your actual position is about a 
car's distance behind the other player... Through lag though, the other 
player seems right next to you. If you were to ram that car, then tell the 
server hey I hit him, and then the sever relay that to the the other player 
and bounce him away from you, you'd think it was perfectly legitimate. Now 
from the prospective of the car in front of you.  That player sees you even 
further back than you really are, (like 2 car distances) so then he sees you 
move to the side and out of no where he gets bumped off course... Ok so this 
method obviously has it's flaws for a racing game but for a first person 
shooter or something, it would be necessary so that you could shoot AT the 
player... not in front of them.

The other main method is to do things server side, the question then becomes 
how much to do on the server and how much to do on the client-side.  Lets 
say you did everything server-side... this would be the absolute most 
accurate if you told the server I am turning left and it turned you left and 
then sent back the positions of you and the other players but then you have 
lagged controls and no one likes that. If you only plan on playing this on a 
lan, maybe the lag is not an issue for you and this method is best.

The method I plan on using for my racing game is a hybrid of the two.  I 
will keep track of the vehicles on the server and do collision detection (I 
have more to say about this... possibly in my next post) there between the 
vehicles.  I however do the controls for my vehicle on the client and send 
the server information about my position rotation etc... depending on how 
accurate you might just send the information about the vehicle or model 
whatever in whole and have the server guess what orientation the bodies 
have.  For example the rotation of the wheels and the locations of the 
shocks and all that or just the vehicle altogether... Anyway with this 
method, one might have to predict a bit or aim in front of the other car 
slightly to make the collision on the server happen... I'll attempt to fix 
this by trying to show how the car might look after this much time and then 
use some kind of frame to frame dampening to move the car from where I 
projected it to be to where the next packet says it is.

I hope this was thought provoking,
   -John Butterfield

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com