Ragdoll Capture BP
For ASA (ASA branch only for now) ragdoll deaths will be captured into Animations. We capturing directional deaths for Idle ( 5 directions) , Torpid(5 directions), Falling(1), and Swimming(1). While the capture process is mostly automated, it does require someone to tweak values so that animations look as good as possible.
Instructions for using the Capture process:
First Time Setup for a Creature) - Right-Click on the skeletal mesh for a dinosaur (“Content/PrimalEarth/Dinos/…”) and choose “Scripted Asset Actions->Ragdoll Death Capture”. The first time you run the capture process, a duplicate physics object will be created that you need to edit, it will give you a popup warning, Clicking ‘Yes’ will open it in the Physics Asset Editor.. After the first time, any time you run this scripted action it will jump right into the capture.
Hold Root in place) - In order for Animation to look correct, You’ll need to add a box shape to the root bone in the physics asset editor. In the Skeleton Tree tab, click the settings gear, and choose show all bones.
Then Right Click on the root bone and choose Add Shape->Add Box. Then save the asset, this only has to be done once.
Select the new shape in the Skeleton Tree panel (it should be called ‘root’) and in the Details panel set its Physics Type to Kinematic and Check the Skip Scale from Animation checkbox.
Quality Check Ragdoll) - While you have the physics asset editor open, Click 'Simulate' and see if the creature ragdolls acceptably with the currently physics asset. This may need to be improved before it can be captured.
Start a Capture) - Right-Click on the skeletal mesh for a dinosaur (“Content/Dinos/…”) and choose “Scripted Asset Actions->Ragdoll Death Capture”. This will place the Capture BP in the current level, and begin PIE and the capture.
View Capture) - If the PIE bar looks like this, click the Gamepad icon to possess player and the BP will teleport you to view it. If it only has an up arrow, it should automatically teleport you to view the capture.
Wait for Capture to Finish or Cancel It ) - You can wait until its finished the capture (can take around a minute or more depending on number of anims the BP finds), or hit Escape at any time to cancel it if its obviously wrong. Hitting the PIE button again (Alt+P) will restart the capture process.
Save Captures) To Save the captures into Anim Sequences, and create the Anim Montages necessary to play them in the game. Right-Click on Skeletal Mesh in the content browser “Scripted Asset Actions->Ragdoll Save Captures”. This takes 10 seconds or so depending on the number of anims.
Quality Check Resulting Animations) - Open each animation sequence to make sure it look as expected, dont have too much empty space at the end, and the Ground Conforming Curves reaches 1 about the time most of the body is hitting the ground. If its too late the Dino may penetrate the ground during animation, and if its too early the animation will get overridden by the ground conforming. You can adjust how the Ragdoll Save Captures clips the empty space at the end of the animation with the DefaultEndClipAtTotalMotionAmount variable on the BP, and the EnableGroundConform Curve either by hand in the Anim Sequence, or the end time with DefaultGroundConformAtTotalMotionAmount and the blend time with DefaultGroundConformBlendTime. NOTE: Both …MotionAmount variables are 0-1 of the total movement of all bones in the animation.
Create Blend Spaces) - Once you have created and saved a full set of animations for the first time, youll need Blendspaces for each set of death animations. This is done automatically when a creature is spawned if they dont exist already for each set of animations. All thats required is that you hit the PIE button, then in the content browser folder for the creature Right-Click on the ‘_Character_BP’ and choose Spawn Dino (InGame)->Tamed. Make sure the Blendspaces were created in the same folder as the skeletal mesh, and make sure to check them in when you’re ready to check in the death animations.
'Common Issues:
Ragdoll sim looks obviously bad jittering a lot or character remains stiff the entire time. This means the Physics Asset itself needs fixed. Load up the override physics asset mentioned above and simulate it to see if the ragdoll itself is bad.
If it looks bad, or is a single physics body (like a capsule), you’ll need to regenerate the physics asset. Open the …_Capture_PhysicsAsset in the Ragdoll Capture folder. In the Tools panel (in the lower right usually, if not, its under menu Window->Tools). Set Minimum Bone Size to 1.0 then Click Regenerate Bodies to remake the ragdoll asset automatically. Check to make sure the root cube from step 2 is still in place.
The Ragdoll flies really far or just limply falls to the ground. Directional deaths should move the character about a leg length in the given direction (except for Ctr). The initial impulse and velocity multiplier needs scaled down or up. In the Outliner, Select the BPU_RecordRagdoll actor
Then Click the Pin and Lock buttons on the Details Panel to keep these options visible, makes iterating on captures much easier.
Now adjust the Default Base Velocity Multiplier down until it looks good.
There several useful options here too, though the multiplier is the most common one to adjust.
Large Creatures fall too slowly, Small Creatures fall too quickly. You can adjust DefaultAdditionalGravity to speed up the fall, or lower it to slow it down for most animations or Add a custom setting based on animation name in DefaultCustomGravityAnimNames. NOTE: A value of Zero or less will be considered an water animation.
The initial impulse looks too abrupt on large creatures. You can adjust the Default Impulse Duration to spread out the impulse over time. You may have to increase or decrease the velocity multiplier when you increase or decrease this.
Swimming Creatures should look floaty for most deaths. The capture BP captures swimming animations differently, removing the floor, and making it look floaty. This happens automatically for animations named in the DefaultCustomGravityAnimNames variable with gravity less than 1.0, however for ocean creatures all animations should be this way. Use ‘Force Zero G’ to make all animation capture as if underwater.
Capturing too many animations. The BP looks through animations to find starting animations for each death by name, sometimes this catches too many animation. You can edit the find and ignore lists to limit what animations it finds. This uses python regular expressions, so special characters can be used to narrow the search (like $ at the end to mean only use the anim if the preceding characters are at the end of the name). https://docs.python.org/3/library/re.html
The floor doesnt align correctly during captures. The capture BP will align the floor to the bottom of the characters bounding box at the start of each capture. If you want to raise or lower it from there use the DefaultGroundHeightOffset to raise or lower it as needed.