🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

when to send packets

Started by
10 comments, last by djsteffey 23 years, 8 months ago
There are many possible reasons for the choppiness in addition to the possiblity you stated above, it''s very possible that its a combination of the above listed causes. Just increasing the update frequenecy might sovle the choppiness, but from my experience it wont, since those reasons i listed are independent of update rate, and are inherent in most sychronization schemes (just a guest there). The problem with the cubic intperlation scheme is that it requires some form of data buffering which increases the percived latency. For a slow moving RPG or turn base game it would be fine, but for action games, latency is very bad.

Here is a run down of how to implement the scheme i listed above :

-Use NTP to sychornize timmers look on this web site http://www.codewhore.com/ for a good explanation of it and game networking in general

-For each packet you send off (coallate them into one packet per tick becuase of the header overhead and tag them with a time stamp (usually a 4 byte number))

-Include in each entity updated by the packet a 1 tick (a tick is a convient measure of time for you it could be 100ms, etc..) state history (in this case the state is the x,y,z and velocity)

-On the client side find the difference between the servers current time (using NTP you can find this to within 5ms accuracy) and the packet you recived (using its timestamp)

-On the client side using linear inteperlation find the x,y,z of the entity taking into account the packets time, and the servers current time diffrence.

Voila you have no packet buffering, little introduce latency from the sychronization scheme anyways, and you''ve compenstated for loss and the variablity of the packet stream. For smoother intperlation is suggest including in your state linear acceleration and angular velocity.

This is as clear as i can get, hope it helps.

Good Luck

BTW use UDP for best results, though TCP_IP would work but due to its large unpredictable latency, not as well.

-ddn
Advertisement
thanks for the info ddn, i found stuff to help me out on that site you listed. I havent had time to implement it yet, but I can tell it will help me out alot.


"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

This topic is closed to new replies.

Advertisement