Jump to content

Delta timing

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Domarius (talk | contribs) at 20:20, 27 December 2015 (Seems like it was written by a non-programmer using their interpretation of someone else's explanation. I've given a more accurate explanation, and also attempted to make the distinction between graphics and network programming clearer.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Delta Time or Delta Timing is a concept used amongst programmers in relation to hardware and network responsiveness[citation needed]. In graphics programming, the term is usually used for variably updating scenery based on the elapsed time since the game last updated,[1] (i.e. the previous "frame") which will vary depending on the speed of the computer, and how much work needs to be done in the game at any given time. This also allows graphics to be calculated separately if graphics are being multi-threaded. In network programming, due to the unpredictable nature of internet connections, Delta Timing is used in a similar way to variably update the movement information received via the network, regardless of how long it took to receive the next data packet of movement information.

It is done by calling a timer every frame per second that holds the time between now and last call in milliseconds.[citation needed] Thereafter the resulting number (Delta Time) is used to calculate how far, for instance, a game character would have travelled during that time. The result is, although the movement appears more choppy, the character still took the same amount of real world time to move across the screen, regardless of the rate of update, whether the delay be caused by lack of processing power, or a slow internet connection.

In graphics programming, this avoids the game slowing down or speeding up depending on how much processing load the game is putting on the hardware, which would make for an inconsistent, jarring experience. In network programming, this keeps the game world of each computer in sync with the others.

Big enough delays will eventually negatively affect the gameplay experience, but using Delta Time keeps the gameplay consistent so long as the computer and internet connection meets the minimum hardware requirements of the game.

See also

References