Jump to content

Optimize performance


presidenten
 Share

Recommended Posts

is your game running generally slow or what seems to be the issue?

Generally slow now. Before I updated to 2.4.3 I had kind of good performance even on Ipad2. Now it only runs well on iphone 5s and mac google chrome. Im going to try some obvious stuff like decreasing size of sprites and such, but all tips are welcome.

Thanks for the tip clark! Ill have a look at game.forceSingleUpdate tomorrow.

Link to comment
Share on other sites

I am using a lot of Physics and AI in a p2 game. I improve perfomance by:

  • Recicling objects using pools, and before the game starts create (and kill) a number of objects you consider will be in screen at the same time, just to load them in memory.
  • If game requires AI, I only calculate things when are visible or near if possible, and don't calculate thinks in update(). I do it with game.time.events.loop, I put 200ms for example.
  • In general, avoid doing things when you can't see them.

 

game.forceSingleUpdate = true;

In the first state of your game.  It really depends on the game though, I do not use Physics and get better performance with forceSingleUpdate. 

 

 

I just tried it and in my case works strange, I will make some tests

Link to comment
Share on other sites

I am using a lot of Physics and AI in a p2 game. I improve perfomance by:

  • Recicling objects using pools, and before the game starts create (and kill) a number of objects you consider will be in screen at the same time, just to load them in memory.
  • If game requires AI, I only calculate things when are visible or near if possible, and don't calculate thinks in update(). I do it with game.time.events.loop, I put 200ms for example.
 

Ill try out the time.events.loop approach. There is some logic being done by each character right now. Thanks!

ForceSingleUpdate didnt really do much for me. Im also using P2 btw...

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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