Skip to main content
Participant
September 14, 2011
Question

Off stage content killing frame rates

  • September 14, 2011
  • 3 replies
  • 707 views

Hey,

I'm working on an iPhone game using AS3 and I've got it working pretty well on the iPhone 3G.  I intend to compile it with AIR 2.7 (or 3.0 when it drops), but for testing purposes, I do everything on my 3G.  Here's the problem, I get a solid consistant 24fps until one of my objects moves offscreen - even partially.  If my "character" even goes a few pixels past the edge, frame rates drop tp 9-10 fps.  I've had a few people already suggest not allowing anything to move offscreen, but that's not feasible.  I've gone through my code to make sure there isn't a programmatic reason this happens, and I've created a seperate project specifically to test this - with no game logic, simply moving an image across the screen, frame rates bottom out once content goes over the screen edge.  I've tried using masks, I've tried using scrollRect, I'm using cacheAsBitmap, and there is no scaling, only x,y translation.  Any help or suggestions (except for telling me to switch to Obj-C, there has to be a better answer than that) would be greatly appreciated.

This topic has been closed for replies.

3 replies

Participant
September 19, 2011

Thanks for the responses guys - boat, i have the GPU/CPU set at auto currently, recompiling with GPU to see if that changes anything.  Im using containers with bitmaps, and yes I am using the 3G specifically.  I have tested on the 3GS and the 4, they have a slight framerate hit along the edge (barely noticable), but other wise run smooth as butter.  Aster, I may give that a try down the line, not sure I'm willing to give up graphic quality yet thought.  Joe, I will shortly.  Thanks again everyone, and any more suggestions will be welcomed

Inspiring
September 16, 2011

hummm...  I know this shouldn't make a difference, but it might be worth trying:  create a bitmap that is the same size as the stage, and manually render your sprites to it via BitmapData.draw().  Actually, this should make things a bit slower, logically: but hey, Flash has its own logic sometimes..

Tip to improve the fps: you can always render some or all your assets to a bitmapData that is half the size of the screen, but whose Bitmap container is inversely scaled by a factor of 2 (stage.quality shoud be set to StageQuality.MEDIUM to take advange of bilinear sampling in CPU mode -- In GPU mode, you'll get trilinear for free, I think).  Also, make sure your Bitmaps have smoothing set to true.  This will radicaly improve the fps, but make your assets a bit blurry.

Participating Frequently
September 16, 2011

James, can you file a bug at http://bugbase.adobe.com with your sample?

Thanks!

Inspiring
September 14, 2011

cpu or gpu? is your character a bitmap or movieclip with vectors, or container w/ bitmaps? do you mean phone 3gs not 3g? ...EDIT- you did specify 3g, are you using the 'old' packager for iphone?... sorry my phone wont lete press enter to space out my questions