Optimising Flash Animations for Mobile?

5 posts (showing 1-5)
Pseudolonewolf

Market Level 4Community Level 1
65 posts

I recently finished an RPG thing after months of effort; here's a trailer.

I made it in Flash Professional CC, and it works great on my computer, but it's extremely laggy when ported to mobile using Flash CC's AIR for Android publish setting!

The main culprit seems to be the character 'models', which are made up of various MovieClip 'limbs' animated using old-fashioned keyframe animation in Flash CC.

Up to eight of these models would be shown on screen at once, and so I made a test file to show FPS and memory usage and such when this happens. Here's a zip file. In the swf, clicking the screen causes another model to spawn.

On my computer, the FPS remains around 60ish even with eight models shown, but on my mobile device, it plummets to about 35 when just two are shown, and to less than 10 when eight are shown.

This is basically making me panic, since I don't know what I can do at this point.

I've been looking into things like Starling and OpenFL, but even if I were to basically recode the game to work with them, would I actually be able to use these existing animated 'models' at all? Or if I could, would they run just as sluggishly as they do now?

If anyone knows of any magic way I can boost performance significantly while minimising the amount of work I need to do, I'd really, really appreciate it!!

If not, do you know where else I could ask about this?

posted 2015-05-19T16:03:25-07:00 | edited 2015-05-19T16:07:13-07:00
bluebox

Market Level 6Community Level 3
334 posts

if it's png inside schould run smooth regardless.For vector shapes - in menu, background, characters - will lag as hell.

posted 2015-05-19T16:09:30-07:00 | edited 2015-05-19T16:11:18-07:00
b10b

Market Level 4Community Level 7
971 posts

Looks really good!

Yes, you will likely need to revisit how you're doing this for mobile.  Maybe take a look at "Spine", it has runtimes for Flash's conventional DisplayList and Starling so you could port your animations over first, then the rest of the gui to Starling second.

http://esotericsoftware.com/spine-runtimes

Alternatively, lots of Sprite Sheets might be viable given your art style?  There are lots of good tools to export Swf animations to sheets, I use Zoe (originally intended for HTML5, but can be used for more).

http://createjs.com/Zoe

Imo, an OpenFL rewrite would be quite an undertaking by comparison to the above options.

posted 2015-05-19T16:18:33-07:00
bstone

Market Level 0Community Level 0
18 posts

Maybe consider exporting animations of those limbs separately to PNGs and overlaying them back together in the game. Judging by the trailer (which is awesome btw) exporting the entire animated character into a single PNG sheet might require quite a lot of frames. Separate animations for limbs put back together with proper timing for their animation cycles will look pretty close to what you have now and won't bloat the game size.

posted 2015-05-19T17:46:14-07:00
Pseudolonewolf

Market Level 4Community Level 1
65 posts

Thanks for the links!

That Spine thing sounds perfect! It's the kind of thing I've been looking for for years, actually! I suppose it'd mean I'd have to completely redo all my animations... but that might not even be a bad thing, as I'd be able to improve them with a bone-based system using IK and so on. Wow. I really think that's the solution to my problem, and many I've had no solution for in the past! Thank you!

posted 2015-05-19T17:52:34-07:00