Advertisement

Client Prediction Issues

Started by September 11, 2006 09:09 AM
3 comments, last by CadetUmfer 18 years, 5 months ago
There must be a logical flaw somewhere in my system, as client positions are signficantly different from those on the server. Was hoping maybe someone could spot it. SERVER:
if we have a new user command:
    get the users's state at the time the command was sent
    delta time is current time - time command was sent
    execute physics with new user command
else:
    delta time is normal (time since physics was last executed)
    execute physics with last user command
I know I could do like the Source Engine and give each command a time it needs to be executed for, but that seems like it would necessitate reliable communications, wheras my current system is almost purely unreliable. Note: This is an action game. I send state every 50ms.
Anthony Umfer
If you send state, then you should just be interpolating between those states. You won't be "executing commands" very much (except for gunshots, etc).

If you send commands, you MUST use a relible method of some sort, else there will be divergence. (Although the reliability can be done at many different levels)
enum Bool { True, False, FileNotFound };
Advertisement
Yeah, sorry--by command I just mean the state of the user's controls.

Either way, I somehow missed Gaffer on Games during my research, so time to rethink some things anyway (fixed timestep, etc).

[Edited by - CadetUmfer on September 11, 2006 4:46:17 PM]
Anthony Umfer
One thought, how do you determine what time the command was executed? Do you sync the clock between the client and the server somehow?
Yeah, using RakNet, so it'll automatically adjust timestamps to local time.

Each update has a timestamp.
Anthony Umfer

This topic is closed to new replies.

Advertisement