Advertisement

Game ticks vs. Real time

Started by November 14, 2005 11:26 PM
2 comments, last by hplus0603 19 years, 3 months ago
I'm trying to decide on a timing scheme for a client/server action game. Most of the stuff I read recommends server-side game ticks that do all of the processing at that time. This seems like its the easiest to implement, but what about events that happen at different times in a single tick? For example: If the tick length is 1, and the current tick is 0, what happens if the player moves left at time .25 and then fires at time .75 (assume both moves reach the server in time). When the server performs the tick operation to move the time from 0 to 1, does it factor in the .5 tick-length delta between the two different moves? Or do the two events happen simultaneously according to the server? The other idea I was playing with was a real-time timing scheme. Whenever the server received a move from the client, it would calculate that move at that time instead of waiting for the next tick. Has anyone had any experience with implementing this type of system? Thanks for your time.
Quote:
what about events that happen at different times in a single tick


The definition of a "tick" in time-stepped simulation is the smallest possible granule for event resolution. All events that happen within a single tick happen "at the same time" -- there is no way to resolve ordering within the tick. For a properly implemented system, actual internal ordering wouldn't matter, because you'd first ask all objects to resolve what they want to do, and then you'd perform the effects after everyone queued their effects.

Another model of simulation is discrete event simulation, where each event has a specific timestamp to very high resolution; the size of a "tick" is then dependent on what events are in the queue -- but if two events have exactly the same event time, then you still need to make sure it's order independent.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement