Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Render and compute as fast as you can to get the maximum frame rate (as capped by the vertical sync)</p> <p>Don't use a timer, they're not reliable &lt; 50-100 ms on Windows. Check how much time has passed. (Usually, you need both delta t and an absolute value, depending on if your animation is physics or keyframe based.)</p> <p>Also, if you want to be stable, use an upper/lower bound on your time-step, to go into slow-motion if a frame takes a few secs to render (disc access by another process?) or skip an update if you get two of them within say 10 ms.</p> <p><strong>Update</strong> <em>(Since this is a rather popular answer)</em></p> <p>I usually prefer having a fixed time-step, as it makes everything more stable. Most physics engines are pretty robust against varying time, but other things, like particle systems or various simpler animations or even game logic, are easier to tune when having everything run in a fixed time step.</p> <p><strong>Update2</strong> <em>(Since I got 10 upvotes ;)</em> </p> <p>For further stability over long periods of running (>4 hours), you probably want to make sure you're not using floats/doubles to compute large time differences, since you lose precision doing so and your game's animations/physics will suffer. Use fixed point (or 64-bit microsecond-based) integers instead.</p> <p>For the hairy details, I recommend reading <a href="https://home.comcast.net/~tom_forsyth/blog.wiki.html#%5B%5BA%20matter%20of%20precision%5D%5D" rel="nofollow noreferrer">A matter of precision</a> by Tom Forsyth.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload