Balancing a character

Balancing a character

Hi everyone!

First of all, my intention is to create an avatar which is able to stand on its own and walk but at the same time is affected by the laws of physics. As an example, the character should be able to bend forwards and fall over after reaching the critical point. The joints should be represented realistically (type and angle) and move according to the applied forces to balance the character.

My first idea was to do it with a ragdoll but i cant find any literature on balancing ragdolls.

How it is generally done in games? Is it done anyway in games or is it always just animation?

Any suggestions how to do it?

Regards, Konstantin

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Konstantin,

If I'm understanding you correctly, there isn't a built-in way in Havok to accomplish what you want. One common way of achieving something similar is by having a ragdoll powered by an animation. Given the constraints on the ragdoll, it won't always be able to match the ragdoll perfectly with the animation, so you can then use the delta between the animation and ragdoll to determine the 'critical point' like you described. In the demos, take a look at Animation -> Api -> Ragdoll -> Blend Test -> B 6 Keyframe fixed (HAVOK_SDK_ROOT\Demo\Demos\Animation\Api\Ragdoll\BlendTest\BlendTestDemo.cpp). One nice side-effect of this method is that your character would then be able to interact with other physics objects in the world.

Here is an overview of how it would work:

  1. Map the high res skeleton (the animated skeleton) to the low res ragdoll skeleton
  2. Create an array of the low res bones and convert them to local space
  3. Pass that array of bones to the driveToPose static function of either hkaRagdollPoweredConstraintController or hkaRagdollPoweredChainController (read the docs on the differences between the two)
  4. Keyframe the root bone (we want to be sure this always matches the animation)
  5. Step physics
  6. Take the new ragdoll bones and map them to the high res skeleton (this is what you'll use to actually skin/render your model)

But again, Havok doesn't have a built-in way to procedurally generate animations for moving a character. You usually can't escape entirely from the use of user-generated animations or mocap data, so you'll most likely want to use a system like Havok Behavior which gives you the ability to create complex state machines for blending animations together based on either AI or user input.

Hope that helps!

--Joel

Leave a Comment

Please sign in to add a comment. Not a member? Join today