Handmade Hero»Forums»Code
Jason
235 posts
Question concerning frame rate and Jon Blow's 'Framerate Independence' youtube talk
Edited by Jason on
I watched Jon Blow's video today on framerate independence. In it he states there isn't really a way currently (that he can think of) to program a truly framerate independent game. However, he proposed a solution, for smaller indie games anyway, to try and fix a lot of the issues with framerate and physics which you can watch for yourself here (at the 1:51:34 mark). Basically, his idea is to fix your time-step at a much smaller rate, like 1/480th of a second instead of 1/60th or what have you. He states computers are fast enough now that you should be able to reasonably simulate at this time-step as long as you optimize reasonably. If your time-step doesn't multiply evenly into the frame rate then you during the last simulation step, just before you hit the monitor refresh, you multiple everything by a different timestep which makes you hit the monitor refresh evenly (e.g. (1/480th * k) where k is less than 1 and is a number that make you hit the refresh). Jon said this would be the simplest solution and he would still need to test it out in practice. He was hoping this would be enough to fix the issue but if not then there was a more complicated solution he could add on top of this.

Since I couldn't seem to find any updates by Jon on this solution, has anyone actually tried to implement something along these lines for their game? Or do you see any potential problems with this solution? Or have you implemented something else that has worked reasonably well for your game?
Simon Anciaux
1337 posts
Question concerning frame rate and Jon Blow's 'Framerate Independence' youtube talk
When I did some research on 2d physics a year ago it seems to be a common way of doing update in physics engines. I think there was a paper or video about this from the creator of box2d but I can't find it.
Fix your timestep
Time stepping