On the dev branch (the alpha version of the editor), we now have support for fixed time steps for the physics, and also variable framerate for the game loop.
Our goal was to solve the framerate issues our users have experienced on machines with displays that runs faster than 60Hz.
We’d like for you to test these settings to make sure that they work as intended for your use cases.
These are the relevant settings:
-
physics.update_frequency
- an integer setting in Hz
-
0
means variable frame rate (default) - e.g.
60
means it updates 60 frames per second. - We recommend e.g. 30 or 60 Hz
-
display.update_frequency
(integer)- an integer setting in Hz
-
0
means variable frame rate (default) -
> 0
means fixed frame rate. Capped at runtime towards the actual frame rate. I.e. you cannot update the game loop twice in an engine frame. - Fixed time steps may be used to simulate slower devices, or throttle the performance at runtime. E.g. set to
30
to simulate the frame rate of KaiOS.
-
display.swap_interval
- An integer setting that sets the OpenGL swap interval
- (doesn’t work with Vulkan)
-
0
disables vsync - Default is
1
-
(DEPRECATED)display.vsync
- boolean
- If set to false, forces a
display.swap_interval = 0
-
Use the sys.set_update_frequency(hz) to control the “display.update_frequency” at runtime.
Here’s the alpha build: