Quote:


@william, you say you use ent_rate, so you must send everything in skills? how is your system set up? do you create only one entity for a game entity?




While I can only speak from what i'm doing in my game(mabye it's not best for you). I first create 3 entities on the client(kart body, collision cube, wheels). I then set all the pointers and send to clients ect. Afterwards, I move the collision cube like normal. The kart body then follows that and does it's own suspension stuff normally. The wheels then followed the kart body. I had a problem with bad jittering on the client but with none on the server, oddly, I fixed this by setting the kart bodies position directly in the movement smooth for the collision cube. You'll notice this in this line >

if(my.tracekart){you = ptr_for_handle(my.tracekart); vec_set(you.x, my.x); if(you.spin == 0){vec_set(you.pan, my.pan);} you.z -= 27;}

If I instead set that in a function for the kart body like this:

Code:
function movement_smooth2() //body
{my.invisible = off; var stop_vanish; var old_spin;
while(!my.tracekart){wait(1);}
while(!my.kart_point){wait(1);}

if(my.kart_point == 1){mkart1 = me;}
if(my.kart_point == 2){mkart2 = me;}
if(my.kart_point == 3){mkart3 = me;}
if(my.kart_point == 4){mkart4 = me;}
if(my.kart_point == 5){mkart5 = me;}
if(my.kart_point == 6){mkart6 = me;}
if(my.kart_point == 7){mkart7 = me;}
if(my.kart_point == 8){mkart8 = me;}

while(1)
{
if(my != decoy_2)
{
my.passable = on;

c_scan(my.x,my.pan,vector(360,0,160),IGNORE_ME); //trace for local weapons

if(my.spin == 0){stop_vanish = 0;} //spinout?
if(my.spin == 1) && (stop_vanish == 0){stop_vanish = 1; spinkart();}

//you = ptr_for_handle(my.tracekart);
//vec_set(my.pan, you.pan);
//vec_set(my.x, you.x); my.z -= 27;
}

if(my.spin != old_spin){send_skill(my.spin, 0);} old_spin = my.spin;
wait(1);
}
}



Then there would be bad jittering. I've yet to look into this a little more, I know it sounds a bit weird. Also, by running multiple instances on one computer can add some jittering. You'll find if you split it across multiple computers things run a bit smoother.

As to the set up,


Code:
 if(connection) //Multiplayer
{
if(kart_create == 1){my.pan = kc1.pan;}

if(my.client == 1)
{
proc_client(my, move_player);
proc_local(my,local_functions);
//cs_move();

my.invisible = on;
my.nosend_frame = on; my.nosend_alpha = on; my.nosend_ambient = on; my.nosend_color = on; my.nosend_light = on; my.nosend_uv = on;
my.nosend_origin = on; my.nosend_angles = on; my.nosend_flags = on; my.nosend_scale = on; my.nosend_skin = on; my.nosend_sound = on;
}
if(my.client != 1)
{
proc_local(my,local_functions);
move_player();
my.invisible = on;
my.nosend_frame = on; my.nosend_alpha = on; my.nosend_ambient = on; my.nosend_color = on; my.nosend_light = on; my.nosend_uv = on;
my.nosend_origin = on; my.nosend_angles = on; my.nosend_flags = on; my.nosend_scale = on; my.nosend_skin = on; my.nosend_sound = on;
}
}



Then in while loop on server:

Code:
   if(new_sends != people_connected){client_new += 1*time;}
if(new_sends != people_connected)&&(client_new > 160){client_new = 0; new_sends += 1; send_skill(my.tracekart, send_all);} //this part resends pointers to a new client that just joined game

send_skill(my.server_origin, send_vec + send_all + send_rate);
send_skill(my.server_angle, send_vec + send_all + send_rate);



I send skills for most things. Send positions from clien-server, then relay it back to clients from server. To keep things working for both single player and multiplayer, each kart has a pointer "kart1". That way all the single player functions still read it as a player and not A.I(A.I uses kart2-8). Now, I also number each clients kart indpendantly, this is for multiplayer distinction mkart1 - mkart 8. I do weapons/scans on only one computer at time(for example... if u fire projectile, it will detect people only on yours). If it hits on yours, it tells other computers and proceeds with other functions ect. This may not work with your game, it all depends what your trying to do. I also do checks and balances with movement and weapons ect. to keep cheaters away.


Heres a link that explains some multiplayer concepts that counterstrike uses, pretty good reading -

http://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking

P.S - If you find a good way to keep the entities very close to original positions in the interpolation code, be sure to give me a shout.