🎉 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!

Time Based Events

Started by
1 comment, last by Galileo430 22 years, 8 months ago
I was just wondering how I should handle time based events. Such as jumping.. A jump starts at time X and then it ends at time Y. How would I relate to the server that the jump started at time X? Wouldn''t that lead to the appearnce of lag on the client if all of a sudden the person just appeared in mid air?
------------------------------------------------------------I wrote the best video game ever, then I woke up...
Advertisement
Interesting question, id personally for every tick (X milliseconds of game time) send a message indicating that a jump is in progress. Once a jump as finished the messages stop, if a delayed message is received the game must wait (or interpolate / assume) as best as it can. You can also send stop/start messages but that can have other problems also if messages are delayed.
CorsairK8@Fnemesis.comLinux Debian/GNU RulezThis is my signitory!C Is Tha Best!
As with any time critical events (firing, direction changes etc) you want to get the info out about it as soon as possible. You could for example have the client relay to the server that the player has jumped and the server then relay that on to the other players with the jumping motion kept in sync with regular update packets.

Also to speed up the processing you could have a packet flag that specifies the urgency of the packet and use that as a basis for a sorting operation on the clients/servers incoming packet que.

You can''t beat lag completely just minimise its effects.

This topic is closed to new replies.

Advertisement