Forums

Help › Forums

Attn: WGT Flash Developers - Suggestion on Meter Frame Rate

rated by 0 users
Sun, Feb 17 2013 4:37 AM (21 replies)
  • andyson
    6,415 Posts
    Thu, Jan 17 2013 9:07 AM

    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.

  • sixkiller
    1,147 Posts
    Thu, Jan 17 2013 9:27 AM

    Uhhhh.......what he said.

  • TWOMINUSONE
    2,580 Posts
    Thu, Jan 17 2013 9:47 AM

    Cant wait to see the (somewhat) reply to this. 

  • gsoup
    2,929 Posts
    Thu, Jan 17 2013 10:02 AM

    TWOMINUSONE:

    Cant wait to see the (somewhat) reply to this. 

    they are breaking out dictionaries and thesauruses,

    in a nut shell

    'METER STILL AINT RIGHT'

  • Funkyjunkie3000
    722 Posts
    Thu, Jan 17 2013 10:12 AM

    weirdly my meter is pretty much ok, yet my ball flight stutters like hell same on putts

  • andyson
    6,415 Posts
    Thu, Jan 17 2013 10:35 AM

    Doesn't surprise me FJ.  I imagine there's a lot more calculating involved by the game to generate the flight trajectory and then map it into the 2D photo.  Consider also they generate the shadow of the ball over the ground, trace that over mounds and through bunkers and whatnot. And calculating the shot yardage and yards to the pin then displaying the whole lot in real time.  Not to mention when the ball goes through the trees they have to know to hide the ball.  Always checking for obstacles or hills in the hole mapping is another calculation while the ball is in the air.   Really quite impressive to me and part of the beauty of the game.

    Could be why they chose 30 FPS for ball flight/rolling.  More allotted time was needed to do all those calculations.

  • YankeeJim
    25,827 Posts
    Thu, Jan 17 2013 10:45 AM

    Doesn't all that stuff happen after the meter display? The game doesn't know what to compute until you click the shot.

  • andyson
    6,415 Posts
    Thu, Jan 17 2013 12:08 PM

    YankeeJim:

    Doesn't all that stuff happen after the meter display? The game doesn't know what to compute until you click the shot.

    If by "all that stuff" you are referring to the ball flight calculations, well yeah of course it doesn't affect the meter.  FJ was talking about the ball flight and roll animation stuttering and all those calculations need to be done in order to draw the ball flight.

    (Remember, there are some people on here, recognizable by their tinfoil hats, who believe the ball flight and end result is calculated by WGT before you even swing.  ;o)  )

     

  • WGTicon
    12,511 Posts
    Thu, Jan 17 2013 1:27 PM

    Thanks andyson.

    We'll have engineers take a look, cause for me, it's like Aramaic...

  • andyson
    6,415 Posts
    Thu, Jan 17 2013 3:19 PM

    Thanks for acknowledging the post Icon!  You know how to reach me if they have questions.

    Andy

RSS