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

Started by
1 comment, last by neur 23 years, 9 months ago
if i was coding a multiplayer realtime game.. and i somewhat wanted the clients to agree what the time is... what do i do? how does two computers linked, agree what the time is when they really dont know the lag ? and dont know if there is a lag one way but not the other
Advertisement
Well... If you ping the other computer and halve the round-trip time, that''s as close as you''ll get to the latency. In what circumstances would the latency be different in each direction? Of course, the latency is going to change over time, but for ''synchronizing watches'' the ping method should work. You might want to do it a few times until two successive tries give the same time... That''s what I''d do. Now, why would a game want to know the exact time?
there is many cirumstances where its practical to agree what time it is. lets say an event is going to happen, and, it is going to last for a spesific time. if on a realtime game, one client get info about an event after the event have ended, there is no need to show it..

lets say you want to make quake (heh), and one pc says that a rocket have been shoot.. then you want the rocket to be at the same place on all clients.. not the rocket at one pc have hit and exploded when on another pc its halfway.

This topic is closed to new replies.

Advertisement