• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 Inconsistent frame rate on browser

gotad

Member
Hey guys

I've been having a good deal of trouble in optimizing my game's browser performance as much as possible.
Since I've starting running profilers and/or browser (Chrome) performance monitors, however, I've noticed that the game will sometimes run at a consistent 60 FPS (target game speed),
or for seemingly no reason, an oscillation between 30 and 60 FPS or less.


I've tried recreating game states where I see one of these two degrees of performance, made sure to close other applications/tabs, tried other browsers, etc. all with the same apparently random
inconsistencies. Sometimes it will be stable, sometimes it won't, ostensibly regardless of game state or anything.

Does the poor performance, when it does occur, have to do with the default sleep margins?
I've also noticed that the game's performance is tied to my monitor refresh rates, where 60 hz will encounter the above issue while 120 hz will remedy it all together. I assume this is relevant.

Here is the browser version of my game (as of a month or two ago) if you want to see for yourself: It's a bullet-hell esque game with lots of enemies, so I'm aware that getting things to run consistently smoothly on browser might be a pipe dream for most users. I just want to make sure with you guys!

Thanks!
 
Last edited:

8BitWarrior

Member
I suspect this issue has something to do with multi-monitor setups and competing refresh rates between them. If you have a second or third monitor enabled, try disabling them and running the tests again.
 

gotad

Member
I suspect this issue has something to do with multi-monitor setups and competing refresh rates between them. If you have a second or third monitor enabled, try disabling them and running the tests again.
Thanks for responding

This may have solved the inconsistency issue (probably need to test it more), but the performance has gone to consistently bad with this change.
It looks as though performance is entirely tied to the refresh rate of the monitor. I've tried refactoring and profiling, but nothing really gives me insight
into why performance is so inconsistent. I suppose I'm back at square one.

Does anyone know of any things regarding sleep settings or graphical settings that might increase performance for HTML on GMS 2.2x?
 

gotad

Member
***Update***
The browser game performance still seems inconstistent; sometimes working just fine at 60fps, then other times oscillating around 30fps.
After doing some tests, I've noticed that when the browser game is performing badly, clicking on a new tab in the same browser (anything) and then tabbing back into the game will fix the performance completely.
And I mean, 30fps to buttery 60fps just from a second of being tabbed away!

Anyone know why the heck this is the case? Does it have to do with pause events? I don't see anything about it in the profiler or html!
Here's a json of the kind of performance I'm talking about, starting off poorly, tabbing out and in and fixing the performance:
https://litter.catbox.moe/o0cx1h.json
(you can download the link as JSON and upload it to Chrome's devtools in the Performance tab)
 

Spooks

Member
I found ticking the "auto-detect WebGL" box in HTML5 build settings stopped my game randomly slowing down. No idea why!
 
Top