How to reduce suttering in Air for iOS GPU mode?

My game currently runs at 60FPS on iPad 2 and has no problem regarding rendering speed but I'm rather annoyed by constant stuttering which causes the game to stop for 0.1-0.5 sec  once in a while. The stuttering behavior is similar to when garbage collector is ran and I supposed it is casued by GPU memory swapping as my game uses lots of bitmapdata.
Problem is that my game transits one scene to another scene seamlessly without stopping animations in the game screen by letting old game scene sliding out of the screen and new scene sliding in. So there's no time to preload/precache graphics assets used in the new scene. After transitting different scenes a few times, the game starts stuttering when trying to show new images.
My game works fine without stuttering on old PCs but on iPad2 it is quite obvious. Could anyone tell me some tips to reduce stuttering when using Air for iOS? In the game, all vector graphics are pre-drawn to bitmapdata(so no vector graphics are shown) and the size of graphic assets each scene has is about 2048*1024 pixels. There are about 10 scenes. On top of that, there are common interface graphic assets which are used in all scenes and the size is about 30x 400*400 pixels.
I know the game uses quite a lot of graphic resources. Making the game preload the assets before transitting to a new scene will eliminate stutter but I'd still like to see if I can keep the seamless scene transition on iOS.
I'm currently using Air3.5 + Flash CS6.
* I mean preloading/precaching by actually displaying( addChild and visible=true)  them on stage and make time for GPU to cache. All the actual graphic data are already loaded.

Some things that might help:
I've heard that textures are uploaded as square textures on iOS. I'm not certain that really happens, but if it does then having two 1024x1024 textures would be better than one 2048x1024, because that would end up actually taking 2048x2048.
Bitmaps are sent to the GPU when they first hit the stage, and it takes a significant amount of time for them to get there. If you are timeline animating a transition to the next scene, stagger the graphics that are going to be appearing next. That is, before you start to move on to the next area have the biggest bitmap of the next are already touching the edge of the stage. It can be invisible, or underneath another graphic, it will still get uploaded. But if you tween in all of the graphics exactly when they are needed, they will take a while to upload.
Dispose of the bitmaps that are no longer in the scene. I think your stuttering is because you're going into a new area that has a lot of new graphics, and the GPU still has the bitmaps from the current scene and the one before that, and so has to spend time freeing up the memory before taking the new bitmaps. If you had already disposed of them the GPU might not need to clear memory for you.
There is System.gc(). That will force the system to garbage collect, which you could do at moments that there isn't anything animating.

Similar Messages

  • Adobe AIR for Android - GPU Mode - Bitmap Auto-Smoothing Issue

    Hi everyone
    I'm having a bit of an issue with the AS3 bitmap object. I'm currently developing an 8-bit style pixel game for AIR for Android.
    This game is being developed at a very low resolution and is being scaled up to maintain the charm of an old retro game.
    One of the methods I'm using is drawing pixels directly to bitmap objects and scaling the object up to create the old look.
    When testing on a mobile device, this works beautifully when you set the rendering method to Direct but when you change
    the render method to GPU the visuals go all blurry and anti-aliased (it's as if the bitmap is being smoothed out). The mini map
    for example is rendered using the setPixel method and then scaled up 9 times. Looks great on my PC but once I export it to my phone
    it looks absolutely awful! This is no good as I want to keep the clean, solid pixel look to maintain the the old 8-bit feel and obviously
    I'd like to stick to GPU mode due to it's speed.
    Like I said, this only happens once you test on a mobile device in GPU mode - it doesn't do it on my main desktop machine or
    in Direct mode. I already have the stage quality set to low and I've tried setting the bitmap's smoothing property to false but
    it does nothing.
    Does anyone have any suggestions as to how I can get around this?

    How about first blit your image to a small bitmapData, then draw it on a large bitmapData (9X larger)?
    Like,
    var small_bmd:BitmapData = new BitmapData(SMALL_WIDTH, SMALL_HEIGHT, false);
    var large_bmd:BitmapData = new BitmapData(SMALL_WIDTH * 9, SMALL_HEIGHT * 9, false);
    var bm:Bitmap = new Bitmap(large_bmd, PixelSnapping.NEVER, false);
    var blitRect:Rectangle = new Rectangle(0, 0, 9, 9);
    var i:uint, j:uint, blitColor:uint;
    small_bmd.draw(SOURCE_IMAGE);
    large_bmd.lock();
    for(j = 0; j < SMALL_HEIGHT; j++){
         for(i = 0; i < SMALL_WIDTH; i++){
              blitColor = small_bmd.getPixel(i, j);
              blitRect.x = i * 9;
              blitRect.y = j * 9;
              large_bmd.fillRect(blitRect, blitColor);
    large_bmd.unlock();
    Not sure if the code works or not, but hopefully this helps.

  • Garbled/scrambled text with Air for Android & GPU mode

    Please excuse the big image! Has anyone come across this? As you can  see the 'U' in 'Nebula' is scrambled and so are the digits below best  time.  It only happens within  the space a character would occupy. The line under 'game' is just a reflection.
    I can't work out what's causing it, it's not always the same  characters that do it although the U in Nebula is always scrambled.  Sometimes digits are scrambled and sometimes the same ones are not. It  seems to occur with embedded fonts and with normal ones like Arial. I've  tried using both Classic and TLF text, and changing anti-aliasing  settings. It occurs on both dynamic and static text.
    But it only happens  with GPU rendering, not CPU rendering.
    I can't find any mention of this at all on Google, starting to wonder if perhaps it's just my phone? (Desire S).
    Any input is greatly appreciated!

    Thanks for the fast reply! Switching to device fonts does fix the problem, but it means using some horrible default font rather than the one I want to, which I've embedded. I've tried a few more settings and Bitmap Text seems to fix it in some instances but not in others.

  • How many of the apps on the app store are based on AIR for iOS? raw numbers? as a percentage?

    wondering how apps based on the AIR for iOS platform are doing out there in the "real world"
    thanks

    ur restrictions might have been turned on. how? no clue. but that is normally the only reason default apps are not showing on the homescreen.
    u can reset ur home screen layout and see if that helps, turn off restrictions first of course.
    my suggestion... however, is to just reset all settings to get everything at once so to speak. there might have been other settings that were changed on ur ipad that u havnt noticed yet. the reset all settings would get those back to factory default as well.
    to get to those settings
    restrictions: settings>general>restrictions
    reset home screen layout: settings>general>reset>reset homescreen layout
    reset all settings: settings>general>reset>reset all settings

  • How to record a time-limited video with Adobe AIR for iOS

    I am trying to record a time-limited video with Adobe AIR for iOS.
    For example, I want to implement the following function. Start a one-minute timer before launching CameraUI to record video. When the timeout event happens after one minute, stop recording video, close the CameraUI view and obtain the video data so far.
      I have several questions related to that.
      1. How to stop recording video from outside the CameraUI view(in this case, from the timeout event handler) and then close the CemeraUI view? As far as I know, to close the CameraUI view, the only way is to press the [Use Video] button or the [Cancel] button from inside the CameraUI view. Is it possible to close it from outside?
      2. Even if the first problem mentioned above is solved, then how can I get the video data so far(in this case, the video data before the timeout). I know that normally we can get a MediaPromise object from MediaEvent parameter of the  complete handler, and read the video data from the MediaPromise object. But obviously in this case, we can not access the MediaPromise object just because the complete handler itself will not be executed since the [Use Video] button is not pressed.
      3. Is it possible to add a stopwatch to show possible remaining recording time when CameraUI view is open? It seems that the CameraUI automatically uses the full screen of iOS device(in my case, iPad) and there is no extra space to show the stopwatch.
      Are there any solutions or workarounds about the three problem above? I really appreciate it if anyone has any idea about this. Thanks in advance.

    You'd have more control by using the Camera object, showing the camera on a video object inside a Sprite, and capturing that. Then you could put whatever graphics alongside it on the stage.. I've used FlashyWrappers in a test to capture the video to the library.  It took some work, but the test worked well...
    Flash/AIR record videos of your apps and games: Rainbow Creatures

  • How to make an air for ios enterprise distribution Flash CS5.5?

    Hi, There seems to be only:
    Quick publishing for device testing
    Quick publishing for device debugging
    Deployment - Ad hoc
    Deploymnet - Apple App Store
    How does one do Deployment for in-house Enterprise Apps from Flash CS5.5 with AIR for iOS?
    Thanks!

    maweibezahn,
    The plist in step 2 is created so you can download the app onto the device.  This file stands alone, and does NOT need to be included in the app package, but it does need to reside in the same spot on the web server.  Below is an example plist file for an app.  You then access the following link from mobile safari to install:
    <a href="itms-services://?action=download-manifest&url=http://www.myserver.com/myAppPlist.plist">Tap Here to Install myApp On Your iPhone</a>
    ----------myAppPlist.plist------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>items</key>
              <array>
                                  <dict>
                                            <key>assets</key>
                                            <array>
                                                      <dict>
                                                                <key>kind</key>
                                                                <string>software-package</string>
                                                                <key>url</key>
                                                                <string>http://www.myserver.com/myApp.ipa</string>
                                                      </dict>
                                            </array>
                                            <key>metadata</key>
                                                      <dict>
                                                                <key>bundle-identifier</key>
                                                                <string>com.myServer.myApp</string>
                                                                <key>bundle-version</key>
                                                                <string>1.0.0</string>
                                                                <key>kind</key>
                                                                <string>software</string>
                                                                <key>title</key>
                                                                <string>My App Name</string>
                                                      </dict>
                                  </dict>
              </array>
    </dict>
    </plist>

  • How to embed and launch ipa file from another ipa package created using Air for iOS

    Hi Guys,
    Anybody out there knowing how to embed and launch ipa file from another ipa package created using Air for iOS ?
    I am having 1 ipa file created using Xcode, Now i need to include that file in my ipa Package which is created using Flash CS 5.5 and Air for iOS. Also i need to know how to open my 1st ipa file from AS3 ?
    Thanks,

    Hi Sir,
    Thanks for your reply.
    But in that case user need to download 2 applications right. I need user to download my parent application created using Flash and that package contain one more ipa created using Xcode, so from my parent app only user should able to open my 2nd app. Is there any way to do that?
    Ps:  I am not talking about in-app but 2 individual apps inside one package.

  • AIR for iOS: How can I distribute for only Retina Displays?

    I am nearing completion of an app I have designed for iOS and tested on my iPhone 4. I bought a 2nd gen iPhone so I could test on both screen resolutions (320x480 and 640x960) before discovering AIR for iOS does not support very old iOS devices (I believe the rule is it must be iOS 4+).
    My question is how is distribution handled if the app will not run on these older models? Wouldn't people with a 2nd gen iPhone still have access to an app that I publish via AIR for iOS and then be angry when it is not supported on their device? Has anyone run into this issue?

    AIR 2.5+ requires iPhone 3GS+ to run. It's based on the CPU inside that
    device and newer which includes a NEON SIMD coprocessor - a requirement
    of newer AIR builds on all platforms (newer than PFI/AIR 2.0, which
    shipped with Flash Pro CS5.0).
    There should be a "resolution" drop down in the AIR for iOS Settings
    dialog, if you updated your PFI in CS5.0 or upgraded to CS5.5. You can
    select "High" to get iPhone retina display support. This will not enable
    iPad 3 retina support though.
    Kevin N.
    Edit: I didn't make it clear that the device requirements are set in your app, and enforced by the App Store - users on old devices will never see your AIR apps in their app store, and if they link into the App Store, they'll get an explaination of why they can't install the app (it'll be either the OpenGL ES 2.0 requirement, or the CPU requirement - it's similar to if you try to install an iPad only app on an iPhone). Android actually works the same way - old/cheap ARMv6 device users will not see your ARMv7 requiring app in their Google Play/Marketplace app.

  • How to enable sampler in telemetry options at AIR for iOS Settings?

    Hi,
    I'm just trying the new Flash CC, and a very good feature is to monitor an iOS app using adobe scout.
    But when I export an app, in the AIR for iOS Settings, I always see "Enable sampler" option disabled. How can I enable the option?
    Thanks.

    Hi ,
    To enable the sampler option you need to set it in the Publish Settings dialog. Open the Publish Settings Dialog and select the "Enable detailed telemetry" option under the advanced section for the Flash(.swf) option.Now you will find the Telemetry option for enable sampler enabled in the AIR for iOS dialog.
    Thanks and Regards,
    Sudeshna Sarkar
    Adobe Flash Professional Team

  • How to make external SWFs garbage collected in Air for iOS?

    My app uses lots of external SWFs( well they are actually included in the app with a folder but they aren't embeded ) and they do not contain any bitmapdata, only vector graphics. The problem I'm having is that they seem to be never garbage collected and System.privateMemory keeps increasing as the app loads more SWFs.
    Since those SWFs only contain vector graphics, I simply nullify all the variables that are holding reference to SWF file and call System.gc().. But it doesn't seem to be working. What would I need to do for the garbage collector to clean the SWFs?
    I'm using Air for iOS 3.5.0.1060 and ActionScript3.0.

    Yes I'm calling System.gc() twice. I tried using loader.unloadAndStop(true) and it seems SWFs are being garbage collected but another problem has surfaced. When repeatedly loading and unloading SWF in a short period, the air garbage collector sometimes fails to work.
    I've tested loading and unloading same SWF 50k times and checked trace.  Occasionally, garbage collector misses to collect garbage like below( swf #45119 is not being garbage collected).
    [UnloadSWF] main.swf/[[DYNAMIC]]/45115
    [UnloadSWF] main.swf/[[DYNAMIC]]/45116
    [UnloadSWF] main.swf/[[DYNAMIC]]/45117
    [UnloadSWF] main.swf/[[DYNAMIC]]/45118
    [UnloadSWF] main.swf/[[DYNAMIC]]/45120
    [UnloadSWF] main.swf/[[DYNAMIC]]/45121

  • Uploading AIR for IOS thru Application Loader I get the following error - The package does not contain an Info.plist.

    I'm publishing an .fla in AIR for IOS.
    I'm in CC 2014 so first I need to know which AIR should I publish in?
    newest is AIR 14.0.0.178 for IOS
    IOS deployment type is App Store
    publishes with no error.
    I see the following files included .swf and app.xml
    I convert the .ipa to a zip file
    Upload that thru the Application Loader I get the following error
    The package does not contain an Info.plist.
    Where is the infoplist for this and do I convert the .ipa and the info to a zip file?
    I converted the .ipa to a .zip and the intoplist file is NOT THERE  how do I generate this?
    Any help here?

    Ok this is becoming very very frustrating as I have been at this for hours now. So the only way to explain this is to write what I did step by step as I have to be doing something wrong, just to recap:
    I was publishing from Flash CC 2014 using AIR 14.0 and getting Digital Certificate is not valid message.
    Was instructed to download new AIR 17 , I did this installed into Flash and used to publish.
    I used my previous p12, app ID and distribution certificates all generated properly.
    The file worked ONCE but I got an app ID error ( I understood I used the wrong app ID)
    I changed it to the right app ID and the very next time and after 10 attempts I got the same error  Digital Certificate is not valid
    SO I then downloaded AIR 16.0
    RE DID ALL MY CERTIFICATES AND P12'S
    went to publish and I STILL GET THE SAME MESSAGE   Digital Certificate is not valid

  • Unicode characters appear as      (boxes) in AIR for IOS

    I am developing an application for iPhone and it has an input Text box. (Placed on stage from flash CS6). In the Desktop emulator everything works fine. But, on the actual phone, everything I type appears as       . But surprisingly, when I am inputting the text, (i.e. the textbox is in edit mode) the characters are displayed correctly. But as soon as I leave the box it appears as       . Is there someway I can display the text the same way it is displayed during the edit mode?
    I am trying to input Devanagari देवनागरी characters.
    P.S. I did some research on this and found that, if I specify the  font for the textbox = "DevanagariSangamMN" then there is some improvement.
    I say improvement becasue althought the boxes       are replaced by actual characters , they aren't correctly formated.
    For e.g. during edit mode the text appears as this: कार्यकर्ता
    But as soon as I leave the textbox it appears as this: कार्यकर्ता (I typed this here by adding special unicode characters ZWNJ so that characters won't join)
    Anyway, I don't like the idea of having to specify font names? What If some user would like to input chinese, how would I know what chinese font to use?
    Isn't there some way to let IOS handle things, (just like how it handles things when I am inputing text).
    Thanks.

    Thanks to everyone who replied.
    The conclusiver answer is that there are only 2 ways to display H264 video in AIR for IOS
    (more info here http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.htm l#play%28%29)
    1. Progressive download
    2. HLS format (slight caveat, in my tests at least, OSMF 1.6.1 does'nt handle this, but if you use the NetStream directly with StageVideo enabled it works)
    Updated Matrix is :
    FMS 4.5 H.264 Streaming test matrix
    RTMP
    HDS
    HLS
    HTTP Progressive Download
    AIR for Android
    Yes
    Yes
    No
    Yes
    AIR on Windows (Desktop)
    Yes
    Yes
    No
    Yes
    AIR on IOS
    No
    No
    Yes
    Yes
    Safari Browser on IOS
    No
    No
    Yes
    No

  • WEB PAGE'S LOADING INTO AN AIR FOR iOS PROJECT

    Hi!
    I have a complicated problem. I try to find a solution everywhere but I didn’t find anything.
    I’m creating a project Air for iOS with Flash CS5 and Flash CS6. I need to find somebody that know how to upload a web page inside an app.
    I try to explain better. There is yet a task for upload an html link, but it just work in a new browser window. In this way, every time I want to see a web page, the app will be close. Is it possible to import all the web page inside the Air for ios project, and not in an external window?
    I'd like the result is like this:
    Thanks a lot.

    hi....
    i used StageWebView class and i wrote this code:
    var webView:StageWebView = new StageWebView();
    webView.viewPort = new Rectangle( 0, 0, this.stage.stageWidth, this .stage.stageHeight);
    webView.stage = this.stage;
    webView.loadURL( "http://www.adobe.com" );
    The web page opens correctly without using the browser but it opens into all project's frames.
    Is it possible to open the web page only in the frame one (for example) ????
    Thanks a lot!!!!!!!!!!!!!!!!!

  • Air for iOS, why isn't the setting for device being remembered?

    in flash CC with air3.7 and air3.8, everytime i open the general tab in the air for ios settings, the device is marked as iphone and ipad. i change it to iphone only, close the settings, save the file. when i open the settings again, i have to click on the general tab and the device is set back to iphone and ipad.
    i consider this a bug. this has never happened in any other version of air. i had to reject an apple binary when i noticed it was set to be a universal app, which it isn't, and had i not caught the error, i would've been waiting only to be rejected by apple...
    how can this be fixed? thanks

    iOS 7 apparently requires at least 512MB of RAM. The fourth generation iPod touch only has 256MB, and therefore won't get it.
    (89510)

  • Edit application settings AIR for iOS not working

    Hi all,
    I'm trying to create a .ipa so I can test my app on my iPhone but my Flash cs6 will no longer let me edit application settings so I can publish the file.
    The first time I did it, it was working fine. I added my certificate and my Provisioning Profile and published a .ipa file.
    Now, when I click the wrench tool icon or go through the file menu and select AIR for iOS settings, nothing happens. All it does is generate an .xml file for me ("filename"-app.xml).
    What is wrong and how can I fix this?
    I've tried rebooting.
    I have the same problem on Flash cs6 and Flash cs5.5 on two different computers.
    I have an iOS development Certificate.
    I have an iOS development Provisioning Profile.
    Thanks in advance for your help!
    Cheers,
    André

    Here's the link to the bug report in Adobe bugbase:
    Bug#3850040 - Flash CS6 crash
    Everyone PLEASE up Vote this bug ASAP!   (right side panel - under Attachments section)
    It's been 2 weeks since the bug was reported and it's status is still "unverified"...

Maybe you are looking for