Handmade Hero » Forums » Code » Question concerning frame rate and Jon Blow's 'Framerate Independence' youtube talk
boagz57
Jason
43 posts
#16331 Question concerning frame rate and Jon Blow's 'Framerate Independence' youtube talk
1 month, 1 week ago Edited by Jason on Sept. 14, 2018, 7:39 p.m.

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?
mrmixer
Simon Anciaux
468 posts
#16336 Question concerning frame rate and Jon Blow's 'Framerate Independence' youtube talk
1 month, 1 week ago

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