Spielerando

The camera freezes when I pause and lags behind units at fast-forward

Strategy games let you pause and speed up the world, and the camera is caught in the middle. Run it on game time and it stops with the pause; run it on real time and a fast-forward leaves a followed unit far outside the screen. Here is which clock each part uses and the one change that fixes the lag.

Why this works

The game world and the player's window onto it run on different clocks. Pausing the world must not freeze the player's hands, and speeding it up must not leave the view behind, so the camera follows real time and only its pull toward the target grows with the speed.

When not to use it

It is the wrong approach when the camera should be part of the world, such as a cinematic moment that must stay in step with the action, or a replay that has to match every frame. Run those on the game clock so they pause and speed up together.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 2 common mistakes and the fix
  • 28 lines of example code with 3 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "The camera freezes when I pause and lags behind units at fast-forward" (read_entry strategy-camera-time-vs-game-speed) in my game. Build it step by step, and show me how you checked that it works.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP