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.
November 4th, 2008 at 6:26 pm
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
November 10th, 2008 at 11:08 am
Loving your work trying to build my own Skeletal Animation System.. just getting started so your piece gave me a good indication..
December 17th, 2008 at 1:46 pm
Would be great if you could post some of your code so that we can learn as well.
January 10th, 2009 at 2:22 pm
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
January 10th, 2009 at 4:16 pm
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.
January 12th, 2009 at 6:57 pm
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!
January 12th, 2009 at 7:02 pm
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.
February 17th, 2009 at 11:42 pm
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.
March 1st, 2009 at 12:13 pm
Nice work.
August 19th, 2009 at 6:50 pm
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.
February 23rd, 2010 at 7:50 pm
Wow, this is great. IS it possible u can go make a tutorial on how u did this?
I’ve been looking for a way to make around 50 character without constant remaking animation. I want to be able to update it and add new character if needed.