Optimizing your game for mobile targets
I've been struggling with trying to get hxScout (a profiling tool) to work, but I'm giving up on that now and thought I might ask for some advice from you guys instead: what are some things I can do to make my game run better on my phone? I'm using an iPhone 6s and I'm getting 20fps in my menu state... yes, the menu! hehe... so, tell me some things I could try to get it to run smoother, please.
Oops, just realized I posted this under the wrong category. Ah, well...
Hey! You can check the optimizations that I did for the HTML 5 version, which is is a bit tricker since performance could get worse than mobile. If runs nice in HTML5 will run awesome in mobile, so you should consider following the tips I posted here! http://forum.haxeflixel.com/topic/20/super-cute-alien-a-cute-platformer-inspired-on-battleblock-theater-super-meat-boy-and-others/14
Sweet! Looks like a bunch of stuff I could try myself, thank you!
Are you using openfl's fps counter class?
Is there a way to see the current fps count in the browser debug window somehow?
Are you using nape at all in your web game? I have a few states that uses nape in my game but I'm not sure what targets nape can run in... (maybe it can run in them all?)
Did you run into any problems when you first tried to compile your game for the html5 target? I haven't worked much with it myself but if there are any common pitfalls that you could share, please let me know!
Blockquote Are you using openfl's fps counter class?
Yes, if not mistaken is add(new Fps());
Blockquote Is there a way to see the current fps count in the browser debug window somehow?
You can compile in debug mode and use the built in console. http://haxeflixel.com/documentation/debugger/
Blockquote Are you using nape at all in your web game? I have a few states that uses nape in my game but I'm not sure what targets nape can run in... (maybe it can run in them all?)
Nope, no nape at all, but if not mistaken, nape runs great on mobiles :)
Blockquote Did you run into any problems when you first tried to compile your game for the html5 target? I haven't worked much with it myself but if there are any common pitfalls that you could share, please let me know!
Well... yes. At first, the high amount of assets causes the browser to just crash. Once I handpicked the necessary assets, it did run, but the performance was awful. And I had no sound. Mobile targets use .ogg. The other problem that I had, is the save/load for HTML5. Everytime I changed the save file, I had to call
game_save.flush();-- should be a no brainer, but I didn't need this on other platforms (flash/cpp).
For more tips I also found useful this link http://haxeflixel.com/documentation/mobile-targets/
I should upload the html5 somewhere, since is a target that won't be supported anymore and further development moved to cpp. I can upload it, of course, if there's enough interest.
Just wanted to leave this update. It's a bit weird but, after trying out a bunch of stuff including running the openfl setup command and updating xcode, something happened and now the game runs at 60 fps and with sharper graphics than before... I kid you not. The text I used throughout the game (not bmp fonts) used to be a bit pixelated, but now looks perfect. I... don't know what happened, but I'll take it.