News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

[Solved] Death anims before ragdolls

Started by motorsep, September 09, 2014, 12:51:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

motorsep

I remember there was a tutorial on D3W about adding death anims. Does anyone have it saved by chance?

Right now it's death > ragdoll. It would be nice to do death > anim > ragdoll. Not sure if it's C++ hardcoded, or it's a matter of a script playing animation after death and the calling ragdoll routine.

BloodRayne

It's a simple matter of extending the kill() routine function, calling an extra animation.

Here's one taken directly from Hexen:Edge of Chaos.

void monster_base::state_Killed() {

animState( ANIMCHANNEL_TORSO, "Torso_Death", 0 );
animState( ANIMCHANNEL_LEGS, "Legs_Death", 0 );

waitAction("dead");

if ( hasAnim( ANIMCHANNEL_TORSO, "death" ) ) {
restoreMove();
stopRagdoll();

playAnim( ANIMCHANNEL_TORSO, "death" );
while( !animDone( ANIMCHANNEL_TORSO, 0 ) ) {
waitFrame();
}

stopMove();

}

//become ragdoll code here

setState( "state_Dead" );
}

motorsep

Nice, thanks. So it has nothing to do with C++ code?

Also I've heard from TDM folks that even though you play death anim, when ragdoll kicks in, the impact velocity on death propagates to the ragdoll. So if you blasted AI right into the face, but death anim has AI falling forward, when ragdoll kicks in, it will bounce back. So it would look like die>fall forward>fall backward.

Is it the case? If so, I wonder if adding some extra parameters to death anim, like velocity and force (I haven't looked into what ragdolls take as input) is possible.

BloodRayne

My experience with ragdolls after death anims was somewhat mixed. Sometimes it looked good, but most of the times the transition was weird, they just sort of slumped. What you'll want to do to make it look professional is take the velocity of the limbs and apply that to the ragdoll. You could make an updateRagdollVelocity() command in the SDK, which translates the velocity of the current animation to the ragdoll skeleton. But it might take some trickery, first measuring the velocity of each limb then translate that to the ragdoll.

BloodRayne

I just realised that you can probably fake this quite convincingly by grabbing the velocity of the object and just add that. It wouldn't be as specific as seeing each limb flying in the right direction, but it might work with some tweaks.

Bladeghost

I was browsing this thread and wondered for my mod project ,Blade Yautja having facehuggers well facehuggin' the player before getting wasted.
but would have to have it fro FH buggers only since it would be odd to have one in a wrong or out of place environment.
This would be for the player, hmm maybe npc's? still it's an interesting subject.

motorsep

#6
I tried it and it works, somewhat. The issue is that for whatever reason, ragdoll gets into the the last pose of the animation, but never changes the location. So my character falls to the ground driven by animation, then snaps back to ragdoll's rest position (although it's posed properly) and the falls down again as a ragdoll.

This is what it looks like: https://www.youtube.com/watch?v=P2MSA_t7TOM (never mind the radio playing on the background :) )

BielBdeLuna

I bet the proper solution would be to add the velocity of the last frame to bones when transitioning to the ragdoll stage, so you could do death anims with a couple of frames just 5 frames or so and then transition to ragdoll, as well as transplant some of the motion of the projectile to the ragdoll bones as a multiplied velocity. maybe get a way to traverse the ragdoll so those bones more closer to the one who got hit and who weight less are more affected that these that don't.

BloodRayne

Quote from: motorsep on September 12, 2014, 08:08:52 AM
I tried it and it works, somewhat. The issue is that for whatever reason, ragdoll gets into the the last pose of the animation, but never changes the location. So my character falls to the ground driven by animation, then snaps back to ragdoll's rest position (although it's posed properly) and the falls down again as a ragdoll.

This is what it looks like: https://www.youtube.com/watch?v=P2MSA_t7TOM (never mind the radio playing on the background :) )

That seems to point to a problem in the animation itself, the origin bone is the key in this issue. It most likely stays at the same place, but is moved in the animation self. This should be a solvable bug, if you check out the animation with a slower timescale and make sure you can see the bones (I forgot the command, but you can show all bones in the console somehow).

Then you should be able to witness the origin bone jumping from one point to another when the ragdoll instantiates, or see the creature jump up relative to the origin bone.

oneofthe8devilz

Quote from: BloodRayne on October 17, 2014, 04:26:48 PM

This should be a solvable bug, if you check out the animation with a slower timescale and make sure you can see the bones (I forgot the command, but you can show all bones in the console somehow).

Then you should be able to witness the origin bone jumping from one point to another when the ragdoll instantiates, or see the creature jump up relative to the origin bone.

r_showSkel "1"
I got six little friends and they all run faster than you ;)


Check out our mods at
moddb or the SPS Homepage