Fixed Time step game loop

This is proposal for Babylon to ship a default fixed Time step game loop. Fixed time step game loop is important for running deterministic and reproducible game logic. This is a requirement for high quality multiplayer network synchronization. This topic has been previously discussed at: Fixed Update Loop - #6 by MackeyK24
with inclusive conclusion.

The default babylon.js loop is currently variable and inconsistent between browser and headless environments.
a static 16ms timeout in headless environments and requestanimation frame variable delta timesteps on browser Babylon.js/thinEngine.ts at master · BabylonJS/Babylon.js · GitHub

3 Likes

Adding @Cedric cause I think we do support this for physics ?

Yes, it’s already supported and documented : Using A Physics Engine | Babylon.js Documentation

3 Likes

Well, unfortunately it doesn’t work Gameloop. Calculations are continuing during the pause.

Any idea if it’s still possible with Babylon v6/Havok?
The doc link is not found.
I’ve looked through the code and it seems the only case, where the physics engine is using a fixed timestep instead of display delta, is when Deterministic Lockstep is enabled (which is documented in section “animation”)

Indeed , fixed timestep for physics V2 is supported but no substeps yet.