I noticed that alot of people have been having trouble getting there games to run on mobile devices, so I decided to convert one of my games to see how well I could get it to run. The original version of this game was 25mb in size with 158mb of memory usage. I was able to optomized this and bring the file size to 4.4mb and the memory usage to 29.2mb, however even with such a huge change the game still has issues running on android devices despite the memory usage of 29.2mb.
The Phone I used to test the game was the samsung galaxy nexus, hardware specs can found online. I imagined a phone such as this could run a game like mine unless I made some major errors in coding the game.
If you have cocoonjs on your mobile phone then try this link:
I won't make a pc to phone comparison because I'm well aware how great the difference is between the performance of Pc to higher-end mobile phones is, but I'm assuming 29.2mb of memory should run fairly well. Once again, that's not the case for my app. Maybe it has to be lower?
Here's the list of things I believe is important to make apps run to there maximum performance (this is mainly directed at my app:
->Backgrounds and sprite objects have been converted to PNG8, then resized (went from 1024 to 256)
->I don't recall any third party plugins except the clay.io plugin
->No physics object is used
->I deleted music/sounds from the project
->I used dt in the parts that I thought were most important
->Lots of groups have been used to ease up some of the programming
->blank space sprites have been resized
->Because this example is an endless runner I decided to use a different method then Scirra's example. Instead of destroying the platforms and respawning them, I have two platforms that simply leave the leftviewport and respawn at a different location changing in width, and X position everytime it changes to the right of the screen. I heard this saves on performance, but then again I'm not to sure.
->No sprite object/background is greater then 2048, however two objects on the canvas have a size greater then 2048 (however in editor its 1024x512)
->No webgl effects are being used
Additional information that I found and think might be helpful:
-->I believe I read in a post somewhere that 50mb of memory usage should be fine and fairly universal, anything below that should run fairly well (I think).
-->Ram with the Mobile Os is usually shared, so you only get access to like something like 10% (it might have been 20%)
--> Apple recommands to not go more than 20 mb or 20%
-->Make sure you've apply dt in every equation where speed matters.
-->Avoid using large sprites (images in the construct 2 editor that are greater then 2048)
-->Pixel rounding should be on
-->Use families to categorizes the sprite objects to simplify the programming
-->And sprite objects with the same functions should be placed as one sprite object with more instances. For example, instead of using two sprite objects, use one that has both animations and create two instances of that same sprite object rather then using two sprite objects.
If people are confused on what I wrote, then ask for clarification. I'll see if I can explain it better. I still don't have enough knowledge to fully understand the functions of C2 so I can't fully explain some things in great detail.
But anyways I'm not really sure of the problem, and I'm not to fond in sharing the capx file unless Ashley or Tom would like to see it, however its still fairly messy even with groups. I'll probably recheck over it a bit later today to see If I can find any more problems or find ways to optimize the game further.
If anyone wants to input anything else then post it here, or if anyone wants to verify anything above claiming its not true or inaccurate then post it here as well. I'll update the post.
Edit**If this is in the wrong section, then I would appreciate it if a mod could move this