dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: [F8] Animation is slowing game.

  1. #1
    Wait- what now? tidenburg's Avatar
    Join Date
    Dec 2005
    Posts
    1,472

    [F8] Animation is slowing game.

    OK. I have about 20 looping, animated movieclips inside a big container mc, then on the root I have 4 movieclips and the main code uses about 20 iterations per frame. The background animation makes the game run dreadfully slow (about 10-15fps where 29 without them).

    They are just normal drawings using motion tweens to move and loop continuously, could there be a reason for this or is flash that bad at handling this kind of stuff.
    "I'd only told them the truth. Was that so selfish? Our integrity sells for so little, but it is all we really have. It is the very last inch of us, but within that inch, we are free."

  2. #2
    Animal Lover, Flash lover eaglevision's Avatar
    Join Date
    Jan 2008
    Location
    In FlashKit
    Posts
    286
    Wait, what do you mean by "Normal drawings"?
    Oh, and are there any bitmap images there?
    ~11-year old flasher

  3. #3
    Wait- what now? tidenburg's Avatar
    Join Date
    Dec 2005
    Posts
    1,472
    Nothing imported all flash. Line tool vector stuff etc.
    "I'd only told them the truth. Was that so selfish? Our integrity sells for so little, but it is all we really have. It is the very last inch of us, but within that inch, we are free."

  4. #4
    Animal Lover, Flash lover eaglevision's Avatar
    Join Date
    Jan 2008
    Location
    In FlashKit
    Posts
    286
    Don't you think this is way to big? I do...or mabye I just don't know what flash can handle...Well, sorry, can't help you here...bye
    ~11-year old flasher

  5. #5
    Wait- what now? tidenburg's Avatar
    Join Date
    Dec 2005
    Posts
    1,472
    No, I seen some game with much more animation than this.
    "I'd only told them the truth. Was that so selfish? Our integrity sells for so little, but it is all we really have. It is the very last inch of us, but within that inch, we are free."

  6. #6
    Junior Member
    Join Date
    Jul 2007
    Location
    Glasgow, Scotland
    Posts
    18
    The 'normal drawings' you're talking about - in the form of vector graphics - are handled by Flash in real time. The larger they are and more complex they are, the slower they will run. Lots of curves will be especially heavy on the Flash player.

    There's a trade-off between using this type of graphical content, and loading your images as JPEGs, PNGs etc. - your externally 'compiled' images will be much easier for Flash to handle, but will take up file space.

    Would you be interested in providing your FLA file? I'm interested to see just how much animation is going on. Maybe that'll help us discover a good solution for you.

    You mentioned 'background animation' - if this is a section of scenery drawn in Flash, I'd suggest taking that into a new FLA file (i.e. just copying and pasting the MovieClip or the contents of it or something) and saving it as a PNG, then loading the PNG back into your game, and displaying and scrolling that instead. Sure, it may be a 1024x512 image, but I prefer to wait while really fluid, smooth game loads, than instantly play a game that runs sluggish!

  7. #7
    Half Empty happinessSam's Avatar
    Join Date
    May 2003
    Location
    London
    Posts
    442
    Another thing you can do if you have vector animations that just loop is to draw each frame of the animation onto a bitmapdata object before the game start, then write some simply code to display the right image for the animation.

    This would mean you'd get the small file size of vector animation and the cpu usage of a bitmap.

  8. #8
    Junior Member
    Join Date
    Jul 2007
    Location
    Glasgow, Scotland
    Posts
    18
    Yup, what happinessSam said would be the best idea. It's a slightly more advanced topic, if you ask me, but it's worth it. There's another trade off, though - memory usage - all the BitmapData objects taking up memory. It's just what you choose: game performance/CPU usage/RAM usage!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center