AS3 Performance Test Feedback

Discussion in 'Feedback Requests' started by JGOware, Feb 1, 2009.

  1. JGOware

    Indie Author

    Joined:
    Aug 22, 2007
    Messages:
    1,578
    Likes Received:
    0
    http://gameagoo.com/flash/
    All objects are Display.Sprite(). Slower, but realtime fx is easy.

    http://gameagoo.com/flash/index2.html
    All done with Copypixels()and Draw(). Faster but you lose some realtime fx capability.

    Click on the asteroids to explode em. ;)

    Just playing around with a basic AS3 2D engine I wrote and wanted to get some feedback on it. On my low end dev kit, it runs ok'ish at default quality ("medium"), if I set the quality to "low" it runs very nice but at the expense of some graphic smoothness.

    I would appreciate it if anyone could run it and reply how it ran for you and if it doesn't run ok, could you please reply with your browser type,cpu/gpu? Thanks!
     
    #1 JGOware, Feb 1, 2009
    Last edited: Feb 2, 2009
  2. MFS

    MFS New Member

    Joined:
    Feb 28, 2007
    Messages:
    314
    Likes Received:
    0
    With all the asteroids active, it wasn't smooth at all. Best performance was with less than 10 asteroids active and it was very smooth.

    This is on my netbook (probably your low end.) I'll test it on the desktop later.

    1.6 Ghz CPU
    1 Gig RAM
    Integrated vid
    Chrome/Firefox both yielded similar results.
     
  3. oldschool

    Original Member

    Joined:
    Jan 23, 2006
    Messages:
    167
    Likes Received:
    0
    tested in both firefox and chrome,

    In firefox 3.06 with seven tabs open and flashdevelop running.
    Ran slow, on right click it lock up the browser

    in Chrome with a 10-15 tabs open and flashdevelop running.
    ran ok, medium and high quality settings

    my specs
    1.34 ghz athlon xp
    1.25gb ram
    Radeon 9000


    if you need an animation system you might try this one at adventures in actionscript. I use it and it runs well for me.

    or this at H1DD3N.R350URC3 I used it a long time ago and they have updated since then

    or this at boostworthyisryantaylor Haven't used this one

    Good luck
     
  4. tolik

    Original Member

    Joined:
    Sep 20, 2004
    Messages:
    1,407
    Likes Received:
    0
    Super-jerky, framerate super unstable. Why wouldn't you plug in decent FPS counter (fps_util)?
    Computer: Super high-end. copypixel games work fine ;)
     
  5. Maupin

    Original Member

    Joined:
    Jun 28, 2006
    Messages:
    1,182
    Likes Received:
    0
    Ran very smooth on my laptop. Only a small stutter every 5 seconds or so, which disappeared completely once I got down to 58 asteroids or so.

    1.6 GHz Intel, 256 MB ATI Mobility Radeon X1400
     
  6. JGOware

    Indie Author

    Joined:
    Aug 22, 2007
    Messages:
    1,578
    Likes Received:
    0
    Thanks for the reply. wow... I wonder why the overall experience is so mind blowing different on computer to computer? Is that just what to expect from Flash?. I ran it on 3 systems locally (XP, 2 Vista) and they all ran very acceptable. The demo is doing nothing out of the ordinary, just plain AS3 script and the main loop called on enter frame. :confused:

    For those who know: When using delta time for movement, is it better to set the framerate of the project higher or lower? Right now I have it set at 600fps (yes six hundred), but I'm wondering if I should just set it at 30fps since I see no need for it to ever run faster then 30fps. Thanks.
     
    #6 JGOware, Feb 1, 2009
    Last edited: Feb 1, 2009
  7. KNau

    Original Member

    Joined:
    Jul 29, 2004
    Messages:
    1,165
    Likes Received:
    2
    OMG - absolutely do not set such a high framerate!

    For general puzzle / adventure type games you can set for 24 or 30 FPS and be fine. For an arcade game the best strategy is to set your framerate even lower (6 FPS isn't unreasonable) and use (in AS2) updateAfterEvent to create a smooth framerate.

    updateAfterEvent does a screen update upon completing the function before it, independent of the framerate setting. So you can have the stage set to 6 frames per second but have silky smooth movement. You're cutting down the stage overhead and only updating when it's relevant to do so.

    If you're using delta timing don't tie it to the framerate cycles, use an actual timer.
     
  8. trmiller

    trmiller New Member

    Joined:
    Jun 8, 2008
    Messages:
    6
    Likes Received:
    0
    It ran great on my home computer. Not an ounce of lag at any time. The computer I tested it on had the following specifications:

    2.8 GHZ Processor
    4 GB of RAM
    Windows Vista Home Premium x64 with service pack 1

    and I don't know what sort of graphics card it contains but it is not very powerful, as I once attempted to play a high end game on it and the game crashed after about 20 seconds.

    Hope this info doesn't confuse you even more:rolleyes:
    -Tristan
     
  9. JGOware

    Indie Author

    Joined:
    Aug 22, 2007
    Messages:
    1,578
    Likes Received:
    0
    Thanks for the continued comments. yah it confooses me... :) lol.. but upon further research, that's Flash for ya. ;) It will run great on some, lag on others.

    "updateAfterEvent does a screen update upon completing the function before it, independent of the framerate setting. So you can have the stage set to 6 frames per second but have silky smooth movement. You're cutting down the stage overhead and only updating when it's relevant to do so.

    If you're using delta timing don't tie it to the framerate cycles, use an actual timer."

    Interesting. I read this before but I'm not sure how to set this up. If/when you have time some generic code would be appreciated. Thanks. ;)
     
  10. KNau

    Original Member

    Joined:
    Jul 29, 2004
    Messages:
    1,165
    Likes Received:
    2
  11. JGOware

    Indie Author

    Joined:
    Aug 22, 2007
    Messages:
    1,578
    Likes Received:
    0
    Thanks, I'll check out that tutorial. :)

    In the mean time, here's a copypixel(for the rocks) and draw(for the rock particles) version. Should perform better hopefully. ;)

    http://gameagoo.com/flash/index2.html
     
  12. Jack Norton

    Indie Author

    Joined:
    Jul 28, 2004
    Messages:
    5,126
    Likes Received:
    0
    See that's what pisses me about flash. That trick was written nowhere, I didn't even know about that command! Thanks a lot for sharing it :)
     
  13. realtime44

    realtime44 New Member

    Joined:
    Jan 15, 2009
    Messages:
    21
    Likes Received:
    0
    Ran it at home

    Hi, I ran this from my home pc yesterday and would like to report that the results are very similar.

    10-15 asteroids are the magic formula for smoothness

    pc specs
    -----------
    Core 2-duo e7300
    Geforce 8900 GT OC
    2 gigs ram

    -- RT
     
  14. Maupin

    Original Member

    Joined:
    Jun 28, 2006
    Messages:
    1,182
    Likes Received:
    0
    Ran as smoothly as the first test, but the slight pauses/stutters were much further apart. Maybe 10 or 15 seconds between them.
     
  15. oNyx

    Original Member

    Joined:
    Jul 26, 2004
    Messages:
    1,211
    Likes Received:
    0
    2nd one runs way smoother.

    >I wonder why the overall experience is so mind blowing different on computer to computer?

    Smoothness is very subjective. And the fps don't really tell you how smooth it is. For that you need a time-per-frame graph (or frame time display) like this one:
    http://kaioa.com/k/ftd.png (spikes indicate late frames)

    Statistics which are very useful in this context are things like min/max/avg msec per frame for the last x seconds. You can also count how many frames per minute take more than 10% longer than the average. This shows you if you got some GC issue going on.

    --

    Personally I don't really like updateAfterEvent for the main loop. E.g. you can invoke it 100 times a seconds, but you only get 5 frames on screen... and your logic is still triggered at 100hz. I'd rather have 10 frames on the screen instead (and only 10 logic updates).

    But updateAfterEvent isn't completely useless - it's very handy to trigger a redraw whenever the mouse position changes (software mouse cursor).

    Also I don't really get why so many people think updateAfterEvent is great, because you can use a low framerate for your movie. It's not like it would use less CPU then.

    If you're interested, my default template currently looks pretty much like this:
    http://kaioa.com/k/MainTemplate.as

    (1000fps is for benchmarking - comment it out if you don't need it.)
     
  16. JGOware

    Indie Author

    Joined:
    Aug 22, 2007
    Messages:
    1,578
    Likes Received:
    0
    Good stuff, thanks for the comments. :) I'm going to stick with the ENTER_FRAME timing for my main loop for now. I'm getting much more stable results across my test machines with that compared to updateAfterEvent.

    oNyx, your template is 100% (tech wise) identical to mine. Thanks for sharing that. That was good to see. ;)
     
  17. Spore Man

    Indie Author

    Joined:
    Jun 19, 2007
    Messages:
    842
    Likes Received:
    0
  18. Maupin

    Original Member

    Joined:
    Jun 28, 2006
    Messages:
    1,182
    Likes Received:
    0
    ;) as3newb on flashkit.com == JGOware on indiegamer.com
     
  19. hippocoder

    Indie Author

    Joined:
    Mar 18, 2008
    Messages:
    591
    Likes Received:
    0
    Flash by nature tries its best to become the lowest possible priority. It has a priority of nothing, so even small hard drive access or a windows DLL in the background can cause it to hitch or slow down.

    Problem also depends on browser version, which flash version you're compiling for and which flash plugin the user has too!

    This design decision was made so that sites with flash ads wouldn't slow to a crawl and lock up people's computers.
     
  20. Maupin

    Original Member

    Joined:
    Jun 28, 2006
    Messages:
    1,182
    Likes Received:
    0
    Can Air increase the priority or otherwise overcome these small pauses when making standalone apps?
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer