Tic

A tic is either a realtic or a gametic.

A realtic is 1/35 of a second (roughly 28.571 milliseconds), as measured by the system real-time (wall-clock) timer, and is the designed frame rate for the game.

A gametic is one game state update, which ideally can be completed in one realtic with time left over. However, sometimes (particularly in multiplayer games subject to network delays) gametics take longer, and the game will slow down.

Each gametic corresponds to a ticcmd_t structure. These structures represent the state of the input devices (keyboard, mouse and joystick) at a given time, and are used to update the game state. This mechanism provides a good deal of flexibility, because the ticcmd_ts can be passed over the network for multiplayer games, and to/from disk files for recording and playing demos.

In the Doom source code, the ticcmd_t is defined as follows:

// The data sampled per tick (single player) // and transmitted to other peers (multiplayer). // Mainly movements/button commands per game tick, // plus a checksum for internal state consistency. typedef struct {     char forwardmove;   // *2048 for move char sidemove;     // *2048 for move short angleturn;   // <<16 for angle delta short consistancy; // checks for net game byte chatchar; byte buttons; } ticcmd_t;

The function G_BuildTiccmd in g_game.c fills a ticcmd_t structure based on the keyboard, mouse and joystick states. It uses the state of the "run" control and the "strafe on" controls to properly interpret the other controls.


 * forwardmove and sidemove record the signed net total of the various forward/backward and right/left controls (each total limited to no more than 50 and no less than -50).
 * angleturn records the signed net total of turning motion controls.
 * consistancy (spelled incorrectly, but as in the source code) is normally the player's x-position, and is used to confirm that network games are in sync.
 * chatchar can be a character to be added to the interplayer message area on the heads-up display.
 * buttons encodes the following actions: attack, use, change weapon (including new weapon number), pause, and save game (including savegame slot number).