Fixed vs Variable Timestep
A quick comparison between using variable timesteps and fixed timesteps made in Godot.
Beware: this comparison may not apply to native games. For example, I don't think V-Sync does anything in a Web build.
The default integration method is Semi-Implicit Euler (v += a * dt, p += v * dt). You can switch to Velocity Verlet using V. The integration method has no effect on horizontal movement, as there is no acceleration horizontally. There is vertical gravity acceleration downwards.
Depending on whether you apply the gravity acceleration before or after you set the jump velocity, the player will either jump way too high or way too low at low framerates using Semi-Implicit Euler.
Read more about integration in gamedev at:
Feel free to debate the points for or against fixed timesteps. Personally, this test has convinced me to NOT use a fixed timestep and instead use a better integration method where it matters, but I understand why a fixed timestep can be better if you want more reliable physics.
Also feel free to download and check the source code.
|Tags||framerate, Game Design, gamedev|
Log in with itch.io to leave a comment.
5 Hz with interpolation looks really fun