Hi all!
I was wondering, what is the right way to understand if my code is frame rate dependent?
I tried to open a new project from the platformer game template.
I made this 3 tests:
-
Frame Cap = 0; V-Sync enabled (normal setup):
This is the normal and default setup. (my screen refresh rate is 60Hz) -
Frame Cap = 10; V-Sync disabled (slow frame rate):
In the test 2, the game seem to preserve its original speed (in term of character moving and jump). But as you can see, it appears that physics timestep seem to be linked to the frame rate as frequently it fails to detect collisions properly. -
Frame Cap = 1000; V-Sync disabled (ultra high frame rate):
In the test 3, the character is moving and jumping/falling like at the half of the original speed. But also the character animation is going slower, so I don’t understand…
(GIFs are at 25 fps)
So what I’m doing wrong here?
It is right to use the frame cap and V-Sync to test frame rate dependency? What actually does the frame cap in detail? In which range it must be used?
How to prevent frame dependency? Is it enough to multiply by dt in all my move operations?
How to deal with frame dependent physics (if it is so?)
Thank you!