Jump to content
  • Advertisement
Sign in to follow this  
shane1985

2D Skeletal Animation

This topic is 4840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!