Game Development Community

T3D 1.1 beta 2 - No Ai Death Animations - RESOLVED

by Steve Acaster · in Torque 3D Professional · 08/05/2010 (5:10 pm) · 13 replies

T3D 1.1 beta 2

Windows7 32bit

Target:
Aiplayer/animations

Issue:
On death, Aiplayer doesn't play any animation, just freezes until delete schedule is called. Tested in both fps example and full project.

Repeat:
Set up your game to spawn an ai

(uncomment AImanager in gamecore.cs, boot up torque, make simgroup/set in-game called "Paths", stick a path in it called "Path1", stick markers in Path1 - don't name the markers!)

and then kill the ai when he spawns. Watch him freeze, sometimes accompanied by a moment of lag/jitter.

Suggest:
function Player::playDeathAnimation(%this)
{
   if (%this.client.deathIdx++ > 11)
      %this.client.deathIdx = 1;
   %this.setActionThread("Death" @ %this.client.deathIdx);
  
   //possible fix for no death animation playing

      if (%this.client !$= "")  
    {  
       if (%this.client.deathIdx++ > 11)  
          %this.client.deathIdx = 1;  
  
       %this.setActionThread("Death" @ %this.client.deathIdx);  
    }  
    else  
    {  
       %rand = getRandom(1, 11);  
       %this.setActionThread("Death" @ %rand);  
    }

And stop spawning a healthKit on death it really lags up.
Player::onDisabled
// Toss out a health patch
  // %obj.tossPatch();


#1
08/05/2010 (5:31 pm)
I've not experienced any lag when tossPatch() was called, but yeah that probably should be removed from the Template at least -- as well as weapon/ammo tossing too.

The suggested fix (or any client/!client check) for death animation is technically how it should have been done to begin with.
#2
08/05/2010 (5:42 pm)
The lag you're experiencing is actually from the items being destroyed. If you were to shoot any item that gets dropped on death this lag will show up. It can appear to happen on item spawn or on player death due to the item actually being tossed in the direction of the explosion and thus being destroyed immediately after being spawned.

It was a considerably annoying one to nail down.
#3
08/05/2010 (6:48 pm)
Ah ... lag only happens in New Project, not FPS Example btw.
#4
08/05/2010 (6:54 pm)
Did you try it in Deathball? That's where the lag is most noticeable.
#5
08/05/2010 (6:58 pm)
Deathball got no lag in FPS Example. Lag came in Empty Terrain in New/Full Project.
#6
08/05/2010 (7:04 pm)
Strange, that's the opposite of what I'm seeing.
#7
08/05/2010 (7:21 pm)
As the guy who added that bit of code I sort of feel responsible when these sort of issues crop up so I've been messing around and I do indeed get some lag when tossPatch() gets called but only on the first instance of the healthpatch being tossed.

It seemed curious to me that this same lag didn't occur when only weapon/ammo was thrown so I swapped out the healthpatch shape (the vial/bottle) for the healthkit shape (the pack) and that bit of lag did not occur on further trials.

Perhaps the lag being experienced is related to the missing materials (5 of them) that the healthpatch shape needs to generate when it is initially added to the scene?
#8
08/05/2010 (7:26 pm)
I vagugely remember the health-patch being an issue previously on tosspatch. In my custom stuff I have tonnes of weapons getting tossed, but I've never used that health-patch because of said ye olde forum warnings.
#9
08/05/2010 (7:36 pm)
Are you talking about this bug or is this a new/different issue?

Also I agree with Steve's recommended fix for the AI death animations. That's the exact same code I added to my kit months ago in order to fix that issue.
#10
08/12/2010 (7:35 pm)
Logged as TQA-805 for the QA Team to verify.
#11
08/16/2010 (12:25 pm)
I had the more or less the same problem after I added Yack Pack to T3D1.1B1. When I killed an AI after I had talked to it, there was no death anim, it stood there until fade. When I killed it before talking to him I know, I didn't want to talk to it when it was dead there was no problem. After a few tests and browsing through the code, I had found out that when I first play an anim with the playThread-function (which went well) and then tried to play an anim with setActionThread nothing happened. Don't know what the link is between those two and if it is related to YackPack or to the anim used.

I have just rebuild beta 2 with the yack pack and try this tonight if the same problem repeats if I get over the jetlag I am experiencing right now due to my recent holiday exploring New England, USA
#12
09/02/2010 (10:44 pm)
The ticket for this one was mistakenly flagged as a duplicate of the item impulse bug. Confirmed that this is still a bug.
#13
09/17/2010 (4:47 pm)
Fixed in 1.1 Beta 3.