presidenten Posted September 15, 2015 Share Posted September 15, 2015 Hi guys!Would you mind sharing some tips on optimizing performance in Phaser games in this thread? Link to comment Share on other sites More sharing options...
conradk Posted September 15, 2015 Share Posted September 15, 2015 is your game running generally slow or what seems to be the issue? Link to comment Share on other sites More sharing options...
clark Posted September 15, 2015 Share Posted September 15, 2015 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. Tilde and Skeptron 2 Link to comment Share on other sites More sharing options...
presidenten Posted September 16, 2015 Author Share Posted September 16, 2015 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 More sharing options...
Tilde Posted September 17, 2015 Share Posted September 17, 2015 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 cannot believe how much this helped me. clark 1 Link to comment Share on other sites More sharing options...
goyeneche Posted September 17, 2015 Share Posted September 17, 2015 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 More sharing options...
presidenten Posted September 18, 2015 Author Share Posted September 18, 2015 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 More sharing options...
Recommended Posts