87
delta time
Move by time, not by frames. A slow machine must not make the jump shorter.
What is delta time?
Delta time is the seconds since the last tick. Velocities are units per second, multiplied by dt. A spike in dt (tab backgrounded) must be clamped or the character tunnels through the wall.
Why does delta time matter when vibe coding?
Models do `x += 5` per frame. At 30fps the game is half speed. At 144fps it is a blur. Say per-second and clamp dt.
How do you do delta time?
All motion is `speed * dt`. Clamp dt to a max (one or two frames). Pause sets dt to 0. Do not accumulate uncapped time after a stall.
How do you ask a model for delta time?
Use delta time. Speeds are units per second. Clamp dt so a hitch does not teleport. Pausing must pass dt = 0. Do not move by a constant per frame.
What goes wrong with delta time?
Clamping so hard that a long frame drops time and the sim falls behind forever. Cap, and if you must, run a few fixed steps to catch up — with a limit.