4.6 C
New York
Wednesday, November 12, 2025

How are delta time overruns usually handled, or addressed in any respect?


I used to be implementing deltatime tuning in a recreation after I considered this downside. Think about a management case, with out adjustment for body charge:

Right here, our character jumps to a most top of 12.5 models in 5 frames. Subsequent, as an example our PC is so sluggish that it takes 5 instances longer to course of and render a body:

Graphic showing a game loop tuned to run 5 times faster than normal.

Right here, the character reaches the identical 12.5 top models in simply 1 body, precisely what we needed. However that is the problematic case: when an ordinary replace takes 4 frames:

Graphic showing game loop with faulty calculation.

As you’ll be able to see, the character by no means reaches 12.5 models of top as a result of that may have occurred through the interval between frames. The calculation being carried out will not be strictly incorrect (the unwrapped character would have reached y = 8 within the equal body (7)), however this leap path shortcut might nonetheless find yourself inflicting issues. If a personality in a 2D platformer failed to achieve the correct leap top as a result of there was a lag spike, that may be actually unhealthy and intensely silly.

My query is that this: Is there a basic goal resolution for this or is that this simply the best way issues are? I believe I can dwell with slightly slowdown right here and there in my video games if that is what it takes to be correct, however it will be very handy if there was a greater method.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles