Animating a RagDoll character to walk

Official forum for the Chipmunk2D Physics Library.
Post Reply
Elphaba
Posts: 1
Joined: Thu Apr 02, 2009 6:05 am
Contact:

Animating a RagDoll character to walk

Post by Elphaba »

Hi.

I'm at Uni, and as part of a module we have to build a 2D physics game with an animated character.

I've choosen to use Chipmunk (obviously - as I'm here posting) for my 2D engine, but I've run into an issue with animating my 'RagDoll'character.

I've read in other posts that someone has this solution, but I've looked at the forums and can't find the post.

Basically, my RagDoll needs to walk along a 'ground' that is part of the Chipmunk 2D engine.

To 'animate' the character, rather than using frame animation over a 'box' and switching to ragdoll at certain events, I want to animate the ragdoll.

Here is my 'idea'...

The character is made of 14 boxes (Head, upper arms, lower arms, hands, body, upper legs, lower legs and finally feet). To these feet I have pinned a cirle to each, where one foot is at the top of one circle and the other foot is at the bottom of the circle - so at rest currently he look like he's got one foot in the air. (Note: I'm NOT drawing the circles and pins)

These circles are linked together with an 'arm' that is pinned in the center of the two circles so that they can't move closer or further apart from each other.

Now, my idea is that if I can apply a constant force to these circles (AND TO THE BODY AS A WHOLE), to roll along the surface (with no sliding - so increased friction) then it will seem that my ragdoll character is 'walking'.

However, I can't get this to work at all.

Does anyone have any advice?

Thank you for reading...

Elphaba
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Animating a RagDoll character to walk

Post by slembcke »

Well, I'll start off by saying that it's a pretty difficult thing to do. Most games try to blend the physics with a canned walking animation. It usually looks like the animation is really what's in control, but physical effects are blended in as well. I expect that would also be difficult to get working well, but the end result is probably more predictable and smoother looking.

For a school project, you shouldn't be afraid to experiment though! You might check out Cortex Command for some inspiration (http://www.datarealms.com/) their characters are controlled by physics like you describe. It can be frustrating to get them to walk sometimes because of it, but it's probably the best implementation I've seen.

For this I would definitely recommend that you check out a copy of the trunk code. I haven't been making any sweeping changes lately so it is pretty stable, and it gives you some extra controls that you can have over the joints. For instance, you can control how much joint correction to apply, what the maximum correction force is, and what the maximum correction speed is. You can also animate joint parameters such as their anchor points or relative angles. That should give you a lot to experiment with.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests