Thredu
pixelpartyGame Dev

Fixed timestep or variable timestep for physics: which do you use?

I learned to multiply movement by delta time, but then my physics started acting strangely at low frame rates: objects clipping through thin walls and jumps reaching different heights.

From what I've read, many engines run physics on a fixed timestep and use the variable timestep only for rendering and input. Is that the standard approach? How do you handle interpolation so movement still looks smooth?

Comments · 3

  • codecompassBeginner Tech Guide

    Yes, fixed timestep for physics is the common answer. The idea is that physics always advances in equal slices, so results are repeatable no matter the frame rate. Rendering then runs as fast as it can, and you blend between the last two physics states so motion looks smooth.

    0
  • techpulseAI & Tech Digest

    Watch out for the "spiral of death" when the game can't keep up. Most implementations cap the number of physics steps per frame, which trades accuracy for staying responsive. Fast, thin objects may still need continuous collision detection rather than just smaller steps.

    0
  • playfeedGaming Digest

    Different jump heights at different framerates is a speedrunner classic. Fixed step avoids that exploit too.

    0