View Issue Details

IDProjectCategoryView StatusLast Update
0001160The Dark ModAIpublic29.06.2009 08:06
ReporterIshtvan Assigned ToIshtvan  
PriorityhighSeveritynormalReproducibilityalways
Status closedResolutionfixed 
Summary0001160: AF bodies for attached entities misplaced (world vs AI orientation issue?)
DescriptionI tried spawning builder guards. When I spawned them facing a certain way (presumably parallel to the world), the AF body for their hammers was correctly placed upon KO. However, at other orientations, the AF body was not correctly placed on KO. This will cause problems with the ragdoll, tactile feedback, etc.
TagsNo tags attached.

Activities

Ishtvan

Ishtvan

23.09.2008 08:58

reporter   ~0001628

They also seem to get misplaced upon calling ReAttach.

I have a hunch that stuff is getting bound a second time when the AI goes into ragdoll, based on looking at it with g_showcollisionmodels.
Ishtvan

Ishtvan

27.09.2008 03:47

reporter   ~0001650

Last edited: 27.09.2008 03:47

I noticed the positions all get corrected when attachments are re-initialized after a save/restore. Weird, save/restores usually break things, not fix them. :)

That probably means that it has to do with the T-pose on spawn or something.

Ishtvan

Ishtvan

05.10.2008 03:29

reporter   ~0001775

This issue is harder to fix than expected. It seems that the AF body starts out in the right place, and gets sucked into the wrong place (the place it would be if the AI was in the T-pose and facing at 0,0,0 degrees) when going into ragdoll mode. This obviously doesn't happen to the AI's usual AF bodies, and it also doesn't happen after going ragdoll, because you can shoot in arrows and their clipmodels are in the right place.

Recommended action is to check all the difference between how dynamically added bodies are treaed and how regular AF bodies are treated in the physics. It is NOT the JointMods variable that is wrong, I tried setting that to something ridiculous and, while starting out there, it got sucked back to the same erroneous place. This tells us JointMods is actually correct and something else (af physics?) is sucking it back to the wrong place.
Ishtvan

Ishtvan

05.10.2008 04:09

reporter   ~0001776

Problem seems to lie in the fixed constraint between the added body and the body it gets added to. This defines how the added body wants to be placed and oriented relative to the body it's attached to. For some reason, def_attached objects are being "glued" in place when they're in the T-pose, but then not updating the constraint when it rotates out of the T-pose. Maybe something in idPhysics_AF::AddConstraint assumes that the AI is oriented at 0,0,0 angles when this is called, and uses the position the attach-ee AF body would have if the AI was rotate to 0,0,0?

There could be an additional problem, because the hammer clipmodel in the hand seems to be wrong when reattached, and that is controlled by the animation, not yet effected by constraints, because that doesn't happen until the AI goes ragdoll (although it's not 100% certain it's a separate problem).
Ishtvan

Ishtvan

05.10.2008 07:35

reporter   ~0001777

fixed in src by rotating AF back to 0,0,0 angles before doing the attachments

Reattach AF body misplacement is a separate issue apparently, will open it as such.

Issue History

Date Modified Username Field Change
22.09.2008 08:16 Ishtvan New Issue
22.09.2008 08:16 Ishtvan Status new => assigned
22.09.2008 08:16 Ishtvan Assigned To => Ishtvan
23.09.2008 08:58 Ishtvan Note Added: 0001628
27.09.2008 03:47 Ishtvan Note Added: 0001650
27.09.2008 03:47 Ishtvan Note Edited: 0001650
05.10.2008 03:29 Ishtvan Note Added: 0001775
05.10.2008 04:09 Ishtvan Note Added: 0001776
05.10.2008 07:35 Ishtvan Note Added: 0001777
05.10.2008 07:35 Ishtvan Status assigned => resolved
05.10.2008 07:35 Ishtvan Resolution open => fixed
29.06.2009 08:06 greebo Status resolved => closed