// 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

3 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

Post a comment

Twitterpated