Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » 'ragdoll' physics

This thread is locked; no one can reply to it. rss feed Print
'ragdoll' physics
James Howard
Member #262
April 2000
avatar

Does anyone know of any tutorials or documentations available about ragdoll physics? I know I won't be able to incorporate it into my game, but I'm just intrigued on the math etc behind it. I've googled and couldn't find much apart from a few pages which had the words "max payne 2 has awesome ragdoll physics!" in it.
I did find this which I found quite entertaining (check out the jumping video!)

----
Check out my final year university project 'Warring States', a 3-D multiplayer RTS game:
http://warring-states.blogspot.com/

Paul Pridham
Member #250
April 2000
avatar

Google for "rigid body physics."

Billybob
Member #3,136
January 2003

As far as I understand, all ragdoll physics is is applying real physics to your models. You have physical properties for your "objects" and then start applying physics. Right? I suppose you have to specify how bendable lines are on an object. A box wouldn't bend at all, but a rotted matress, for example, would bend pretty well at each vertex. For your player models you apply the physics to the skeletal system. The biggest problem is getting the physics right ;) gdmag spent something like 4 articles just on pooltable physics. Obviously it wasn't stupid pool table physics, it built up to friction from the table, sliding, rolling, gravity, bouncing, hitting other balls, hitting the table's edge, forces from the stick, and everything else required to make it a real pool table as far as most people would be concerned. Thing is, that's only sphere physics, you have to deal with complex models in games.

james_lohr
Member #1,947
February 2002

I've done quite a bit of messing around with 'jelly' dynamics as well as rigid body dynamics.

I would imagine you could achieve ragdoll physics by combining the two. -certainly rigid body dynamics alone won't be enough.

Of course all the stuff I've done has been in 2D although adding a third dimension (i.e. a third component to vectors) is much easier than you would have thought.

The other thing, which is illustrated perfectly by your link, is that ragdoll physics, like the name suggests, is best for just flopping around. Trying to make something walk / move sensibly by applying impulses to it's body parts is not easy... heh that jump video is very funny ;D.

Korval
Member #1,538
September 2001
avatar

Quote:

certainly rigid body dynamics alone won't be enough.

It is for us. With proper constraints (so that elbows don't bend backwards and so forth), that is.

Billybob
Member #3,136
January 2003

I thought both videos were funny(3rd is dead link). I also tried the demo programs, anyone try those? The evolution one runs really fast on my computer, so it isn't much fun. The first ragdoll demo is really funny cause I added like 20 dudes and they started to go through the floor and hang of it, and even fling each other off it cause there was so much wiggle. Funny stuff. Medieval demo didn't do to well, I had big control problems, and the catapult was everywhere...literally.

gnolam
Member #2,030
March 2002
avatar

Here's how IO Interactive did it in Hitman:
http://www.ioi.dk/Homepages/thomasj/publications/gdc2001.htm

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Zaphos
Member #1,468
August 2001

The article gnolam linked to is quite interesting; GB and I are using it in our slowly-advancing team project. Definitely check it out for what seems to be a relatively simple but very efficient implementation of ragdoll-type physics.

As an aside, I believe that "Jelly Dynamics" is a subset of what (at least that article considers to be) rigid-body dynamics.

Johan Halmén
Member #1,550
September 2001

I watched the jumping guy. Funny, just needs some sound effects: "Ouch!", "Uh!", "Ugh, that hurts!", "Stop it!"

When I tested Sodaplay, I started thinking about a 3d version of it. The jumping guy is something like that.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.

Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.

gillius
Member #119
April 2000

I wrote a project in C++ and Direct3D that was a pool simulation I did for a class project. I physically modeled almost all aspects of a pool game. I took into account hitting the ball starts it sliding, then friction on the table causes it to roll (thus slowing down the ball as linear motion turns to rotational). So it properly implemented spin and english from the shot as well as frictions. I only missed a couple things though:

  • rotational effects in collisions, if the ball is spinning when it hits the cushion or another ball, the trajectories will change, and rotation will be transfered to the other ball.

  • I assumed the balls would never leave the table, i.e., the problem was only considered in 2D.

I have source code, if you'd like to see it, PM or e-mail me (See sig/site)

Gillius
Gillius's Programming -- https://gillius.org/

Billybob
Member #3,136
January 2003

gnolam: I started reading that article, it's really cool. I like the idea of the Verlet system and stuff instead of dealing with velocity. The article is also easy reading. They don't slap you with difficult math(and when they do they define it. They even define stupid things just in case like vmin vmax). I recommend that article to everyone who has time to read it.

Go to: