Hi. New Defold developer here..
I was playing the Sidescroller tutorial project and noticed that it seemed like the framerate was a little low. It's not unplayable but the movement of the stars is not at all smooth like I hoped it to be.
I checked the project's update frequency and saw that it was set to 60. This doesn't seem to be consistent with what I'm seeing on screen so I wrote a little script in the GUI to display what the current framerate is.
self.score = 0
self.frame_time = 0;
self.frame_counter = 0;
self.score_node = gui.get_node("score")
self.framerate_node = gui.get_node("framerate")
function update(self, dt)
self.frame_counter = self.frame_counter + 1
self.frame_time = self.frame_time + dt
if self.frame_counter > 100 then
local framerate = self.frame_counter / self.frame_time
self.frame_time = 0
self.frame_counter = 0
This script appears to work, and is reporting that the framerate is approximately 59 fps. Strange.
Now, I anticipated the possibility of the project running slowly. I'm actually running it on a Chromebook which has Linux installed on it, so I expected it. However, what I didn't expect was for Defold to report the framerate to be high when it's clearly not.
Also, another unexpected thing that happened was, when I turned update frequency down to 30, the game actually appeared to get smoother.
My question is: how can this be? Is the rate at which Defold draws to the screen separate from the rate at which it calls update()?