Skip to main content
GameDev.net gamedev.net
🔒 Locked

Timing and Sending Data

Started by gimp Apr 19, 2000 at 6:37 PM 1 replies 1k views
Original Post
gimp
gimp
Obviously timing is critical to a client displaying the correct state. I have though up some simple and not so simple and high bandwidth methods of ensuring this works. What method do you guys use? In general is it better to use tcp so you don''t have to implement your own form of ensuring that critical packets are recieved? Should I use TCP for game state messages and UPD for non critical updates like messaging, scores, blah? I was thinking that ever tenth packet might be where the client sends off its current location and the nine packets in between would be containing things like ''player 4, FORWARD, JUMP''. The tenth packet would be to ensure that if something screwed up in the command delta''s to be played in the world then it would be corrected not to far in to the future. I''d also make this packet based rather than time based so that a player not moving(camping, chatting, healing,taking aim) would not be using and bandwidth. Is that a reasonable assumption Is there anything I''m missing in the things I''ve been talking about over few days? Thanks gimp
Chris Brodie
DavidRM
DavidRM
If you are doing a client-server game, only the server needs to know *exactly* what time it is. The clients make do with what the server has told them about the state of the world up to the current instant in time. Maybe the client software does a bit of predicting on things, but it remains at the mercy of the server, and the only state it will ever be able to display is what it knows. If latency causes a client to fall behind, that''s just what happens. There is precious little you''re going to do to stop that from occurring.

Don''t worry about being incredibly precise. Figure out how to be "precise enough" and let it go at that.

If you worry too much about the (fractions of a) second that the clients might be off from the server and each other, you''ll just end up going quite mad and wasting huge heaps of time. Really.

With networked games, it easy to make things more complicated than they have to be. Resist that urge...


DavidRM
Samu Games

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.