Weird Defold 144hz monitor bug

Hello. I have 144hz monitor and normal 60hz monitor and if I change game window from 60hz monitor to 144hz monitor, game runs faster. I already talk about this with Mikael and Robert, and they told me to make a topic in here.
I use windows 64 bit.

2 Likes

I have this bug as well. I’m on a Windows 10 64-bit, also with one 144hz monitor and one 60hz monitor.

Printing out delta time every update(), I noticed that it’s staying at 1/60 of a second, even on the 144hz monitor. The easy solution would be to have the delta time scale by 1/refresh_rate (ie. having 144fps). There are probably more refined solutions though.

I noticed another interesting thing about this bug: when you build to HTML Defold builds to a new tab in the latest selected window of your default browser, and whether the game is twice as fast or not depends on in which screen this window lies at the time of building. If you move the window over from one screen to the other after building the game speed won’t change. (using Chrome)

I had the same symptoms when my graphics card had vertical sync turned off

2 Likes

I was thinking about it and suddenly remembered that Robert Nyström covers this topic in his book Game Design Patterns, more specifically here in chapter 9:
http://gameprogrammingpatterns.com/game-loop.html#the-pattern

Very high-level of course, but I thought you might find it useful :smile:

I had quite opposite situation. My game was running slower on older Android phones while it was OK on PC and decent phones.
I’ve fixed it by switching from constant to variable update time.
In project settings check the “variable_dt” setting.
Then you have to make sure all your manual animations takes dt into account, like:
pos.x = pos.x + speed_in_pixels_per_second * dt

I think this could also help in your case.

1 Like