Archived

This topic is now archived and is closed to further replies.

krez

2D skeletal animation?

Recommended Posts

i am working on a 2D platformer/fighting game, and i am considering using a 2D skeletal animation technique for the characters. that is, each character would be made of several pieces that are connected to each other with joints, which can rotate and slide and such. i have a basic idea of how i am going to do this, but i am curious if anyone has done something like this, and if so do you have any pointers or gotchas?

Share this post


Link to post
Share on other sites
isn''t soldat using skeletal anims? it sure looks like it.

I don''t think there is anything particular with skeletal animations in 2D. It should be quite simple. a vector and a scalar angle

also, that would be quite useful if you want to do inverse kinematics (like have the arms and gun in hand follow the mouse pointer, and the feet follow the terrain slope).

Share this post


Link to post
Share on other sites
it would seem to me that even if it was a 2D game, you''de still need a 3D figure. Otherwise, they will look like paper dolls whose joints are fastened with brads. They would look kind of goofy since you would have no perspective, foreshortening, or anything remotely realistic. Of course, if it''s Paper Doll Fighter II, you might get away with it :-)

Share this post


Link to post
Share on other sites
I considered doing something like this, too, although I was going to use springs and tension for a physically-realistic simulation.

The gotchas are mostly collision: think long and hard about how everything is going to work before you write a line of code, or you''ll go nuts.

Resist everyone
I am your only friend. Click here for more information. (MOVED)
Penguin Ninja!

Share this post


Link to post
Share on other sites
quote:
Original post by leiavoia
it would seem to me that even if it was a 2D game, you''de still need a 3D figure. Otherwise, they will look like paper dolls whose joints are fastened with brads. They would look kind of goofy since you would have no perspective, foreshortening, or anything remotely realistic.

yah i was thinking about that, but i haven''t reached a solution yet. i could just transform the parts in 3D, but then at certain angles they would look strange, or even disappear (if they are perpendicular to the screen). i must find a workaround for this, because i do not want to actually use 3D models.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hi
Castlevania serie of GBA uses this technique extensively. Look at the first moments in Castlevania: harmony of disonnance, where a enormous armor attacks you.

Share this post


Link to post
Share on other sites
well, think about certain "moves". Let''s say you do a spinning backfist punch. How would you do the "spinning" part?

Share this post


Link to post
Share on other sites
Sammy''s upcoming fighting game The Rumblefish uses this technique. Some people say it looks odd and does give you a paper doll effect.

Share this post


Link to post
Share on other sites
I was toying with this idea as well a little while ago. I figured you''d need some sort of depth info just to make animations stable (otherwise you''d get the various parts flickering over others as they moved). A simple depth value per key frame (and interpolate between) should do it, then you can just sort your sprites on the depth and draw. Then you just create the animations with the appropriate shortening of limbs as they move.

Share this post


Link to post
Share on other sites
how about allowing the character to have about 3-4 different directions that they can face? and have a full set of sprites for each one... so you would have 2 with the chest facing you.. .looking left and right... and 2 with the back facing you... right and left... that way spins etc could work... and you would have more freedom in the design of moves etc... without making it look to monty python :D

Share this post


Link to post
Share on other sites
Some ideas:

I would create a tree-like structure describing my model in full-3D (only the coordinates, orientation, etc.), and apply all the motions, tweening, inverse kinematics and stuff to this model to achieve the final pose; then I would apply my 2D model to the 3D model from a by-side view and render... of course, there comes the question: what if the model needs to display multiple sides of it, eg. like Kyo and his flaming uppercut where he performs a full turn around himself? Well, one could draw several 2D images of his model''s components (arms, torms, etc.), 8 for instance, 4 for the four general directions (forward, backward, left side, right side - these last two can just be the same image reversed) and another 4 for the in-between poses... so at render-time, the program can choose which pose to use according to the general orientation of the model... requires some nasty math though, and it is more of a hack than a real solution... surely there are other, more efficient ways to do this...

-----------<<>>-----------
Flareman (a.k.a Ga1adaN)
Primus ante Adain
flareman@freemail.gr
-----------<<>>------------

Share this post


Link to post
Share on other sites
If we''re talking street fighter, SFII just used straight up full-frame sprites i believe. Every sprite was different. Of course, if you over-analyze it, you''ll find clever reuse of some of the images.

Share this post


Link to post
Share on other sites
quote:
Original post by leiavoia
If we''re talking street fighter, SFII just used straight up full-frame sprites i believe.

nah. i was originally looking for a workaround to finding someone to draw me a few hundred sprites (i can''t draw), and then i thought, "hey, i could do it this way, and fit in even more animations!"

anyway, between some toying around and some of the suggestions here, i am going to:

define each character as a collection of sprite "parts", which are linked together by 3D bones and joints. each frame, the position of each part will be calculated based on the usual skeletal animation technique. the parts will then be rendered at those angles and positions, with foreshortening being simulated by simply stretching/squishing (technical terms, huh?) the part sprites. depending on the part sprite, i may use multiple sprites based on the angle they are at (i.e. faces), although generally it won''t be necessary because of the cartoony look i am going for.

feel free to keep discussing it, as i am far from done with this. i just thought i should update the thread since i haven''t actually said much

Share this post


Link to post
Share on other sites
eh, it has fallen victim to my short attention span... while it is far from "thrown out", i am working on other things at the moment, between playing other people''s games

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
How''d Total Annihilation do it? Weren''t models merely a bunch of polygons pre-sorted and stacked on top of each other?

Share this post


Link to post
Share on other sites