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 instead and see the difference. 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:

https://jdickinsongames.wordpress.com/2015/01/22/numerical-integration-in-games-...

https://gafferongames.com/post/integration_basics/

https://gafferongames.com/post/fix_your_timestep/


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.

StatusReleased
CategoryTool
PlatformsHTML5
Rating
Rated 5.0 out of 5 stars
(4 total ratings)
AuthorDonitz
GenreEducational
Made withGodot
Tagsframerate, Game Design, gamedev

Download

Download
timestep_test_source.zip 40 kB

Comments

Log in with itch.io to leave a comment.

5 Hz with interpolation looks really fun