Flash To Air: Quick Start Guide

(Alex Larioza) #1

This is a quick and dirty tutorial on converting your Flash game to Adobe Air. Android apps are also covered in the tutorial, however, I’d like to point out that FlashPunk does not perform very well on mobile devices (at least not without some tweaks).


Export game for Android and IOS...how?
Don't Even Odd - our first math game
(Alex Larioza) #2

I’d like to make a note here that another FlashPunker got FP working with Starling. The framework is a little different than FP, but not radically different where it will be like learning a whole new API.

I did a simple test and found that it runs at ~60fps with 100 sprites on screen, parallax backgrounds, and additive blending on my Droid Razer Maxx. I’m still waiting on the iPhone to arrive, so I cannot report on iOS performance just yet. I’ve also forked the repo and started on my own additions and optimizations as I’m currently working on a game for iOS devices.

(fedyfausto) #3

have you add some new features?

(Alex Larioza) #4

At this point I’ve only added a backdrop class and off-camera culling. We’re still waiting on an iPhone to see how well a sample project runs before moving forward with it, but I’m fairly certain it will run well since it runs at almost 60fps on my Android.

(fedyfausto) #5

what is off-camera? :0

(Alex Larioza) #6

Any entities not on the camera are not rendered, which helps boost the performance a bit.

(Zachary Lewis) #7

Woah… do off-camera Entity objects really render in the current build of FlashPunk? That sounds like a good thing to optimize. :cold_sweat:

(Alex Larioza) #8

@zachwlewis I haven’t synced with @Draknek’s branch in awhile, but the one I have renders entities that are off camera.

(Abel Toy) #9

It still renders the entities off camera.

(Alex Larioza) #10

I forgot to post back here about the iOS tests.

We tested Starling/Starling punk on a 4th gen iTouch and the performance was terrible. It seems only the most recent devices can run it at a decent frame rate.

We decided to use Monkey which translates “monkey-code” to a target’s native language, which gives us the speed we want since we aren’t dealing with JIT compilation of Adobe Air. I’m currently porting FlashPunk over and will definitely post a link on the forums once its all in working order! From our early tests, we had 100 Entities on screen with parallax backgrounds running at a solid 60fps. :smiley:

(Ultima2876) #11

Do you have any specifics about Starling/StarlingPunk performance on the iOS devices?

(Alex Larioza) #12

With a simple demo with parallax backgrounds and 100 entities with alpha blending, we were getting ~7 FPS on a 4th gen iTouch. However it was running fairly well on my Droid Razor Maxx, but it is a much newer (and more powerful) phone.

In retrospect, I’m not sure if it was how StarlingPunk was setup or if it was simply Adobe Air.

(Ultima2876) #13

Thanks for the data! It’s very useful. How large were the entities, in pixels, and did they all share the same sprite sheet or was it different sheets?

The iPod Touch 4th gen has an 800mhz CPU so I’d expect performance to be on the low end of the scale, but not quite that bad. I’d still expect Stage3D to manage around 30fps with 100 entities, especially if they are small (<128x128px) and have efficient sprite batching (less than 20 draw calls).

(Alex Larioza) #14

I actually was not using the same sprite sheet (or texture atlas) which was probably the biggest problem

(Ultima2876) #15

Absolutely, when working on mobile and using Stage3D the importance of ‘good batching’ cannot be overstated.

I’ve sent you an email.