chrispy Posted January 20, 2015 Share Posted January 20, 2015 Hi, I'm new around here, been using Phaser for some months now and I have to say it's really nice. Been working on a game intended for mobile devices foremost. During development, up until now that is, I've been working against version 2.1.3 and performance has been really good on my phone. A week ago I updated to latest version(2.2.2) and now my performance has now dropped significantly. I've re-traced the drop to version 2.2.0, performance got a lot better when I switched to TweenLite instead of the built in Tweens but it's still not good. Particle systems and Tweens seems to be the biggest problem, when I turn off the particles and switch to TweenLite the game works better. I have maybe about 20 particle systems in the game but they don't run at the same time, and as I said, never any problem with them previously.I've got two versions of the game before and after the switch and on my HTC One-phone the performance drop is really easy to spot (I can't publish any links publicly because of confidentiality, sorry).Spent a lot of time trying to revert different parts of the code but still haven't found any solutions. This might of course be fault on my side, I might have missed some new setting or default parameter (or something else), right now I'm stuck and need some help. If I can clarify anything, just tell me. Thank you guys for any help. Link to comment Share on other sites More sharing options...
rich Posted January 20, 2015 Share Posted January 20, 2015 Not a great deal changed between 2.1.3 and 2.2.0 re: rendering (a lot changed in 2.1.3. specifically though) - is there anything you use a lot of? Text objects? Tilemaps? WebGL features? Link to comment Share on other sites More sharing options...
chrispy Posted January 20, 2015 Author Share Posted January 20, 2015 Hi rich, thanks for the answer. No, nothing out of the ordinary. A bunch of sprites of course and I do have a lot of tweens and particle systems as mentioned but they're not used simultaneously that much. I'm playing the older version now and its crazy how much smoother it is compared to the new one. I haven't changed anything game-wise between the versions, just the Phaser update. There's nothing new surrounding how one should manage the creation of emitters or anything? Link to comment Share on other sites More sharing options...
clark Posted January 21, 2015 Share Posted January 21, 2015 I would also like to chip in and say I have noticed the a similar issue. There is no logic to why it happens. The only similarity me and chrispy have is we both use animations and both use particles. Although, the sluggishness is not directly related to any of these visual actions. For example, on a level with 6 cards being dealt out, it can be slow and sluggish but dealing out 24 cards can be silky smooth. This is vice versa and everything in between. For example cards might be fine, but the popup that says "LevelComplete" is sluggish and slow. The best way I can describe it, is that if I could visualise performance, then the CPU is doing this independently from what is occurring in the game. Which is to say that, it struggles, then releases, then struggles and releases. Not enough to be unplayable, but certainly not the smoothness of earlier versions. Slowdowns can occur over 2-3-4 seconds.I also agree it started with phaser 2.1 somewhere at the time where there was a new pixi, new scaling manager, and new edits to the tween system. I also believe that this.game.tweens.removeFrom(object) is broken now, and wonder if something in the tweens system is working overtime. Link to comment Share on other sites More sharing options...
Nick Posted January 22, 2015 Share Posted January 22, 2015 I've kept my game on 2.0.3 mainly for this reason. I've tried updating to all of the releases up to 2.2 but have always reverted back to 2.0.3 after testing because I found animations to not be quite as smooth. This was most evident with particles ( the particles appear to stutter on explosion ). Unfortunately I have not had time to delve deeper into it and I didn't want to open an issue on github without any concrete examples to back it up. I'm expecting to have some time in the next week to pin-point exactly where and how the issues I was seeing were occurring which will hopefully shed some more light on this. Link to comment Share on other sites More sharing options...
clark Posted January 22, 2015 Share Posted January 22, 2015 Thanks Nick! I am the same, it is in my to do list but I am on a deadline so not made any PR or studied the issue. Did anyone reading this experience the problem WITHOUT particles? Seems we all use it here. Link to comment Share on other sites More sharing options...
chrispy Posted January 22, 2015 Author Share Posted January 22, 2015 Hey guys! Clark, what you wrote is what I'm seeing too. Sometimes it works nicely, but only for a short moment before everything becomes choppy again. I would love to help but I'm not that great at debugging javascript, I tried to poke around and revert some stuff but without any luck. I'ts kind of comforting to know that I'm not the only one experiencing the problem at least. You guys use any tweens in your projects? Link to comment Share on other sites More sharing options...
chrispy Posted February 16, 2015 Author Share Posted February 16, 2015 Alright! So I took the time to dig into this problem. I had already established before that the performance problem started when I switched from version 2.1.3 to version 2.2.2. I decided to step trough each check-in in the repo, build it and test it on the phone until I could pin point the issue and thereby find a solution.After a couple of hours I was able to find this from 2014-11-08 19:52:SHA-1: a0cc4c3777f37b51cc77f1051c998ec1b9e76913 * A large refactor to how the internal game timers and physics calculations has been made... The hit on my performance between that version and the previous is very noticeable on my phone.I dont think the code the is 100% same anymore in the latest version but I tried removing everything regarding the "spiralling" management (just about everything in update in Phaser.Game.prototype in Game.js) in the latest phaser version and now my game is back with good performance.Hope this helps you guys too, either to fix it or at least patch your games for now.I don't know yet if this is everything, I will keep an eye out if there seems to be more issues. Best RegardsC clark 1 Link to comment Share on other sites More sharing options...
Triplanetary Posted February 16, 2015 Share Posted February 16, 2015 Alright! So I took the time to dig into this problem. I had already established before that the performance problem started when I switched from version 2.1.3 to version 2.2.2. I decided to step trough each check-in in the repo, build it and test it on the phone until I could pin point the issue and thereby find a solution.After a couple of hours I was able to find this from 2014-11-08 19:52:SHA-1: a0cc4c3777f37b51cc77f1051c998ec1b9e76913 * A large refactor to how the internal game timers and physics calculations has been made... The hit on my performance between that version and the previous is very noticeable on my phone.I dont think the code the is 100% same anymore in the latest version but I tried removing everything regarding the "spiralling" management (just about everything in update in Phaser.Game.prototype in Game.js) in the latest phaser version and now my game is back with good performance.Hope this helps you guys too, either to fix it or at least patch your games for now.I don't know yet if this is everything, I will keep an eye out if there seems to be more issues. Best RegardsC Any plans to post an issue on GitHub? Link to comment Share on other sites More sharing options...
clark Posted February 16, 2015 Share Posted February 16, 2015 Awesome Christian mate! I made a comment on that commit to bring it to Rich attention. I am not sure if we are the only ones facing the problem (something we are doing) or if it is Phaser. Link to comment Share on other sites More sharing options...
chrispy Posted February 16, 2015 Author Share Posted February 16, 2015 Yes, of course, done! clark 1 Link to comment Share on other sites More sharing options...
chrispy Posted February 16, 2015 Author Share Posted February 16, 2015 Perfect Clark, I think something to keep in mind is that it doesn't seem to be reproducable on newer hardware. Any newer iphone or android seems to manage allt this just fine. Link to comment Share on other sites More sharing options...
Recommended Posts