-
1. Re: iPad choppyness?
kglad Oct 9, 2010 12:03 AM (in response to MartyGoldberg)start at page 31 for the optimization tips: http://www.mikechambers.com/blog/files/presentations/fitc_amsterdam_2010/flash_iphone_fitc _2010.pdf
-
2. Re: iPad choppyness?
MartyGoldberg Oct 10, 2010 12:54 AM (in response to kglad)Thanks. Took a lot of work and optimization based on the link you gave and this one:
http://help.adobe.com/en_US/as3/mobile/flashplatform_optimizing_content.pdf
But I'm finally having some success.
Here's the steps I took for anyone else that's having the issues but doesn't want to do a ton of reading and experimentation:
1) I cut down my frame rate to around 30. According to the mobile development pdf, if you have too high a frame rate set it won't skip the frames and will still process all code each frame. But it will skip the actual rendering in those frames to keep up with that frame rate. That's where some of my jerky rendering was occuring.
2) Massively cut down on any unnecessary checks and setting changes in the main loop and elsewhere.
3) Removed all filters.
4) added what's apparently part of the new GPU api:
- make sure and import flash.geom.Matrix
- add the following statements to the init:
cacheAsBitmap = true;
cacheAsBitmapMatrix = new Matrix();I also set the device to just iPad instead of iPhone and iPad.
Marty
-
3. Re: iPad choppyness?
kglad Oct 10, 2010 7:54 AM (in response to MartyGoldberg)you're welcome.
but that's still a high frame rate for a weak device like the ipad. 24 (the same as film) usually is fast enough. also, the frame rate can be changed dynamically do during times when no animation is being displayed, you can decrease the frame rate dramatically without detriment. that's less important in limited devices like the ipad that can only do one thing at a time but is user-considerate in, for example, browser-based displays.
-
4. Re: iPad choppyness?
Dei_Machiavelli Oct 16, 2010 6:44 PM (in response to kglad)I must apologize for sounding simplistic here but if what I am getting here is right.
This means by putting these codes:
import flash.geom.Matrix //Inside Import Section.
//Inside Constructor:
///////////////////////////////////////////////////////////////
cacheAsBitmap = true;
cacheAsBitmapMatrix = new Matrix();///////////////////////////////////////////////////////////////
And setting Rendering to GPU in the Publish Drop Down list will "Magically" make everything better ?
From now on I will add this to ALL my Movieclip Classes.
But I have a feeling from reading the pdf guide that it might not benefit Movieclips that changes graphics [one frame to the next], am I right ?
-
5. Re: iPad choppyness?
Pea Oct 17, 2010 4:06 PM (in response to MartyGoldberg)I have been having exactly the same problems (see my blog entry) and assumed there was some sort of frameskip built in, so thanks for clearing that up.
This is highly annoying as it means the content behaves differently on the iPhone than it does while editing. I would much rather have the behaviour whereby if there is too much code to run every frame the frame rate slows overall instead of skipping the rendering step.
-
6. Re: iPad choppyness?
pTymN Oct 18, 2010 7:48 AM (in response to Pea)The frame skipping can be nice when your sounds stay in sync with the graphics.
-
7. Re: iPad choppyness?
Pea Oct 18, 2010 12:20 PM (in response to pTymN)Is there any way to disable frameskipping? (either compile time or run time?).
-
8. Re: iPad choppyness?
PunchAndPie Nov 5, 2010 10:53 AM (in response to Pea)Pea,
Did you ever figure out a way to disable the frame skip? I'm currently being driven mad by an issue with frameskip killing the smoothness of my animations, and not being able to even detect when it is actually happening, so there's no way to even try to compensate for it
argh.
-
9. Re: iPad choppyness?
Pea Nov 6, 2010 10:20 PM (in response to PunchAndPie)I didn't figure out how to stop it - but you can detect it. In your main loop use getTimer() to calculate the time between the current and the last frame. With frameskip this number varies wildly from high to low instead of staying relatively steady. Use this characteristic to determine whether frameskip is happening and lower the actual framerate to compensate.
From what I have seen, lowering the framerate leads to much smoother animation than with frameskip, even though the framerate is set lower. For example, an animation at 12 fps will look smoother than an animation at 20 fps with high frameskip. This makes me wonder why even build frameskip into the engine? I would have thought the purpose of frameskip was to keep the animation smooth!



