Topics / Building a game

Core concepts

Delta time

Delta time is how much time passed since the last frame. Movement is multiplied by it so a character moves at the same speed on a fast computer and a slow one.

Watch: see it in 30 seconds

Video coming soon
A 30-second visual explanation

Why it matters for your game

  • Without it the game runs faster on better hardware. A villager that walks nicely on your PC sprints on a gaming laptop and crawls on a phone.
  • When your AI writes 'speed * dt', that is delta time. Ask for it on every movement, timer and animation.
  • It is also why a long pause (switching tabs) can teleport characters: a huge delta. Engines cap it; ask whether yours does.

How it comes up when you talk to your AI

  • 'dt', 'deltaTime', 'elapsed', 'time since last frame', 'clamp the delta'.
  • Timers that drift and animations that run at different speeds on different machines are the symptom.

Ask your AI about it

Paste this into the assistant you build with. It is written to get a useful answer for your own project, not a textbook page.

Explain delta time with an example of a character walking across the screen, show the bug that happens without it, and tell me how to check that our game uses it for movement and timers.

Related terms