Wink I'm super curious about your FPS gaining technique for cocoonjs. Would you mind sharing or elaborating? Thanks!
Well actually I use a combination of many different techniques but for the technique I used in my last post on this thread I kind of found it by accident. What I was doing was creating groups for my sprites, and after that I thought it would be better to organize each group of sprites on there own layer to create a faster work flow for adding, and editing things. So I made a bunch of new layers and moved the sprites to there corresponding layers, tested my game, and I couldn't believe the gain in FPS. But now that I think about it Ashly might have enabled the screencanvas rendering mode in the CocoonJS object when I made these changes so that might have helped the giant gain in FPS a little bit. But still not that much.
Just so everyone knows though I got the 60 to 62 FPS on a Nexus 7, and a Samsung Galaxy S3. These are high performance machines. When I tested it on my 2 year old original Samsung Galaxy S running 2.3.4 My FPS increase only went from 12 to 14 FPS (practically unplayable) to 20 to 22 FPS (just playable). So FPS really depend on the type of devise yet.
If the CocoonJS cloud compiler ever lets us set our minimum supported OS I am only going to support 4.0 and up. I know this is giving up on a big share of the market right now but by this time next year even new low end devises will have the same performance as the Gallexy S3 does now. That and I wont have to do such heavy optimization on my games anymore.
Ashley wrote some good advice here:
The Great HTML5 Mobile Gaming Performance Comparison
And here are the official Performance tips:
Basically the biggest FPS killers Iv found are:
1. Sprite font or anything that rewrites itself over and over.
2. Using the System Every tick event. Instead use the System EveryX seconds, and enter 1. This will give you a dramatic increase in FPS, and it works just as well.
3.Setting angles, and rotation. If your game requires these set rotation in the animation editor instead of using actions and events, and set angles in the Object Type properties window instead of using events, and actions when ever possible. For some reason I got a 5 FPS increase by doing it this way.
4. Large, and or to many sprites will kill your FPS
5. The physics behavior is a performance killer period. Try faking physics instead with the bullet behavior, or the platform behavior.
6. Semi transparent sprites, and use of a fader will also lower your FPS.
Making mobile games is almost more of an art form than an exact science. Every game is different, and you can't have it all quiet yet but it's getting there. It's just a lot of trial and error, and a whole lot of testing but that is what being a developer is all about.