Jump to content

Improve html5 game performance


PhasedEvolution
 Share

Recommended Posts

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

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

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: 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...