Game Development Community

dev|Pro Game Development Curriculum

Tokamak Rag doll integration progress

by Duncan Gray · 05/03/2009 (9:37 pm) · 7 comments



The previous video just showed the player going into ragdoll mode and falling down using the ragdoll physics. I have now added impulses forces from projectiles and explosions. I'm trying to keep it relatively realistic with not too much Hollywood going on but adding just enough fiction to create a believable effect.

Once again the weapons are place holder objects. The cursor in the center of the video is an artifact from the video capture program I used and not part of the game.

The video begins with two hand grenade effects. The second grenade was done at the top of some very busy stairs to test some worst case situations with the the ragdoll colliding against many stair pollys. No problem to Tokamak. The grenade killed both players and you will also see the death-camera kick in which is an effect which pans the camera out to a distance while tracking the ragdoll location. The death camera also does collision checking before selecting and end location to pan to.

I put in a datablock field in projectiles for the weight of a bullet and used that, along with bullet velocity to calculate an impulse force applied to the ragdoll at the point of impact. This alone does not have much visible effect so I scaled it up by ten in order to get the bullet impact to at least knock the player in the direction of impact. At one point in the video you can see the players legs being shot out from under him.



Turn and twist when using WD and WA keys

Some players like to use WA and WD keys to get diagonal player movement which can create some weird player animations in TGEA. Here we rotate the player body 45 degrees and twist the upper torso back so that the player runs diagonally but faces forwards.



Twisting and bending

I modified the player class to get direct control of the bones and used that feature to let the player twist his upper torso a bit in either direction before forcing the whole body to rotate. Also, when looking up and down, we don't just use a head animation, but bend the player spine in a natural manner to better facilitate looking down and up. Watch the player shadow to get a side view of the bending. This system completely replaces all the head look animations.



This is obviously work in progress and things can change.



#1
05/04/2009 (2:36 am)
great progress... :D keep it going guys
#2
05/04/2009 (3:27 am)
Oh, I really like the Turn and Twist and Twisting and bending!
#3
05/04/2009 (6:55 am)
Agreeing with Tek0, looking good. Ragdolls look awesome as well!
#4
05/04/2009 (7:28 am)
The T&T and T&B is a great idea!
#5
05/04/2009 (5:43 pm)
Looking good!
#6
05/05/2009 (5:40 am)
Can others see the latter two videos? The first one's fine for me, but the two others just say 'an error occurred, please try gain later.'

Anyway, the ideas sound great, can't wait till I can see them in action. This might be a solution to the same problem in my game - I was already planning to implement torso twisting, but I didn't think to use it for strafing movement.

Ragdolls are looking nice, but a little rigid - like when the character goes into a sort of 'sitting pose', limbs locked. Seems like the limb constraints could be a little looser (I'm assuming that's the problem). Or, force needs to be applied when the constraints are hit.

Oh, and some random impulses to different parts of the body from the grenade explosion wouldn't go amiss either ;)
#7
05/05/2009 (5:23 pm)
Setting the constraints is a PITA requiring much trial and error because you also have the situation where the thigh collision box collides with the calf collision box thereby blocking the bend at that point. I set the collision boxes shorter than the limb to give me some extra bend space and you could also use a smaller radius on the collision boxes but then other visual problems occur. The ragdoll can also get hungup or snagged at the joints due to the space left between the limbs to allow for bending.

Early on I created code to draw the ragdoll as seen here while I was trying to match ragdoll transform to bone nodes. You can see the gaps between limbs and the purple balls representing joints.

www.ultrabizz.com/biz/progress.jpg
Ideally one should create a GUI to show the ragdoll collision boxes, joints, constraints and the realtime effect of tweaking them. But whose got time for that...

I'm actually using capsule shaped collision boxes which reduce the snagging at joint problem as well as allowing me a smaller gap at the joints before joined limbs collide and block the bending. I just drew boxes because its easier than drawing capsules.