Game runs super quick in web browser but our local builds ran smooth and fine

When testing a local build of our game in Defold, our game runs as designed (the animation and player movement speed is correct). But when we make a web (HTML5) build of our game, all of our animations are sped up to like 4-5 times what they should be when playing in the web browser. When I run a Windows build of it, it runs correctly (the speed of the animations and movement match our code). Would anyone know why that is and/or how we can prevent it? Or has anyone else ran into this issue?

Try messing around with VSync (in project settings - Display). I remember testing a couple of things and while I can’t remember the specifics, I found these results I had back then. Turning VSync off and setting a frame cap of 60 seems to be the safest option, but you should test it for yourself to make sure.

3 Likes

Thanks! I will definitely give that a shot!

1 Like

I had another look at the link I posted and, more importantly, another coffee, and I feel I should clarify what I was doing and what all those numbers mean.

My issue was with having 144 hz refresh rate, which made the program run faster under certain conditions, but more importantly causing the character in a simple test program jump to a different maximum height.

This jump height is what the numbers in the last four columns mean, around 520 being the intended value and highlighted in yellow. The four rightmost columns show jump height with 144 hz refresh rate (normal build and html5) and then with 60 hz set (again, normal build and html5).

Setting my desktop refresh rate to 60 hz helped me, but that’s obviously not a great solution if you want other people play to play the game as intended.

I believe I ended up relying on go.animate to move stuff exclusively, rather than using dt, which fixed this across the board, since I didn’t really feel great limiting the frame rate. It’s been a while, though, and VSync has always been one of those things I’ve stubbornly refused to understand, so I I can’t really say much else on this topic.

Here’s the relevant thread, plus there’s a whole bunch of others if you search for “vsync”.

1 Like

That seems to be a similar, if not the same issue we are facing. I have a 144 Hz refresh on my computer and i have the issue with everything being fast. A buddy of mine I had test it, also had that same issue but has the exact same monitor and refresh rate as me so that makes sense. Other people aren’t seeming to have this issue so i’m guessing it is an issue with that high refresh rate.

I appreciate you taking the time to fill me in on these details and I will definitely use this thread as a resource when looking into this issue. Thank you so much!

2 Likes

Yep the issue was that V-Sync was on, I turned it off, set the max frame rate, and rebuilt it and it is working perfectly. Thanks for all the help!!!

3 Likes