Northon on 19/6/2006 at 08:54
Hi all,
Lately I've been trying to fix the death animation bug (that causes the death animations to often not be played).
This is what I have found so far:
-It is definately related to saving and loading. The animations will almost always play unless you load a saved game in which case they will almost never play. The easiest example being the first hammerite mission. However, I have been able to get death animations out of certain AIs even after loading (for example, the 2 talking pagans near the beginning of the Kurshok mission) and occasionally they don't play even after a fresh restart, which leads me to believe that it might not be as simple as the animations themselves not being 'loaded properly'.
-The animations aren't being initiated. While it might have been the case that the animations were being initiated but then cut off immediately (due to, say, a collision with the world causing the ragdoll effects to 'take over'), I dont think this is the case. The evidence I have is that the 'short' non-talking death cries are being played and never the long ones. There is a variable under AIBehaviorModel->AIDeath called "ChanceToPlayLastWords" that has the description "When an AI dies AND it plays a death animation before ragdolling, this is the percentage chance that it plays an extra-long last-words death bark", so it appears that the long death cries will only play when a death animation is played.
-The variable "ChanceToPlayDeathAnimBeforeRagdoll" (also under AIBehaviorModel->AIDeath) doesn't seem to be the culprit. Indeed I changed this value to something easily recognizable and then scanned T3's active memory using a cheating program. The value is maintained between loads. Still, I can't totally rule the possibility that the bug is somehow related to this variable.
Does anyone have experience with another Unreal engine game that uses Havok for its rag-doll physics? One that has open source AI scripts and gamesys scripts (unlike TDS)? Its probable that the TDS programmers kept much of the core scripting implementation intact. I would be interested to know exactly what are the conditions for a death animation to be played.
Also, if someone out there is good at reverse engineering that could really speed up the search for the cause of this bug. If I had the source I could find it and fix the problem in hours, but since that will never happen reverse engineering might be the best we can do.
Ziemanskye on 19/6/2006 at 10:30
As far as I know (in that I checked out Tribes and SWAT), the AI is hidden in actuall compiled code, rather than visible scripts, and UnrealEngine2 by default uses Karma instead of Havok so plays by different rules. Might be worth you checking something older though - maybe Deus Ex, and seeing how it handled death animations though (since there are times TDS is closer to UE1)
And I suspect you're the only one working on this (our few reverse engineers are more concerned with filetypes at the moment), but good luck - fixing this would be something else of the list of problems we all see.
oojackapivvy on 19/6/2006 at 11:15
I'm pretty sure Devastation uses Havok physics, and it's very much a UE2 game, not 2.5 (I have no idea if this helps at all or not...)
Northon on 20/6/2006 at 06:26
Hi all,
I'm happy to report that I have found the cause of the death animation bug. In brief, the AI are getting sticky feet, but allow me to elaborate:
In my first post I observed that the 2 pagans in the first part of the Kurshok mission seemed to exhibit the bug only sometimes. I'm now almost 100% sure why this happens. If you get their attention by arrowing one of them or killing the nearby ratbeast and stand in their view they will charge at you. There is a staircase that they use, and they will *jump* off about half-way down to get a more direct path to you. If they do this, they will play their death animations properly. However, if you position yourself so that they run down the staircase completely, avoiding the jump, they will exhibit the bug.
My hypothesis is that the bug is being caused by the AIs feet getting 'embedded' in the ground after a mission load. Thus the game detects that they are colliding with (or maybe being pulled by) by a physical object (the ground) and they are forced to revert to their rag-doll states before the animation can start. The jumping would seem to be getting them 'unembedded'.
I'm not sure how we could fix this problem. Perhaps by screwing with the physics settings a bit to prevent this embedding from occurring, or perhaps by initiating some script at the end of each load to get them unembedded. Someone with more knowledge of the scripting system and/or the physics engine would be in a better position to fix this problem then I would be.
Blau on 20/6/2006 at 07:58
Interestingly, when i was messing about with AI's I had a gaurd that when knocked out would lean over forward because his feet were stuck in the ground (I placed him about 8 units above the ground and in game he was on the ground normally), but until you blackjacked him he appeared to be standing with his feet NOT stuck in the ground. I suspect it may be to do with the AI needing to be in contact with a navmeshed surface so they are capable of pathfinding. Perhaps you could try making a big room and placing an enemy by the roof, and if he spawns on the ground instead of falling then perhaps im on the right track.
EDIT: That guard no longer gets stuck and now animates properly instead of having yoga death. I didnt touch him at all and now he suddenly just works...
Ziemanskye on 20/6/2006 at 09:56
I think they get set to ground at compile/run time, before you see anything.
Like even if you set him a few floors up he wont "fall" to the ground, he'll already be on it.
Might be able to mess with a height property or equivalent to override that, I don't know.
Blau on 20/6/2006 at 11:04
So would anyone agree that mabye that could be the cause? I'll take some shots showing that guard i was talking about incase you dont know what I mean.
New Horizon on 20/6/2006 at 15:12
What would happen if we were just able to open up the models and somehow fuse the spines so they no longer bent backwards? Is that possible? When they fell backwards then, they would just fall striaght without the yoga poses.
Dark Arrow on 20/6/2006 at 17:15
This is a long shot, but what if you added a physical object to the AI's feet to raise him up from the ground. Would that raise the AI up a few millimeters or just collide with the physics and cause the ragdoll effects occur everytime?
Edit: I seriously don't think it would work though.
New Horizon on 20/6/2006 at 17:30
Quote Posted by Dark Arrow
This is a long shot, but what if you added a physical object to the AI's feet to raise him up from the ground. Would that raise the AI up a few millimeters or just collide with the physics and cause the ragdoll effects occur everytime?
Edit: I seriously don't think it would work though.
Hmm, I dunno. Ascottk is able to edit animations and I've opened up the files myself and played with the rigging...might be possible.