2D Skeletal Animation

Started by
4 comments, last by gunning 18 years, 8 months ago
I'm thinking about using skeletal animation in a 2D game I'm working on, and am wondering where I should start. I have been reading through online tutorials and I understand the basic concepts, but don't understand how I could implement skeletal animation in my project. Does anyone have any pointers about where I should start? Thanks -Shane
Advertisement
Sure thing. I've spent the last couple months working on such a project so I should be able to give you some advice here.

First, you are going to need a graphics API that can draw rotated polygons. Otherwise, you will not get the full benefits of such a system. I assume that you are familiar with your API of choice.

2D skeletal animation is much much simpler than its 3D counterpart because you can completely skip all of the difficult and sometimes computationally expensive math involved with Quaternions/Slerping.

Start with drawing polygons on screen. The develop a system to draw polygons that can position and rotate themselves to match the orientation of a given bone. The way you define a bone is up to you. I have been conversing with another member here who implemented bones using hierarchical transformations, which is different from my method using verlet particles and rigid constraints. In my system, it is the constraints between the particles that define the position of any vertex to be drawn. Of course you could probably even combine these two methods.

This is the grunt work of the system. The rest is all fluff in my opinion. From there create a human model that is set up to use bones. I recommend that you split up your model into different polygon subsets. For example, I found it unrealistic to have the shoulder share the same verticies as the upper chest because when the arm rotated it caused awkward movements.

After that, work on an animation system to move your model. At this point you should have a solid 2D skeletal animation system up and running.

I hope that the process was not overly generalized. Sometimes I awkwardly delve into detail at random times and end up confusing people.

Well this is the logical path I took in development. Let me know if you have any specific questions.
....[size="1"]Brent Gunning
Thanks, skittleo! I've also been thinking about implementing skeletal animation in my 2D engine. I assume it would be not very hard to add ragdolls to this?
Quote:Original post by centipede
I assume it would be not very hard to add ragdolls to this?


Not hard at all. As you expect, adding ragdolls is a natural extension of the skeletal animation system, but it takes a little work to have the ragdolls interact with your environment. If it helps any, this thread contains a more technical explanation of the system I came up with. Remember though that this is my first experience with 2D skeletal animation and it would be stupid of me to say that I know what I am doing. [smile] Experiment a little and see what works and what doesn't.
....[size="1"]Brent Gunning
So do you think it would be a good idea to create my own animation editor? Or could I use a commercial program like milkshape / characterFX?

Thanks
-Shane
It is up to you.

But if you plan on using an already-available animation package, be sure to accomodate to their bone representation. Depending on how you structure your skeleton, this may or may not be an easy task. For me, it would have been very difficult as I do not use the hierarchial transformations that Milkshape uses.

I found that creating a custom editor was a better use of time than converting MS3D animations to my format. Not to mention that MS3D animations lacked certain custom parameters that I would then have to define by hand. But that was just my experience and you might find differently.

And allow me briefly describe what I mean with hierarchial transformation bones versus particle bones. Hierarchial transformation bones as I call them use a series of mathematical transformations down the bown hierarchy to describe the skeleton pose. This makes implementing angular constraints a breeze. My system on the other hand uses individual particles at key joints in the body to define the pose. Each graphical vertex maps to a joint that connects two bones together. So nowhere does a transformation hierarchy come into play. In order for my system to adapt to Milkshape's, I would have to perform the transformations myself during load time and generate particle positions based on them. At that time, I felt that creating an editor would be a better option - and it was.
....[size="1"]Brent Gunning

This topic is closed to new replies.

Advertisement