Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.


Results 1 to 5 of 5

Thread: Handling animations efficiently.

  1. #1

    Handling animations efficiently.

    Hi there,

    I am developing a platform engine in AS3 and I was wondering about handling animations. For sprite movement and what not I am using copypixels but I am more concerned about things like enviromental animations (waterfalls etc) and background animations (twinkling stars etc etc.)

    Obviously, I can embed / load a .swf file for each animation, create a sprite set, or perhaps even import an flv file... My real concern is which method would be the most efficient for cpu / memory usage since I want to loads down to handle the game logic.

    Any ideas would be helpful.

  2. #2
    Prerendered animations will be more efficient than computational effects, because there are no calculations to be performed. As long as you are using bitmapdata to display the graphics i don't really see any difference between a swf for each animation, or an flv, or whatever. I do believe that for multiframe animations (like character animations) it is best to have all the frames in one bitmap laid out in a grid, so that you can just use that one source bitmap to copy the pixels from, rather than lots of smaller bitmaps. It's called blitting i believe.
    My new hero: Chrysippus
    "Chrysippus is said to have died in a fit of laughter- having given wine to his donkey, he died of laughter after seeing it attempt to eat figs."
    What a legend!

  3. #3
    Thanks for the reply.

    Yea, I am blitting all my sprites (characters etc) but I'm thinking for larger scale background / foreground animations. I suppose throwing in FLV is probably the best way to go for larger stuff, since SWF files would require more CPU power?

  4. #4
    I wouldn't say an flv is any more efficient (maybe less so) than simple imported images. If these are in a separate swf that's fine too. Vector animation is indeed more cpu intensive than bitmaps.
    My new hero: Chrysippus
    "Chrysippus is said to have died in a fit of laughter- having given wine to his donkey, he died of laughter after seeing it attempt to eat figs."
    What a legend!

  5. #5
    hugeExplosions = true;
    Ultimately no matter the content of the animation the same number of pixels has to be thrown around the screen - how those pixels are calculated is important, with vectors being drawn every frame being the slowest. I'd imagine just creating a sprite set and blitting as you are already doing would be fine - you can always just get it going and optimise later when you know how efficient the rest of your code is.

    If you are worried about performance but you don't mind not having the Flash medium to distribute your game you could always write the engine in something with a bit more oomph and with hardware support such as c#/XNA or OpenGL

    You won't be losing much of an audience with a simple game as most people have graphics cards easily capable of handling basic 2D etc.
    MS Paint FTW!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012