// you’re reading...

ActionScript 3.0

Barebones! - AS3 Skeletal Animation System

I’ve been spending a lot of time lately working on a fighting game for a client. It’s pretty standard Street Fighter fare, only much simplified due to time and budget restrictions. However, it made me start thinking about the limitations of the old 2D fighters and what a more powerful processor, faster graphics, and a WYSIWYG animation editor could do for them. I went to my lab immediately.

The first thing I wanted to know was, is there a way to make an animation that can be shared among characters in a game? And could characters be “skinned,” so the same character could change appearances, add/remove body parts or attachments, etc. and retain the same animations? I see it all the time in big-budget 3D games; each character has a skeleton, to which animations may be applied. Each animation can be applied to any character, and each character can use any 3D character model (each of which can of course be “skinned”). So you have three components in the system:

  • Skeleton
  • Animation
  • Skin

Never having been involved with a big-budget game, I can’t tell you the best way to design a system like that. However, as a Flash developer, I can find a good way to do it in 2D, in your browser.

This is a quick example of the system (v0.1) in action. This looks like a timeline animation, but it’s actually done with code. To prove it, click the stage to toggle the animation speed. Notice that it slows down to “bullet time,” but totally smoothly, without the jerkiness of a frame-based animation going down to 3 fps. Also, because of how the system is designed, it can be combined with a physics engine (Box2D, for example) for ragdoll falls from any point in the animation. Think of the possibilities!

Anyway, just wanted to put that out there. I’ve got a couple projects in line first, but I’d like to explore this further to see what kind of gameplay could come of it.

Discussion

10 comments for “Barebones! - AS3 Skeletal Animation System”

  1. This looks great man.

    The mech i did was intended for skinning, so I could make characters, like enemy mechs. But i didnt get it as elaborate so it can be integrated with physics engine.

    Sounds you have something nice comming along.

    Kudos

    Posted by Juan Bermudez | November 4, 2008, 6:26 pm
  2. Loving your work trying to build my own Skeletal Animation System.. just getting started so your piece gave me a good indication..

    Posted by Andy | November 10, 2008, 11:08 am
  3. Would be great if you could post some of your code so that we can learn as well. :)

    Posted by Charity Colvin | December 17, 2008, 1:46 pm
  4. Hi there,
    the demo looks cool. How is the system coming along? Any idea when/if you are going to release some code for us to play with it?
    ;)

    regards,
    goliatone

    Posted by goliatone | January 10, 2009, 2:22 pm
  5. I haven’t decided whether to release this one yet. Eventually I’d like to release some commercial stuff; this one might fit the bill.

    Posted by Zack Jordan | January 10, 2009, 4:16 pm
  6. Looks nice, we were discussing this here at work and I’d love to see the final fighting game you were working on - even if it didn’t use this system. Nice work!

    Posted by Terry Paton | January 12, 2009, 6:57 pm
  7. PMF Wrestling

    We ended up going with a much simpler animation approach for this one (time, of course), but just wait; the next one will be awesome.

    Posted by Zack Jordan | January 12, 2009, 7:02 pm
  8. If you check out Discarded (It’s on Kongregate, this isn’t an advertisement for that game), you can see a similar system in action, the players and enemies are based off a ‘rig’ which we add clothing and body parts to, works quite well.

    Posted by iopred | February 17, 2009, 11:42 pm
  9. Nice work.

    Posted by Ozgur Uksal | March 1, 2009, 12:13 pm
  10. That’s pretty awesome looking, very smooth. I’ve always had a great interest in coded animation, I love what you’ve done. Hope to see it put to use soon, great work.

    Posted by Porter | August 19, 2009, 6:50 pm

Post a comment