EDIT: Firefox decided to finally run my game smoothly. I don’t know what happened but testing the game out several times in the last 30 minutes, the game’s frame rate issue suddenly disappears. Worked instantly the first time in Edge so I’m now thinking this is probably from the Kongregate side dealing with recently uploaded games rather than WebGL.
So, I’ve basically completed the current game I’m developing. Tested it in the editor and everything works really well. Frame rate is consistent and there are no lag spike that happened after several tests. However, when I build the game and upload it to Kongregate, I noticed the game seems to suffer from low frame rate at a specific part.
When the game first loads up, the frame rate is good. As it’s a quick game, I only have to play one round for 90 seconds or so before I die. If the player dies, it will return to the menu screen. At this point, the frame rate is still good enough so I tested the game for a second round and that’s when the frame rate start dropping significantly. It’ll go from smooth to constantly stuttering in less than 5 seconds or so. I’m not sure what is causing this behaviour as this doesn’t happen in the Editor. Looking at the profiler, my game doesn’t seem to show anything problematic and keeps up a good frame rate. The weird thing is, when I reload the game page and load the game again, the frame rate becomes playable again but as soon as I tried playing for a second round, it turns unplayable.
The game is a simple game and doesn’t contain any complicated mechanism nor use physics heavily. Even if it did, testing it in the Editor shows a different outcome because it should have shown the change in frame rate once I start the second round. I’m just going to assume for now that it’s probably a WebGL problem I’m not aware of. If anyone knows any reason why this is happening, please let me know.
Profiler screenshot:
That spike lag is where I start the second round. It is displaying that spike because the scene is changed but ignoring that, you can see the frame rate is consistent. In the WebGL build, it should be way taller than the ones showing in the screenshot, after that spike.
