-
Notifications
You must be signed in to change notification settings - Fork 121
Calculating game time
This is a placeholder for documentation relating to how to calculate game time.
There are two distinct time measurements within a replay: replay time and game time. Replay time progresses regardless of whether the game is paused, while game time starts at negative values and reaches 0:00 at the horn.
This is an entity within the replay data structure that holds properties relevant to game rules and timing, such as m_fGameTime and m_flGameStartTime.
Another type of entity within the replay data structure, containing properties related to hero units, such as mana (m_flMana) and max mana (m_flMaxMana).
Listing down these challenges so that research onto the calculations can be built on top of each other.
Game time is calculated based on ticks, with an assumption of 30 ticks per second. However, there may be variations due to server clock inaccuracy, leading to discrepancies in the conversion between seconds and ticks.
Determining the initial game time accurately poses a challenge, as it may vary between replays and can be affected by factors such as pre-game activities and server synchronization.
The replay also records actions even while the game is paused. This means that there needs to be a way to normalize (i.e. remove pause time) to ensure game time is calculated properly.