Spielerando

Make sliding, slowing down and camera easing feel the same at any frame rate

A hero that glides to a stop in a fraction of a second on one computer slides for ages on another, and a braking hero can even shoot backwards. The cause is a small piece of arithmetic the AI writes the quick way. This entry gives the versions that behave the same everywhere.

Why this works

Slowing down is a rule about time passing, not about frames passing. If you describe the loss per second and let the elapsed time decide how much applies, then two short slices and one long slice end in the same place, whatever the screen does.

When not to use it

Skip it when the game already runs in fixed steps of equal length: there the plain per-step shortcut is exact and simpler. Also skip it for effects that should be tied to frames on purpose, such as a flicker of exactly three pictures.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 13 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 "Make sliding, slowing down and camera easing feel the same at any frame rate" (read_entry action-friction-same-at-any-fps) 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