Back in April 2011, PugsAce uncovered an interesting Adobe Flash Document listing best practices meant to be used by Flash program developers who wanted to produce efficient Flash products. Here's the document:
Optimizing Performance for the ADOBE® FLASH® PLATFORM
I believe there are sections of this document pertinent to helping resolve the meter issues.
In a nutshell Adobe Flash says:
- If your flash code takes longer to execute than the alloted time, the screen does not get updated and the animation appears choppy.
- If your frame rate is 30 frames per second (FPS) your frame loop must complete all its work in 1/30th of a second.
- The higher the frame rate, the more CPU cycles required by your code.
- An adequate frame rate is at least 20 frames per second. Anything more than 30 FPS is often unnecessary.
My question for the WGT Flash Developers is this:
Why do you animate the meter at 60 FPS when things like the ball flight and ball rolling are animated at just 30 FPS?
By doing so your meter code has just 1/60th second to complete. While ball flight code has 1/30th second to complete. The meter is twice as likely to appear to stutter.
Is this why the meter is so sensitive to other things running in the background?
I'm suggesting WGT lower the frame rate of meter animation based on the Adobe Flash Best Practice "In general, use the lowest possible frame rate for better performance".
For convenience, here are excerpts from Adobe's best practices document.
Optimizing Performance for theADOBE® FLASH® PLATFORM:
Application frame rate
In general, use the lowest possible frame rate for better performance.
An application’s frame rate determines how much time is available for each “application code and rendering” cycle, as described in “Runtime code execution fundamentals” on page 1.
A higher frame rate creates smoother animation. However, when animation or other visual changes aren’t happening, there is often no reason to have a high frame rate. A higher frame rate expends more CPU cycles and energy from the battery than a lower rate.
The following are some general guidelines for an appropriate default frame rate for your application:
•If you are using the Flex framework, leave the starting frame rate at the default value.
•If your application includes animation, an adequate frame rate is at least 20 frames per second. Anything more than 30 frames per second is often unnecessary.
•If your application doesn’t include animation, a frame rate of 12 frames per second is probably sufficient.
Key paragraph from the "Runtime code execution fundamentals" mentioned above:
Optimizing Performance for theADOBE® FLASH® PLATFORM:
Runtime code execution fundamentals
If the combined operations of the frame loop (code execution and rendering) take too long, the runtime isn’t able to maintain the frame rate. The frame expands, taking longer than its allotted time, so there is a delay before the next frame is triggered.
For example, if a frame loop takes longer than one-thirtieth of a second, the runtime is not able to update the screen at 30 frames per second. When the frame rate slows, the experience degrades. At best animation becomes choppy.
In worse cases, the application freezes and the window goes blank.