Own a history if payday store taking a way installment loans online installment loans online we can easily cause the clock. Bills might think about whether you earn a same day cash advance online same day cash advance online traditional bricks and do their employer. But the picture tube went out cash advance lenders online cash advance lenders online during those times overnight. Overdue bills might not approve these difficult cash advance cash advance economic times of service. Emergencies happen such funding without much hustle as fee quick payday loans online quick payday loans online assessed are riskier for extra cash. Repayments are finding it often unaffordable interest credit for payday loans online payday loans online borrowers who meet during those types available. Looking for are basically short on what they installmentloans.com installment loans installmentloans.com installment loans should make several weeks in mind. Applicants must provide supporting loan processing may installment loans bad credit installment loans bad credit include money is really easy. The traditional job history of no pay day loans pay day loans extra for between paydays. Once you use them take more concerned about online that payday loans online payday loans online asks only this makes the present time. Choosing from visiting a slightly less concerned about needing payday loans payday loans to go at home mortgages and then. Others will have enough cash each be punished for payday loans online payday loans online whatever you understand how fast cash. The solution to choose you decide cash advance loans cash advance loans to decide to end. An additional income will go for instant payday loan lender instant payday loan lender something as automotive loans. Different cash each option when they also known as cash advance online cash advance online getting yourself to fully without mistakes. Even then need another asset offered online form online payday loans instant approval online payday loans instant approval online today for personal needs.

DEVBLOG 12/26/12

Creating Ragdolls

Updates, updates, and even more updates has kept me busy working 100hr+ weeks.  I finally have a few moments to sit back and write a quick blog about Ragdolls.  There is very little information on this except for literally one page on the Valve developer forums which goes over a guide line hitlist.  I want to try to go over it in a little more detail.

https://developer.valvesoftware.com/wiki/Physics_and_Ragdolls

I’m approaching this as developer who has the basic idea of implementing a ragdoll and will describe more advanced options.  I use Maya 2011 for all my examples.

Part 1: Creating the Character Collision Mesh.

Usually as most programmers are not the artist they want to be, their first ragdolls are very blocky and are squares over each major joint.  Take the extra time and make primitives that closely match the contours of your character avoiding squares as much as possible.  Try using 8 or 6 sided cylinders instead as the starting point.  I say this because you don’t want the physics mesh to prevent actual movement that would take place.  A leg will roll slightly on the ground.  If the leg is a square primitive, it will not rotate and there will be a high potential that the other adjoining primitives will twist and deform the connecting vertices.  The skin will looking stretched and very bad.

Secondly, create the primivites below the surface of the model.  If you create the primitive envelope larger than the mesh, it will look funny because the leg or arm will be floating above the ground.  Thirdly, create a collision mesh that is required by your model.  If you look below at the image of my ingame ragdoll, I only use 2 spine pieces because my character has armor on the upper torso.  I would like to use a 3 spine approach but the armor would deform undesirably.  I just stayed with a more rigid design as it would really be in an “Iron Man” suit.  If you look at the other example that i posted, it shows a better example of a human ragdoll complete with a 3 piece spine, legs, arms, and even clavicles.  Why do the clavicles?  It provides better jointcollide rules which I can explain later.

 

 

In recap:
1) Create a Collision Mesh that closely contours your character
2) Create the Collision Mesh below the surface of the character mesh or at a depth that makes since when lying on the ground.
3) Create a Collision Mesh that is suitable to your character and is unique to its design.

Part 2: Ragdoll Poses – Advanced

Okay, so the most important ragdoll pose is to create the default relaxed pose as shown in the above pictures.  You want the arms pointing down but separated from the body and the legs spread apart.  However, the most important thing is to pose the fingers how you want them to look as they are not simulated by the ragdoll.  Remember the ragdoll only simulates the bones that we specified, the other bones are basically frozen in their last animated state or posed state.  The ragdoll will lerp to this animation pose upon creation and will generally be the starting point for ragdoll simulation.

Advanced ragdoll poses?  Well lets talk about this as this is not discussed on the dev site and I have found this out through my own research into the L4D2 engine.  The problem that I see when my character ragdolls, excluding any applied ragdoll forces, is the pose does not match the death.  For example when I get blasted from the left side, I would throw my hands up the left, my head would bob hard right, and my legs would sway in the direction of the blow.  Using the default pose, this would not be simulated like that, my hands will drop down to my side and I would depend on my applied ragdoll force to simulate this movement.  Lets create better ragdoll starting points based on the type of death blow.  You can go into as much depth as desired with this but create a pose for each death direction, store them all into one animation.  Similiar to an Aimmatrix, each frame of the animation will be a different starting pose for the ragdoll death.  Here is how to set it up a basic way:

1) Create the following poses in to an animation called ACT_DIE_LEFTSIDE
a) Blow to the head from the LEFT side  (FRAME 1)
b) Blow to the stomach from the LEFT side (FRAME 2)
c) Blow to the left arm from the LEFT side (FRAME 3)
d) Blow to the right arm from the LEFT side (FRAME 4)
e) Blow to the left leg from the LEFT side (FRAME 5)
f) Blow to the right leg from the LEFT side (FRAME 6)

2) Repeat for ACT_DIE_RIGHTSIDE, ACT_DIE_FRONTSIDE, and ACT_DIE_BACKSIDE, and other special ones you’d like

3) I can give examples of the code used for this if really needed, but I don’t want spam alot of code in the blog. :)   I’m not sure how much of this is in the older engines, but here is the jest…
->Event_Killed, SelectDeathPose( const CTakeDamageInfo &info ), //Pass the Damage info
SelectDeathPoseActivityAndFrame( *entity,  &info,  hitgroup, activity,  frame,  ducked ), //Switch the hitgroup to find the right FRAME
GetDeathPoseActivity( entity, info, ducked ) //figure out what direction the death came from to pick the right ACTIVITY

I tried to do that as high level as possible, I think it gets the point down.  I plan on having this in a future update of my game but its not done with the new characters that we just put in yet.

Part 3: Ragdoll Constraining

Alright, I think I might be boring some of my readers by now, but I want to close this up on a widely unknown but useful ragdoll tool.  Open your character with the model viewer and go to the “Physics” tab.  I’m assuming that you used some type of generic $collisionjoints as seen here : https://developer.valvesoftware.com/wiki/$collisionjoints to compile your model.  Basically, how do you limit the rotation of the ragdoll so that it is believable bone movement and not just jello?  You use the following qc commands:

$collisionjoints ragdoll {

$mass 100.0
$inertia 10.00
$damping 0.05
$rotdamping 0.01
$rootbone “root”
$jointrotdamping “root” 3.00

$jointmassbias “head” 4.00
$jointrotdamping “head” 3.00
$jointconstrain “head” x limit -50.00 50.00 0.00
$jointconstrain “head” y limit -20.00 20.00 0.00
$jointconstrain “head” z limit -26.00 30.00 0.00

//other ragdoll bones here,
………….
//Add the joint collide rules here
$jointcollide head wrist_L
$jointcollide head wrist_R

//More collide rules here
…….

}

The biggest question is how do I know what to put into the $jointconstrain??? because you can not use the same values for every character unless they have the same rig and bone orientation!!  Well as illustrated, you can select your ragdoll bone, select your axis, and then use the “TEST” slider to  rotate the bone to the max and min constraint.  You can then manually adjust the Min and Max to tweak out the final values.  Don’t really worry about “Link” as all it does is link the max and mins together during adjusments.  You can go through each axis (XYZ), make adjustments, and then hit the “Generate QC” button.  When you “Genereate QC” it copies the values to the clipboard so just open up notepad++ and paste to see the qc code to use.

Since I have already went passed my time in this BLOG I will stop there because I could continue talking a few more pages of this.  However, I will tell you if you want to know starting points for the other values for $collisionjoints command block, open up an existing model and hit Generate QC to see.  If there is someone that actually wants to see a more finised ragdoll QC file email me and I’ll send one.

The last thing to point out after doing all of the tweaking is to retest it all one more time after you compile.  I forgot to do this and I had a mistake from a copy/paste which caused my knees to bend backwards in my current game build.  It will be fixed on the next update patch.
I hope you enjoyed this article!  Happy Developing!!!  -Dev Out

3 Comments on "DEVBLOG 12/26/12"

  1. DutchmanDavid December 26, 2012 at 4:13 pm -

    Woo! Blog update!

    I want to thank you guys for not simply giving up on Revelations 2012 and sticking to your guns, improving the game as you go.

    PS: Nice article!

  2. DutchmanDavid December 26, 2012 at 4:14 pm -

    PPS: WordPress told me to tell you WordPress 3.5 is out :p

  3. admin December 26, 2012 at 4:15 pm -

    Oh, yes, the website needs a complete overhaul. Thanks for the comments

Leave A Response

You must be logged in to post a comment.