Spring-based character physics.

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
lodi
Greenskin
Posts: 103
Joined: Sat Jul 24, 2004 7:06 pm

Spring-based character physics.

Post by lodi »

(This is somewhat off-topic, so mods please move this around as necessary.)

I'd just like to start a discussion about physics-based animation. This isn't particularly ogre-related, but I thought I'd just kick some ideas around.

I found this thread (http://www.ogre3d.org/phpBB2/viewtopic. ... ht=ragdoll) that talks about the general idea (second post from the bottom).

So the principle is like this:

* Regular skeleton tied to an ode sphere/capsule and collided against the world as usual (keeps the model above the floor, on the outside of a wall, etc.)
* Ragdoll constructed to resemble skeleton.
* Skeletal animation suggests a per-frame target for ragdoll geoms.
* Ragdoll experiences fairly stiff spring forces to try and align with the precanned animations. In the absence of anything to collide against, ragdoll should look like a plain old skeletal anim (might lag behind a tiny bit and be a little wobbly, but should be okay overall?)

Will this work? In the absence of anything to collide against will this look okay or is there something I'm not taking into account? (Gravity?)

Assuming it's good sofar, the system confers two advantages:

1) You can use a tighter bounding capsule for characters, since the ragdoll automatically won't let arms protrude through walls and such.

2) Character can react to mild forces believably. A shot to the shoulder can be expected to rotate the torso a little, throwing off aim in a believable manner, etc. (Would have to avoid excessive forces to the legs, otherwise the character would look like he's floating while his legs struggle to realign themselves).

And the final feature would be like this:

* Sufficiently large variations in the 'torso' geom would feed back into the overall translation/rotation of the model.

So shooting directly at the chest would knock the whole body back a bit (feet sliding back, but nothing worse than what you normally have in games), and rotate the head/shoulders slightly backwards as the torso geom recoils.

Thoughts?
eyevee99
Greenskin
Posts: 125
Joined: Tue Jul 22, 2003 11:28 am

Post by eyevee99 »

Are you basically saying you want to blend ragdoll like physics with animation?
Cheers
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

I haven't tried it myself yet (although I will when I get a chance), but it should work. There are some cool possibilities too like getting shot in the arm could disable the constraints tying your arm argdoll to the animated skeleton, so your arm flops around like it's broken as you run around. Turn off all the constraints and your character becomes a true ragdoll. Or turn off the leg and torso constraints so you go partial ragdoll, but your arms and head continue to animate (like a wounded enemy waving for surrender or trying to crawl away, but still using ragdoll).

The main problem is if part of your body gets stuck on something, your ragdoll body could be left behind. But that could be handled by checking the error factor between ragdoll and animated skeleton and popping bones back into place if they get too far away.
User avatar
Sputnick
Greenskin
Posts: 110
Joined: Wed Sep 08, 2004 11:49 pm
Location: Lausanne, Switzerland

Post by Sputnick »

I tried similar concepts. It's working.
The main problem is the shaky aspect of spring model if not damped.
If the spring factor is too small, your ragdoll won't follow your skeleton animation and if is it too large, your model will shake.

The other issue is I guess the time consumption for collisions. Do you need collistions all the time on the entire ragdoll ?
Physics demos are nice, but there are usally a few things to collide on and nothing else to compute which is not the case in a game.

Anyway, my next project will be focused on automatic generation of skeleton animation based on some goals and rules. I shall try the spring model idea.

- Sput
T.T.H.
Gnoblar
Posts: 14
Joined: Tue Jul 06, 2004 5:33 pm
Location: Regensburg, Germany
Contact:

Post by T.T.H. »

Sputnick wrote:I shall try the spring model idea.
/me blushes

If you get anything going (or not) with it, please drop me a line.

T.T.H.
lodi
Greenskin
Posts: 103
Joined: Sat Jul 24, 2004 7:06 pm

Post by lodi »

Sputnick:

It gives me much confidence to hear that someone already went and (successfully) did it! Keep us posted on your project.
Post Reply