- Home /
Partial ragdoll effect? Need a clever solution, bring your ideas!
First, let me explain my symptoms:
I currently have some fantastic animations done by our animator- including some very cool death animations. The problem is that our game does not take place on a flat plane, and thus- when an enemy dies and goes through this insanely cool animation, it ultimately ends up partially crashing through the world geometry. Which is decidedly not cool looking.
Now, my first instinct was to ragdoll the character when it dies- this would prevent it from crashing through the world since each joint would conform and collide with the geometry of the world. The major downside to this is that I lose the fantastic animations that we have for the death effect. The other downside is that I'm not a huge fan of the ragdoll effect in general.. I think it usually comes off as tacky looking, and has a tendency to glitch out all over the place.
The optimal solution would be one that allowed me to keep the cool death animations, but prevent the character from penetrating the world. The only solution I could think of was to allow the death animation to play right up until the point where the character is going to fall, and then activate the ragdoll. I haven't tested it yet, but I've theorized that it could cause potential issues if one of the joints has already penetrated the world when the ragdoll is activated. This would cause either a 'joint ejection' where the rigid body is popped back onto the correct side of the geometry, or it could pull the ragdoll under the world.. Neither scenario sounds great to be honest.
The Locomotion system uses IK to achieve a similar effect with just the feet.. but I don't know if learning how to write an IK solver is a road I want to travel...
Has anybody tried anything like this before and can give me words of wisdom? Is there some sort of industry best practice that I somehow missed out on in my years of game programming? :P
Great question. I don't have a clear, best practice solution for you, but I find this interesting. $$anonymous$$y theory is that you're going to have to end up not using the death animations, even though they're cool. :( But we'll see.
Hey TESTURE,
"kiss" always works for me, what about this:
just keep moving the character (while it is doing the awesome animation) either up or down so that it always just touches / is just above the surface.
so, make a bounding box of a Better Bounding Box (perhaps made of a few boxes, check for performance)
let the animation bend/whetever the C each new frame, and then move the whole thing so that the "lowest point" (essentially) is always JUST above the surface.
of course, your surface is not flat, it coudl be a steep or irregular hill, so just move it away from the normal.
just do some usual tricks like when I say "normal" use the normal of the "whole average area" the C is "near". (alternately, just do AABB intersecting with the perfect surface, and it's probably fast enough for that too.)
cpould be that simple? the result will be perfect as, over the tiny time of the animation, the C will sort of hug the ground
Answer by niX_BB · Jul 26, 2011 at 12:26 PM
We've been experimenting with an active ragdoll solution which may help here. The idea is to make a character hold a pose or animate while the ragdoll is active.
A demo of our experiment can be found at http://retroepic.com/advanced-ragdolls/
Our experiments were prompted by the Wolfire Games blog post about their active ragdoll system. http://blog.wolfire.com/2011/01/Overgrowth-a114-video-changelog
=Update=
We have released the code for our experiment in the hope that the community may find it useful. The source can be found in the post on our site. Please note that the code is a rough proof of concept and functions more like the frozen ragdolls shown on the Wolfire blog. http://blog.wolfire.com/2011/01/Frozen-ragdolls
If anyone would like us to implement a more optimised version please get in touch.
this is a pretty interesting solution.. i've done some searches for 'active ragdoll' but the only thing that comes up is Overgrowth. Do you know if it's based on a whitepaper of some sort, or if there's any freely available information on the concept?
Is there any technical information you're able to share on what you guys discovered?
Once we saw the video we decided to try our hand at a solution and got some promising results. We haven't researched it much further than that, but the tech seems like a good fit for your problem.
Our version is not very complicated but it does require some set-up. In its current form it's not a simple drop in solution, but if you're happy with tinkering we can provide you with the source. Alternatively if you provide us with the assets we can set up a test for you to see if the result is what you are after.
I'd actually be very interested in this. I have a project where it's almost completely centric on one single ragdoll character, and having it be able to animate mid-flight to "prevent pain" would be a great touch. However, I'm still wondering if I should just animate the ragdoll via scripting to achieve this.
@niX_BB I don't $$anonymous$$d tinkering and passing on any improvements I can think of as well.
I will attach the source to my answer later today, hope it helps.
Answer by ThomasQ · Jul 26, 2011 at 05:24 PM
Try creating the ragdoll, just before the dying animation hit's the floor.
I mentioned that in my original post- the problem is that if the ragdoll is partially colliding when it is activated, I'll get glitching while the rigidbodies try to figure out which side of the polygon they belong on.
Answer by Alexandros1313 · Feb 06, 2013 at 06:04 PM
hi! First of all, congratulations for your job. Very Useful! I've downloaded your code and testing it in a test project. I'm currently working in Unity3D 4.0. Instead of using single animation clips, I'm using Mecanim with an humanoid character. The ragdoll system works great, but sometimes, when I activate ragdoll, my character falls in the deep... What could be the cause?
Your answer
Follow this Question
Related Questions
how do i blend a ragdoll and a characters animation 1 Answer
Enemy Ragdoll help 1 Answer
Using mecanim for a character on a motorbike 1 Answer
Ragdoll on Only Part of a Model 2 Answers
Can the animation editor create local rotational data? 3 Answers