This project has moved and is read-only. For the latest updates, please go here.

Ragdolls that can Balance and get back up (Project In Progress & Video)

Topics: Developer Forum, User Forum
Mar 31, 2010 at 10:09 PM

Hi everyone,

I'm in the middle of my dissertation investigating ragdolls which are aware of their where they are and balance themselves as well as get back up if they fall over, much like NaturalMotion's Euphoria/Endorphin, instead of lifeless floppy ragdoll physics.

I've uploaded a video to YouTube of my project so far and I'd be really interested to hear what you all think?  Feedback and is very much welcome and if you've got any ideas of what could be better / what could be added to it I'm all ears!  (Plus it will give me more to write about on the dreaded write up! ;o)   )


The ragdolls, you might notice, are taken from the Simple Sample (big thank you for whoever made the Ragdoll class!).  I had a go at creating my own, but I just couldn't get the joints right.  Basically, it looks at the TotalRotation of the ragdoll.  If the ragdoll bodyTorso goes past a certain point or is about fall over, then a torque force is applied to the feet and thighs in the opposite direction.  This keeps it standing and able to stay balancing if nudged.

If this force isn't enough to keep the ragdoll standing, then it will go past "a point of no return".  Similar to NaturalMotion's Euphoria, it has a balance threshold before it gives up trying to balance and instead tries to catch its fall to protect itself (just like you and me when we fall over).  If, for example, the ragdoll falls over to the right, it will put its arm out (another torque force) to catch the fall.  The opposite arm (using another torque) will throw its arm to throw its weight to get back up.  

Once the ragdoll has done this, it will start to balance its feet again to stay upright. 


I've taken a real interest in this, so it's certainly something I'll be continuing after I've finished my write up.  If I can get it right, I'm thinking about using it in games to make it easier for animation.

I'll be doing a big thank you when I do my write up to you guys.  Even though a physics engine is such a complex thing, Farseer is so accessible and simple to use.  It really is fantastic! 


Thanks very much,


Apr 1, 2010 at 8:29 AM

Very nice!

I tried a while ago, to create a walking Ragdoll character, but then I abandoned it. Maybe I should go back to it and try your approach for balance.

Apr 7, 2010 at 1:57 AM


Thanks very much for your feedback!  I'm glad you liked it! 

Once I've finished my dissertation (write up and demonstration) I'm very happy to release the program along with the source code.  It would be great to see how far this could be taken by those who are interested with this sort of thing.



Jun 3, 2010 at 6:55 AM

Hi Alan,

How did you get on with this project and did you publish your results?  I'm interested to see the results.

Jun 6, 2010 at 6:27 PM

Hi Beringela,

I'm still waiting on results for my dissertation.  We've been told they're available at the beginning of July, as well as the final marks for the Degree (this was my last project for my degree).  But if you're interested I can put the results on here.

I've still got a few exams to go, but once all my University work is finished, I'll put the program online, as well as source code, so those interested can have a play about with it and maybe even help develop it further.



Jun 7, 2010 at 1:25 AM

Let the ragdoll dance commence! hehe

I created the Ragdoll class - not really proud of it, but great to hear you could use it. Nice work on getting the ragdolls to balance and get up again. It also looks like a good foundation for a funny game.

Jun 12, 2010 at 1:55 PM

Thanks Genbox! The ragdoll class was a real life saver.  I spent a while creating my own ragdoll, but I just couldn't get the joints right, and was running out of time before I needed to start my write up.  Implementing your ragdoll class really sped me along, and it works great!  Technically, if someone else makes their own ragdoll, as long as it has the same body sections as your Ragdoll (so two bodies for the limbs, one torso body etc) then the code should still work for that ragdoll to make it stand.  Then again, I suppose it all depends on the mass of the bodies.  I might add a bit of code to make the force of the standing/getting up behaviours proportional to the mass of the body.  And gravity thinking about it...

I'm doing a bit of refactoring at the moment, moving things into their own classes and such.  For some odd reason, the Debug and Release .exe's will only open if the computer has Visual Studio on it.  I wonder if it needs .NET to run?

Either way, for those who are interested in playing around with the code and program, would you prefer to download it from here on CodePlex or on Google Code?