breaking a ragdoll (dismemberment?)

breaking a ragdoll (dismemberment?)

Good day people!I now have a fully working ragdoll with state machine, animation blending and animation weight controlling.so far everything is good and thanks for all the helps~~!I can make my character (robots) move, jump, double jump, boost, shoot, facing a target (IK solver), receive damage, explode, die and revive.but now I'd like to be able to break the joints.I've read the dismemberment demo and it looks like it's dividing the ragdoll into parts then store the parts into seperate hkaRagdollInstance.that means I'll have to break my ragdoll into different hkaRagdollInstance (modify the member variables of my ragdoll class) and load the appropriate meshes for'em.would there be an easy way to just remove or disable the constraint? so the forearm will not be driveToPosed and fall onto the ground?I've also noticed the Breakable property in the 3ds max.If I turn that to true and assign some threshold, it then crash after the m_loader->load.the m_ragdollInstance shows a NULL.also, I made my ragdoll to perform a punch move, but since it's using the driveToPose, the punch is so soft that it cannot push the target away.solving it using setPoseModelSpace just for the forearm and hand is all I can think of...wonder what's the normal approach to do a melee attack?Thanks for the help!Regards, Hiro

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

Hi Hiro,

This sounds great! I'd love to see/play with a demo whenever you have it ready.

The hkaRagdollRigidBodyController (and indeed the alternative hkaRagdollPoweredConstraintController) work by driving all the bones of a ragdoll instance to the given pose.

If you want the broken body parts to drop off you will have to turn off the relevant constraint, but just turning off the constraint won't stop the controller from driving the broken pieces to the input pose.

So if you want to break your ragdoll I'd say you'll have to do something similar to the dismemberment demo.

The breakable property in the content tools (eg for 3dsMax) is only used in Havok Destruction, which is a commercial product that doesn't come with the PC XS (free) license.

As for fixing the soft punch, you might try two things:

1) experiment with setting some of the ragdoll rigid bodies to be keyframed,
hkpRigidBody::setMotionType( hkpMotion::MOTION_KEYFRAMED ... )
This means that some bodies, say the fist, could be moved along a pre-determined path by setting their velocities, and would ignore any impulses from collisions etc.
This is off the top of my head and I haven't tested the idea, but you can play around with it and see!

2) apply extra impulses to the 'punched' objects.
You'll want to tune the reaction of the other character/object to the punch for gameplay purposes anyway (normal punch, powered-up punch etc). So I'd suggest maybe using a contact listener on the fist to add impulses to the other body on impact.
Again, this is just an idea so you'll have to experiment.

Hope that helps!

Cormac

Hello Cormac!well XDit's acturally not that great though. functioning but still lack of polishing.And still full of testing stuff... XPit's quite a bit of work for a single person.effects like gunfire, sparks, fireball, explosion (with bloom), smoke, etc... and those animations...but soon, very soon, I'll need to use this demo for my job hunt.there's one more feature I'd like to add though, a timeline based (enemy) wave (and AI) editor.don't think I've got the time, have got other school projects too.once I'm settled, I'll polish it more then port it to Android, with cleaned up codes.(hopely, to release a beta online and leave some notes in a blog)I'll be doing something unique this time XDThanks for the advise, I'll be sure to try those out!the breaking ragdoll parts...say, if a ragdoll has a missing part. e.g. left forearm and its fist.the number of the bones of a ragdoll is lesser than the number of bones of the animations.will I hit a breakpoint? or will it still be sweet?And, ah... I've just recalled one more problem I've encountered.when my robot is in dead state. I call no driveToPose, and it falls alright.but when I revive it, thanks to its auto-facing-camera ability!it spins fast, and sometimes my legs will stuck with eachother (cause the driveToPose is trying to figure out the shortest path I think).I'll have to do some jumping to loosen it up.I try to modify the collision filter during the wake-up state.(I think people not gonna notice, that a body part went through another in a short period like that)it helped a little, but not always.I've also try checking the "stress" value of a ragdoll.so if max stress is greater than 1300. I'll let my body parts to not to collide with each other.hoping they will slide to where they should be.hnnnn...... still testing with this part.Regards, Hiro

The case where the ragdoll has fewer bones than the animation skeleton ahould be ok as long as you set the m_boneToRigidBodyMap of the ragdoll instance.

For the leg-tangling problem with getting up I think there's no simple solution.

What game developers usually do is have a getting-up animation, and drive the 'dead' ragdoll towards the starting pose of this before blending in the animation.
The starting pose will be some lying-down posture, and they usually have 2 animations - starting face up and starting face down.

In the absence of extra animations, I think your collision filter solution is fine.
Body parts passing through each other momentarily is less noticeable than legs and arms getting tangled with each other :)

Cormac

Login to leave a comment.