Jump to content
The Dark Mod Forums

Head joints in AF file outdated?


Ishtvan

Recommended Posts

I just noticed that when ragdolled, our AI's heads aren't following the ragdoll physics, instead they just stick straight out stiffly from the torso all the time. I tested Builder guards specifically, believe it also happens to pro guards.

 

I'm pretty sure it worked correctly at one point. The heads should flop around when you hit them. It's not an AF physics problem, I can see the head CM flopping around, but it's not modifying the visible head model. This probably means the AF file has to be updated for new joint names in the new skeleton. The old skeleton AF and new skeleton AF both have this same setup for the head:

 

body "head" 
{
joint "Head"
mod orientation
model box( ( -4, -3, -6 ), ( 4, 3, 3.5 ) )
origin ( -2, 0, 75 )
density 0.4
selfCollision 1
containedJoints "*neck"
}

 

Are there still "Head" and "neck" joints on the new skeleton? More importantly, what joint is the head actually def_attached to? Perhaps this joint is the one that's not being modified by the AF physics? It should be whatever's in the head_jointname spawnarg, right? Is it not "Head" for all our AI?

Link to comment
Share on other sites

The head joint has changed. On the new skeleton, heads are attached to Spine2.

Link to comment
Share on other sites

Argh! Now the ragdolls of guards with helmets are messed up. The helmet seems to be solid to the AF, so it stops the head from falling down as it should. We've probably always had this problem, but fixing the AF head physics made it more noticeable. :(

 

Can we try setting the helmet nonsolid on death or to CONTENTS_RENDERMODEL or something?

Link to comment
Share on other sites

Ok, I added:

 

"drop_set_nonsolid" "1" // will become nonsolid when owner goes ragdoll

 

to the helmet entities.

Link to comment
Share on other sites

Hmm, I have another solution I just tried. I got rid of CONTENTS_CORPSE in their clipmodel contens and just set them to CONTENTS_RENDERMODEL.

 

I teste this and it worked. They shouldn't have to be CONTENTS_CORPSE. Only reason is for the melee initial collision. If they're not CONTENTS_CORPSE, the initial collision will hit the head model, but then the next trace should detect the helmet. This is more iffy in principle, because you can hit the CM at a weird angle such that the next trace sometimes doesn't hit the surface.

 

I'll try your solution of setting nonsolid. It would mean that arrows/blows will react as if there's no helmet on a KO'd AI, but maybe that's okay. Ideally we would have a drop_set_contents_rendermodel as well, not sure if we have that already.

 

The real reason that CONTENTS_CORPSE is a problem is: It adds the helmet to the AF, which is fine, but it sets AF self collisions to 1 by default on anything added to the AF. This works for swords and arrows, but on the helmet, this is bad, because the head is constantly colliding with the helmet and stopping it from moving. So ideally, what we would want is a spawnarg to control whether self collisions is 1 or 0 when we add the item to the AF. That's a more complicated fix though, that I don't think we should try right now.

Link to comment
Share on other sites

Actually, drop_set_nonsolid doesn't look like it works in this case, judging from the code:

 

	if (ent->spawnArgs.GetBool( "drop_set_nonsolid" ))
	{
		int curContents = ent->GetPhysics()->GetContents();

		ent->GetPhysics()->SetContents(curContents & ~(CONTENTS_SOLID|CONTENTS_SOLID));
	}

 

It clears the solid flag, but it leaves the CONTENTS_CORPSE flag in place. I might add a new option like drop_set_corpse_nonsolid that also clears the corpse flag. Or just drop_set_contents_rendermodel. That should be good enough for now.

Link to comment
Share on other sites

Okay, attachments to the head are now treated the same as attachments to the body, so the same spawnargs apply. With the exception of melee weapon attachment-related spawnargs. I was too lazy to add CMeleeWeapon dependencies to idAFAttachment, but I figure we won't have any AI with a dagger stuck to their head, or any head butting with lethal pointy helmets any time soon. :)

 

(In the code, I added a DropOnRagdoll function to idAFAttachment class, and had the AI call it on their head when their own DropOnRagdoll was called).

 

Ragdolls with helmets now WORK. This was another reminder of how a 5 minute fix (make the AF file refer to the correct joints) turns into a 2 hour fix. Can of worms opened, and closed (mostly closed, attachments to attachments that aren't heads are still an issue for the future).

Link to comment
Share on other sites

Ragdolls with helmets now WORK. This was another reminder of how a 5 minute fix (make the AF file refer to the correct joints) turns into a 2 hour fix.

 

:laugh:

 

And to think, I almost posted, "well that was easy" after your second post.

Link to comment
Share on other sites

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

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...