PhasedEvolution Posted December 3, 2016 Share Posted December 3, 2016 Greetings. I have been doing some tests with my html5 test game. It is made on phaser p2 physics. I am having some low fps after spawning some sprites. I am not sure why is that... Could someone give me some tips on how to detect what is causing the fps drop? On profiling for example... ( I dont always use phaser but I think this applies to most situations) Link to comment Share on other sites More sharing options...
rgk Posted December 3, 2016 Share Posted December 3, 2016 Without seeing code its hard to give a good answer. But number one thing is remove unnecessary code from the update loop. Have them triggered by events, like updating text etc... PhasedEvolution 1 Link to comment Share on other sites More sharing options...
Skeptron Posted December 3, 2016 Share Posted December 3, 2016 Issues with performance almost always come from rendering. So check if you don't have too big tilemaps, sprites/tilesprites, or too much of them. Test different game size, too, as this can greatly influence performance. Also, test your game with CANVAS (as usually WEBGL tends to perform worse). PhasedEvolution 1 Link to comment Share on other sites More sharing options...
PhasedEvolution Posted December 3, 2016 Author Share Posted December 3, 2016 40 minutes ago, rgk said: Without seeing code its hard to give a good answer. But number one thing is remove unnecessary code from the update loop. Have them triggered by events, like updating text etc... 37 minutes ago, Skeptron said: Issues with performance almost always come from rendering. So check if you don't have too big tilemaps, sprites/tilesprites, or too much of them. Test different game size, too, as this can greatly influence performance. Also, test your game with CANVAS (as usually WEBGL tends to perform worse). I see... I got more 6 constant fps thanks to that ! Well it still gets bad when I spawn the sprites. I am able to see what functions or whatever is doing that by profling right? Link to comment Share on other sites More sharing options...
rgk Posted December 4, 2016 Share Posted December 4, 2016 Yeah you can use profiling to help but as @Skeptron said your going to see the rendering being the main issue. Finding what is exactly triggering that can be harder. If you break more of your code into functions it will help find where the issues are. I would do what skeptron said and test numerous situations will small game size, smaller sprites, etc... making sure p2 is disabled on sprites that don't need it etc... check this thread also, as this question has been asked before: PhasedEvolution 1 Link to comment Share on other sites More sharing options...
Recommended Posts