Time runs (approximately) 5 times faster in my PC build (SOLVED)

#1

Good day, colleagues!
I’m using defold editor 2, its latest releases.
I found a strange bug, time in defold project runs 5 times faster, when I use build command. So all animations run 5 times faster, and sprites move 5 times faster as well.
I tried building the same project on my mac and on android. They look the same, the animation speed and unit speed are back to “normal”.

I print dt value in
function update(self, dt)

self.time_passed = (self.time_passed or 0) + dt
print(‘hero:attack:sim_update’, dt, self.time_passed)
and it confirms my concerns. time_passed changes 5 times faster then seconds do.

Have anyone seen this before?

0 Likes

#2

Hello @atrifanov

It sounds like an issue with vsync being disabled in your graphics driver. Try updating your graphics driver or enable vsync in your driver settings and see if that helps. What platform are you seeing this issue on?

In the meantime you can check “variable_dt” in game.project. Defold relies on vsync and updates with a fixed dt. Checking variable_dt will give a dt which follows actual time closer instead.

2 Likes

#3

Thank you, Johan!
I saw that issue on my windows notebook.
Enabling Variable_dt in project settings solved the problem for me. I will play with vsync to find what solution fits me best. :sweat_smile:

2 Likes

#4

I have this same issue but isn’t solved with variable dt, on a Laptop with NVidia 540m, when the VSync is set globally of in the driver:

All projects including tutorials and demos runs extremely fast. No matter if I set frame cap to 0 or something like 30 or 60, disabling or enabling VSync on game.settings.

The dt value is always the same:
defold_img1

Other programs and games run well with this VSync OFF setting on the NVidia control panel, so I think the engine has to deal with it, not the users.

The laptop has Windows 7-64. Toshiba.

EDIT: Sorry I have accidentally logged with a different goolge account, my actual account here is @piXelicidio

0 Likes

#5

Sorry for the confusion, I was the one writing the previous post.

0 Likes