Jump to content

Recommended Posts

Posted (edited)

Doom 3 coding question here!

 

One thing I am wondering about - how do I implement death animation preceding ragdoll kicking in? Has anyone tried implementing it in C++ code?

 

Right now it's death > ragdoll. I want death > death anim > ragdoll.

 

Thanks beforehand!

Edited by motorsep
Posted

I think death and knockout animations were always intended but I think there was some technical issue that prevented them. Anyone correct me if I'm wrong about that. It may just be a priority or lack of coding help that it never got done.

 

I would personally love to see a return of the classic death / knockout anims.

Posted

The code already exists for that inTDM, but there were a few arguments against using them for humanoids. The only one I remember off-hand is that the current set-up allows an impact to propagate to the ragdoll, so if you hit him from the left side he'll jerk to the right. If you had a death animation that wouldn't happen.

Posted

Well, that still doesn't tell me where in the code of Doom 3 I should look, and what I should look for in order to add death anims preceding ragdolls (without propagating impact - that should somehow correlate to death animation; maybe an extra parameter specifying velocity on the impact)

Posted

I've never used this, I've just done a regex search for "death|ragdoll" and it seems that in TDM, you just have to create an animation for an AI called "death" and set the "enable_death_anim" spawnarg. It uses the animState "Torso_Death" -- search your .script files for that to see whether you have the same setup. A lot of this was inherited from doom3, other bits have been added in TDM.

 

The "enable_death_anim" spawnarg is picked up by the game code and it delays the conversion to ragdoll. The parts of the c++ code that handle it are ai::DeadState::Init, idAI::Killed, and idAI::PostDeath. Try searching the Game project for "enable_death_anim". That spawnarg might or might not exist in your code. If not, search the TDM code for it and you'll see how and where TDM implemented this feature.

Posted

So last night I added death anim using purely scripting. It works, expect that when ragdoll kicks in, the model snaps from final frame of death anim to ragdoll's initial location (snapping death anim's origin bone to ragdoll's waist bone).

Posted

This is what's happening with my experiment:

 

Somehow, while posing ragdoll into animation pose works fine, location doesn't get set by stock Doom 3 StartRagdoll() code. Any ideas where is the issue?

Posted

Hmm. I'd spotted before that the origin of a ragdoll is its waist instead of the feet like it is for the living AI. Your ragdoll seems to be using the feet as the origin still -- probably because that's what the animation frame is using as its point of reference. So although the falling AI still has the right pose when he becomes a ragdoll, it's starting with the feet at the place the ragdoll's origin would have been if the death anim hadn't played. You likely need to apply an origin offset (SetOrigin) in the frame where the animation pose gets transferred to the ragdoll. There must be something similar happening in TDM code, even if we don't have animations that cross the life->death boundary.

Posted
[quote name='motorsep' timestamp='1410499938' post='354282']
This is what's happening with my experiment: [url="https://www.youtube.com/watch?v=P2MSA_t7TOM"]https://www.youtube....h?v=P2MSA_t7TOM[/url]

Somehow, while posing ragdoll into animation pose works fine, location doesn't get set by stock Doom 3 StartRagdoll() code. Any ideas where is the issue?
[/quote]

As SteveL said, the origin seems to be off. Btw, the shader look great, I'd play this game :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Posted

:-) thanks. As for origin, I did everything like in Doom 3. I am sure somewhere is C++ code setting ragdoll to the entity's origin fails (in reality entity gets removed after death anim starts playing, and posed ragdoll gets shown)

 

If you look at StartRagdoll() code, and follow the trail down to the posing function, you'll see that there is SetWorldOrigin (or something like that) function that suppose to set bones of the ragdoll to the animated model's bones' locations. Not sure why and where it fails :-\

Posted

Cheers for updating the topic title. How did you fix it?

 

I agree with Tels by the way, that's a quality job. Fascinating to see someone doing something so different with the engine :)

Posted

Thanks :)

 

Well, from what I understood, the way ragdoll stuff works is it takes first child of the origin, which suppose to be Body bone (in doom 3) and aligns ragdoll by that bone. In my rig (perhaps Blender sorted it out on export) first child is eyes control bone. So, we implemented an option to specify first child bone in AF file (or if not specified, it falls back to stock behavior and then it just depends on the rig's hierarchy).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
    • JackFarmer

      What do you know about a 40 degree day?
      @demagogue
      · 4 replies
×
×
  • Create New...