Advertisement

Network in cars game

Started by February 06, 2003 03:29 AM
0 comments, last by mistergos 22 years ago
Could you please explain me how to deals with a network without reduce fps due to ping. Physic calculs are made in the server, that''s why client send his car, serveur works and send all the cars to the different clients. Program is made in C++ with openGl and SDLNet. Thanks
have the server track how the player drives, but ''loosly''... have the player send updates of what has happened according to the player, and the server can do a check. If things are off significanlty (ie, the player hit another car, in server time) then the server sends back an update to the players car, you would then get a jolt if your on a high ping, but if done right it wouldn''t be too intrusive. The reverse can also happen, if the client thinks it''s hit a car it actually missed, for example.. but correcting this would be tricky.. you don''t want to right a car thats flipping over or something...
you might want to also consider having variable client-server sync rates.. ie, if a car is way out in the middle of nowhere, it only really needs a client->server update a couple of times/sec.. but if it''s jostling with another car, then it really needs a good 10-20 updates a sec.

Also consider sending data from the sever about where cars are realitive to the players car.. say, if a car is 3m ahead in server time, it may be 3m behind for the client.. this a pretty big issue obviously... Doing this though introduces a lot of problems when it comes to predicting other cars actions, in which case having slow moving or turning cars would be a bonus...

| - Project-X - my mega project.. yup, still cracking along - | - adDeath - an ad blocker I made - | - email me - |

This topic is closed to new replies.

Advertisement