Physics activated animations

Please don't post Bullet support questions here, use the above forums instead.
Eltharyon
Posts: 13
Joined: Wed Jun 07, 2006 12:55 pm

Physics activated animations

Post by Eltharyon »

Hi again.
Internal discussion about the requirements for future physics systems continues and I've been asked to bring forth yet another question to the community.

We believe that physics limited animations such as seen in endorphin (http://www.naturalmotion.com/) will definitely appear in computer games soon and that they'd be a very interesting feature to have.

If you are not familiar with endorphin/naturalmotion here's a quick rundown of the feature we're interested in:

A character moves his hand towards a wall (animated). As the hand strikes the wall the animation continues to play, but the hand is halted or bounces back from the wall, all the time the animation continues to play.

A first preliminary session thinking about the problem led us to believe this wouldn't be all that difficult if directly implemented into the physics system. Effectively one would need to have physics bodies which constantly strive towards a certain point/orientation (the current animation key-frame) with a given force.

I've got three questions:

1. What do you think of a feature like that? We think it'd be extremely useful, especially if combined with appropriate callbacks. (Think sword hits wall and attempts to pass through at a high velocity; sword bounces back and character is disarmed)

2. What do you think about the feasibility of such a feature? Do you think bullet could use it?

3. What do you think about the suggested approach via physics bodies striving towards an animation position? Is there a better way?

I could imagine I might be given some time to work on this, but before I do start I'd very much like to hear everyone's thoughts on it.


Cheers,

Robin
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Physics activated animations

Post by Erwin Coumans »

Sure, animation and physics/ragdolls will blend more together. This, and deformable ragdolls/environments (Finite Element Method based and tech like Pixelux' DMM http://www.pixeluxentertainment.com ) and SPH fluids will be very common soon.

The most promising approach in my opinion:
1)-setup a ragdoll
2)-use a inverse kinematics system
3)-calculate safe positions using collision detection (and balancing a center of mass ultimately)
4)-blend in animation (either velocity or positional based)
5)-use IK to calculate target positions/velocities based on step 3 & 4
6)-use motors to power the ragdoll joints in a way that drives the joints to match IK in step 5

Someone is working on a generic D6 constraint for bullet, including motors / limits. This is the first step that can allow Bullet to do such things. But the requirements on the motors/joints are very high (in order to match the IK nodes in 1 frame)

(moved the topic to 'general' as it's not really Bullet specific.)
Erwin

Eltharyon wrote:Hi again.
Internal discussion about the requirements for future physics systems continues and I've been asked to bring forth yet another question to the community.

We believe that physics limited animations such as seen in endorphin (http://www.naturalmotion.com/) will definitely appear in computer games soon and that they'd be a very interesting feature to have.

If you are not familiar with endorphin/naturalmotion here's a quick rundown of the feature we're interested in:

A character moves his hand towards a wall (animated). As the hand strikes the wall the animation continues to play, but the hand is halted or bounces back from the wall, all the time the animation continues to play.

A first preliminary session thinking about the problem led us to believe this wouldn't be all that difficult if directly implemented into the physics system. Effectively one would need to have physics bodies which constantly strive towards a certain point/orientation (the current animation key-frame) with a given force.

I've got three questions:

1. What do you think of a feature like that? We think it'd be extremely useful, especially if combined with appropriate callbacks. (Think sword hits wall and attempts to pass through at a high velocity; sword bounces back and character is disarmed)

2. What do you think about the feasibility of such a feature? Do you think bullet could use it?

3. What do you think about the suggested approach via physics bodies striving towards an animation position? Is there a better way?

I could imagine I might be given some time to work on this, but before I do start I'd very much like to hear everyone's thoughts on it.


Cheers,

Robin
Antonio Martini
Posts: 126
Joined: Wed Jul 27, 2005 10:28 am
Location: SCEE London

Re: Physics activated animations

Post by Antonio Martini »

interesting papers on the subject are:

http://www.cs.ucla.edu/~pfal/papers/cag01.pdf
http://graphics.cs.ucr.edu/papers/zordan:2005:DRM.pdf
http://graphics.cs.ucr.edu/papers/zordan:2002:MCS.pdf
http://www.city-net.com/%7Eamandel/gdc/thesis.pdf

the main parts of a physics based animation system would be:

1. blending in/out from animation/physics

2. Isolated behaviors creation(balancing, catch fall, grab etc...)

3. behaviors transition(when and why a set of compatible beahaviours are enabled)

regarding single behaviors, if you are using IK you may still want some kind of animation playback, see for example the "Go to Foetal Position" behavior of Endorphin. So control in both state-space and cartesian-space is required.
vicviper
Posts: 21
Joined: Thu Jun 01, 2006 9:55 pm

Post by vicviper »

What about this way of doing animations with physics:

1- setup a physically driven ragdoll
2- create a clone of the skeleton of the ragdoll in step 1 (no physics)
3- animate the skeleton of the "cloned ragdoll"
4- based on the differences in position & orientation of the physics ragdoll and the animated ragdoll, apply forces to the physics ragdoll

step 4 is the tricky part, I have no idea how to do it... probably with impulses.

Another problem I see is that, if the ragdoll is a full physics system, it can give some trouble with the feet touching ground while animating it, if the character is not animated correctly (like when the feet do not stick to the ground while walking) it can lead to weird results
mewert
Posts: 52
Joined: Sat Oct 08, 2005 1:16 am
Location: Itinerant

Post by mewert »

Creating natural looking animations with a reasonable performance/data-size cost is tricky, to say the least.

There seems to be a sort of triangle of major techniques.

Space-time constraints
|\
| \
| > Animation data-base
| /
|/
Controllers

Space-time constraints are pretty awesome and produce very good results, with very little in the way of off-line data/resource requirements. Unfortunately, I can think of few physical simulation algorithms that are more computationally demanding.

Animation database techniques try to match physically constrained motions to a blend of best-fit data from a large data-base of animations. This is clearly the most data/resource intensive approach, but animators have the best control over these. Your results are dependent on how good your data is.

Controllers are essentially what you've been talking about, and what endorphin uses. You have specialized controllers that attempt to achieve certain high-level goals. These have the lowest cost as far as processor time and data usage. IMO the results tend to look a bit brain-damaged.

None of these techniques alone solves "the problem" so most research seems to be on combining various amounts of these three major techniques.

Anyways, it's fun stuff!