Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am on my first attempt to build a skeletal animation system for 2D side-scrollers, so I don't really have experience of what may appear in later stages. So i ask advice from anyone that been there and done that!

My approach:

I built a Tree structure, the root node is like the center-of-mass of the skeleton, allowing to apply global transformations to the skeleton. Then, i make the hierarchy of the bones, so when moving a leg, the foot also moves. (I also make a Joint, which connects two bones, for utility).

I load animations to it from a simple key frame lerp, so it does smooth movement.

I map the animation hierarchy to the skeleton, or a part of it, to see if the structure is alike, otherwise the animation doesnt start.

I think this is pretty much a standard implementation for such a thing, even if i want to convert it to a Rag Doll on the fly..

Now to my question:

Imagine a game like prototype, there is a skeleton animation of the main character, which can animate all meshes in the game that are rigged the same way.. That way the character can transform into anything without any extra code.

That is pretty much what i want to do for a side-scroller, in theory it sounds easy, but I want to know if that will work well. If the different people will be decently animated when using the same skeleton-animation pair. I can see this working well with a Stickman, but what about actual humans? Will the perspective look right, or i will need to dynamically change the sprites attached to bones?

What do you recommend for such a system?

share|improve this question
1  
You might want to take a look at this kickstarter project kickstarter.com/projects/539087245/spriter –  solarc Apr 30 '12 at 18:50
    
+1 @carlosz Came here suggest spriter. I'm a pledger myself. –  ClassicThunder Apr 30 '12 at 22:53

2 Answers 2

Depending on art style, you will need to be able to animate the sprites attached to the bones.

Think of different attacks, where the hands might need to open or close. Or drawing "action lines" to make a punch look super fast or powerful. Or changing facial expressions.

If you're going for a more realistic art style, you're also going to find it difficult to make the seems/joints look natural, too. Drawing/rendering an entire sprite can produce much more visually appealing results, at the expense of less flexibility and possibly more work for the artists.

I would suggest looking into some of the Flash character animation packages. They provide the same features you have, plus vector art capabilities which can be handy, plus IK solver support which is necessary for some types of games.

A lot of 2D games actually just use Flash as their animation tool and import "characters" from SWF files.

share|improve this answer

If I understand it right, you have the following situation:

  • 1 Skeleton
  • User-animations for that skeleton (player presses jump, the skeleton jumps)
  • A set of sprites which you attach to the joints of that skeleton

What you need:

  • AI-animations for the NPCs/enemies.
  • A set of sprites characterizing the individual NPC

As long as you don't change the skeleton, you can simply "take-over" any NPC/enemy by dynamically switching from AI-animations to User-animations and setting the chosen character as user-controlled.

NOTE: Since you always have the same skeleton, all characters have the same hight, arm length etc. You might want to create and animate multiple skeletons to provide some variety.

share|improve this answer
    
actually, the heights and widths of the bones could be changed dynamically (think for example of a stretching arm! ), the structure is what counts, each bone properties are just flexible to any values. Thanks for the answer, it did help me reflect about it, but I still could use more tips, on how to do the best with such a system :) –  Grimshaw Feb 29 '12 at 20:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.