Game Development Community

Eye Node Animation Freezing

by Mike Treanor · in Torque Game Engine · 05/16/2008 (4:00 pm) · 1 replies

Hello,

I am having a problem that I have posted about before but never had resolved. Since then I have spent countless hours trying to figure out what is wrong, and have narrowed it down to the following:

I am animating the eye node of an AI creature to essentially get a bobbing effect while looking through its perspective. When viewed in the ShowTool the eye node is in fact animating and when I load the AI creature as the main player the animation/bobbing works as would be expected. However, when switching from the player's main perspective to looking through the AI's perspective the eye animation only works for a short time before freezing. It seems that the animation freezes when it gets near a key frame. It also happens often if I try to switch animations while looking through a bot's perspective. Once the animation freezes it will only start up again if I switch to the player's point of view and then back to the AI's point of view at which point it will play for a short time and then freeze again.

This problem doesn't happen with all animations. I have gotten all to work with a different bot by completely reanimating the model and exporting it again. However, I have no idea why this fixed the problem and it hasn't worked again.

I am thinking the problem may have something to do with the way that I am viewing through the AI's perspective or with the exporting (though I cannot figure out what is wrong because ShowTool says it is working - I am using maya2dts by the way). Here is the code I use to switch to AIManager.player's (the bot's) point of view:

$myclient.camera.setOrbitMode(AIManager.player,AIManager.player.getEyeTransform(),0,0,true);
$myclient.setControlObject($myclient.camera);

Does anyone have any ideas? Please ask if you have any questions that will help clarify my issue. This is getting critical as the deadline is only a couple weeks away! Anyhow, thanks so much for your help and I hope you're having a great day.
Mike

#1
05/21/2008 (6:26 pm)
Apparently, no one knows what the hay is going on... ME NEITHER!

Anyhow, I have a little more info I thought I would post here:

When I try and apply the "drunk or sniper breathing" resource, I cannot get it to work while looking through an ai's perspective while it will work when I look through the player's perspective. I have the AI player's using a separate (yet identical except for the animation code) player class than the player. I really don't think this is the issue and instead think it has something to do with the orbit mode or something...

Anyhow, here is the sniper breathing code I am using:
in player.cc updateMove
...
F32 p = move->pitch;		
F32 fTranquilized = 0.01f;
if (fTranquilized>0.0f) p+=fTranquilized * mSin((F32)Sim::getCurrentTime()/800.0f);
...

Thanks for reading. I am crossing my fingers that someone who knows the engine ridiculously well will stumble upon this and have the answer!!!