Skip to main content
Participant
March 23, 2011
Question

Moving from PFI to Air 2.6 for iOS development

  • March 23, 2011
  • 9 replies
  • 2626 views

Hi,

I have spent the past several weeks using the Packager for iPhone to develop a game on the iPad, I had put a lot of work into optimising the game to work on the GPU correctly and got it working at a very good frame rate.

I should say at this point that my game use only bitmaps (no vectors anywhere), and uses no filters, and just the additive blending mode sometimes.

I understand that air 2.6 uses the GPU differently than packager for iphone, I believe it uses GPU Vector mode instead of GPU blend so that all the rasterization is now done on the GPU instead of the CPU. So I compiled my game using adt, but it ran very slowly... I then spent a lot of time trying to get it to run at a better frame rate, but could not get it up to the same speed as I saw in packager for iphone...

1) I am still a bit confused as to when to use bitmap caching in air 2.6 - if I have a game which only uses bitmaps and they are never rotated - just moved about in x/y space - do I even need to enabled any kind of cacheAsBitmap or cacheAsBitmapMatrix?

2) What about if I want to change the alpha of a bitmap to fade them in/out? In PFI I dont think I needed to enable cacheAsBitmapMatrix for that - is that still the case?

3) I know that when using PFI if you apply cacheAsBitmapMatrix to too many things it can make the app freeze or slow it right down (especially if other apps are using memory) - is this still the case as it seemed like a bit of a bug...

4) When using PFI, whenever you loaded an image into GPU memory (by caching it and adding it to the display list), it would make the app stall for a period of time (I guess because it has to rasterize it on the CPU and upload it to GPU), do it still do this as the GPU vector mode rasterizes in GPU now?

5) Do I need to do anything special to make Flash CS5 work with AIR 2.6? at the moment I am just taking the SWF file I had and running it through adt. Just seems like I am getting worse performance, I didn't know if there was something special I had to do.

Any help would be very much appreciated, I have heard so many good things about Air 2.6 and I would love to get to grips with it ASAP.

Thanks,

Greg

This topic is closed to new replies. Start a new post to keep the conversation going.

9 replies

Participant
March 25, 2011

Hi,

I'm kind of replying to my own post here. I have been doing some further development with iOS on AIR 2.6 and I think that unfortunately the new GPU rendering IS actually just a lot slower than it was on the Packager for iPhone.

I know that a lot of people say that Air 2.6 has made their app run 2x faster and a lot of people say the opposite - that moving to 2.6 has made it run 2x slower- I think the difference there is probably that if you had your code properly optimized for GPU under PFI (which took a lot of work) then you will notice a big slowdown.

For example, under PFI, on the iPad at 1024x768 I could have at least 50 large moving sprites on the screen at once running at full 60fps - I dont think that Air 2.6 could even manage that at 30fps (I have taken to lowering my fps to 30 in Air 2.6).

Saying that Air 2.6 does make it a lot easier to port, especially if you are just using bitmaps as dont really have to do anything (unless they scale/rotate), it's more likely to "just work". Also, PFI had a lot of little bugs in it, like certain blending modes only working half the time, and sometimes the framerate would just bomb if you used too much memory.

So I guess bottom line is that Air 2.6 feels a lot more stable and is easier to use, however if you are just purely using the GPU it will be less than half the speed of the old PFI, which is a massive shame.

However I could be missing something here?

Inspiring
March 28, 2011

hey there greg,

just keeping this discussion going. i am curious how you got such good performance under PFI? i dont have a lot of stuff happening in my app, but noticed that with the ability to toggle screen qaulity to low, i can get 60fps without big elements moving. i dont cache anything using cacheAsBitmapMatrix, but have to cacheAsBitmap (even on bitmaps) to get the performance i want.

what i'm struggling with is not necessarily getting the performance i want (although i would love to get 60fps) bit keeping it consistent. it seems background running apps on iOS really affect performance in a huge way.

Participant
March 30, 2011

Hi,

You can quite easily get 60fps with PFI with the correct caching. But yes, I think there is a bug in PFI where if you have games running in the bakground it will very much vary the performance of your app, it can even make it stop working altogether. This was a massive problem with PFI for me, I think it might be related to how much video memory you are trying it use, it seems that if you go over a limit it will stop working correctly and be very unpredictable.

Air 2.6 doesnt seem to have that problem, you can run other stuff in the background and it doesnt really affect it, which is great.

I actually retract everything I said in the posts above about Air2.6 being slow, once you understand it you can get similar performance in a lot of cases. I now have a lot of my game running at 60fps using Air2.6.

It also requires a lot less work to port code over as you dont really have to optimize it nearly as much as PFI. Also, Air 2.6 supports a lot more features in hardware - masks, color tints, blend modes can all work at full speed in hardware now. The only thing which doesnt work are filter effects, which is a bummer.

So I've gone from being very disappointed with Air2.6 to really loving it

Inspiring
March 24, 2011

hi greg, istarted a thread in another forum about how to get 2.6 working with Flash CS5, it might be helpful: http://forums.adobe.com/thread/826939?tstart=0