spasm icon indicating copy to clipboard operation
spasm copied to clipboard

Delta time should be capped

Open silverweed opened this issue 3 years ago • 0 comments

I tried the "underrun" example on browser and my PC had a couple of hiccups since I was compiling some code in the meantime. Every time this happens the character gets "teleported" a long distance because the delta time between frames is never capped to a maximum amount, so it may grow huge when the browser freezes for more than a fraction of a second.

I'm not sure if this would be preferably done at the "engine" level (basically here) or if every game should decide what's its delta time cap - I'd probably go with the first but there's no right answer here.

silverweed avatar Sep 15 '21 10:09 silverweed