[MUD-Dev2] [TECH] Client time-server time sync

Lachek Butalek lachek at gmail.com
Wed Apr 25 00:00:41 CEST 2007


On 4/23/07, Roger D Vargas <luo_hei at yahoo.es> wrote:
> Yesterday I was talking to a friend and he insisted in the need of
> having perfectly synchronized server and client time, among other
> things, to calculate movements. I had thought that such thing was not
> needed, as I just need the notification of move start and figure out
> every certain time the location of player until a move stop notification
> arrives. Am I wrong about this?

Never trust the client. You cannot expect that the client will report
anything correctly. In an ideal world, only listen to the client with
regard to reporting UI input, and even then, sanity check everything
(to ensure, for example, that you're not getting more inputs / second
than a human could conceivably produce).
Besides, regarding movement, the often considerable and always
unpredictable moments of lag actually starts making a noticeable
difference. 350ms is a couple of footsteps and a toon could definitely
change direction during that time.
If I were doing it, I'd go with your approach - you get a 'start move'
command, get the bearing and start a timer. Move the toon (server
side) in the specified direction unless you get a 'stop move' command.
After a predetermined amount of time - say, 1000 ms - probe for
bearing and speed again. Adjust accordingly.
This is not perfect and will affect the gameplay. You cannot do an FPS
with this approach. Plan ahead and don't include gameplay that depends
on ultra-fast reaction times. If you're doing an FPS, you have to
cheat - instancing, dynamic load balancing, maybe "LOD" stuff like not
tracking your exact position server-side until you're within range of
an entity you can actually affect, and so on.



More information about the mud-dev2-archive mailing list