Game Development Community

[BUG 1.1B1] AIplayer's Don't Animate - Moveupdate? Packets? Audio? Confusion! - RESOLVED

by Steve Acaster · in Torque 3D Professional · 02/13/2010 (1:26 pm) · 14 replies

Here's a slightly odd one ...
I've a standard test level for AI shoot-outs. No pathfinding, no obstacles, just run and shoot each other. Scattersky and cloudlayer. 2 teams of 16 Ai. "PacketRateToClient" is changed to 32, "PacketSizeto" 450. No drastic code changes to Player.cpp (a couple of fixes) and none to AIPlayer.cpp.

On starting the level, a number (anything from just 1 to nearly all of them - but rarely non of them) never go into run cycle and just slide over the terrain towards their setmovedestination(). Upon exiting the level and restarting, it gets worse with more Ai not animating. Tweaking prefs::net doesn't change anything. frames-per-second always stays healthy 80-120.

Reduce Ai numbers you say, I did ... and with them halved - then none of them animated. Upon multiple tests it didn't appear to matter how many Ai were in-game, it seemed something of a lottery as to whether animations worked or not.

edit - Having just test 50 Ai from a fresh T3D start, only 4 of 50 didn't animate. On exiting the level and restarting it, most of them failed to animate. There was very occaissional camera lag as expected with so many models (but hardly noticeable). It's really not about the numbers of Ai in-gmae going through their battle routines - end_edit

I even threw in Manoel's old Player::updateMove as explained here, but could not see a difference.
void Player::updateMove(const Move* move)
{
   if (!getControllingClient() && isGhost())//new
      return;//new

  delta.move = *move;
//....

Now, back in 1.0.1 (not using above code), if I have too many Ai (say 50+ in-game) their position update would lag when they moved if I was swamping the packets (with un-updated packet seetings) or - with updated packet settings there would be some camera/visual lag --- but they always animated.

It also appears to be worse if I used Fmod, and less worse with Xaudio. But I'll post something else about Fmod later ...

edit:15feb2010
I was probably getting a bit paranoid by inferring a link to audio.

#1
02/15/2010 (3:58 pm)
UPDATE!

The no animate issue above might be induced by a custom code change relating to getMuzzlepointAI which I have since reverted (it's all part of custom code ported to make the firstperson-eyeOffset-weapon animate with the player instead of just being stuck on screen) -- needs more testing before I'm certain. [edit] nah, nothing to do with this after all[/edit]

HOWEVER ...

Something odd is occuring with Ai/player skinned-meshes at spawn. They spawn "mangled" and then flip into the correct animating shape - I caught it using slow-mo $timescale. They should spawn in a T-shape, which is what I built the model as.

In ShapeEditor the model defaults to it's <rootpose> T-shape fine, but in-game it's a different story.

In 1.0.1, model's spawn, and are set into their <rootpose> T-shape, before animating into their correct poses.

img638.imageshack.us/img638/4117/spawn101.jpg

In 1.1beta1, they spawn as a mangled mess rather than the <rootpose> and then animate into their correct poses.

img705.imageshack.us/img705/8251/spawn11b1.jpg

gahhhh!

And that happens regardless of custom or stock code.
#2
02/16/2010 (8:54 am)
Looks like perhaps the ghost gets the message to set the animation later than when it is set on the server, and it takes a few frames for the messages to reach the "client", then the client transitions to its desired animation over 0.1 seconds (or whatever).
#3
02/16/2010 (11:29 am)
It surely looks funny. Seems they are transitioning from "bogus memory values" animation into your run animation.

Anyway, the initial update for the Player class is quite heavy, with all flags and whatnot plus the ShapeBase stuff. That can clog the pipes quite a bit at the start of each game.
#4
02/16/2010 (11:31 am)
I've cleared up my original complaint on Ai failing to move out of root animation - but I've no idea how, far as I can tell my custom code is the same as it was before ...

-------------------

Back on to stock code though, and just to prove it ain't my hamfisted modeling skills, behold mangled-spawn Gideon!

img682.imageshack.us/img682/3628/mangledgideon.jpg
wow, fps takes a beating when there's 50 of these running around
#5
02/18/2010 (6:45 pm)
@Steve - Maybe some changes to Player have broken AIPlayer. Does this happen if you spawn a player object with that same model?
#6
02/18/2010 (6:51 pm)
Yep, player gets mangled too.
#7
06/22/2010 (11:38 am)
Im having a very similar problem! Sorry for the threadrevival!

No forward run animation on my AIPlayers no matter how high I set the packetsizes!

Also, often when animation is starting to play they curl up to awkward poses.

Since I'm using the realistic Fps resourced (cam following eyenode), and my playermodel also regularly curls up, the cam is thrown around.

Any ideas of what this is caused by? T3D 1.1 Beta 1
#8
07/01/2010 (7:40 pm)
Logged: TQA-493
#9
07/04/2010 (7:04 am)
The bug is very easily reconstructed using
%obj.playThread(0, %seq);

I haven't tested with any stock models though. It could seem like animations fired from script suffer from this bug, but not animations fired from source, though I haven't validated this claim.
#10
07/11/2010 (4:17 pm)
Using setActionThread seems to work properly though.
Also, it seems like the crazy deformations only happen in transitions, when one animation goes over to another one!

Anyone got any clues where to look? This worked without problems in Alpha 1.1, i have tried to compare the different animationfunctions, A1.1 to B1.1 in source, but alas no success so far!
#11
07/19/2010 (9:23 pm)
setActionThread and playThread acts differently over the network, correct?
Because that may be the clue, uncovered earlier this thread, post #2!
So the question is, has there been any changes to the animation-network code? This bug is quite horrendous when using lots of animation-calls!

Thanks for any replies ;)
#12
07/19/2010 (11:59 pm)
Steve and Aleksander, I strongly recommend you GuideBot.

I think the most successful animation management.
#13
07/20/2010 (8:00 am)
I have a problem which might or might not be related to this. When I apply a playThread animation to my AI and stop it with stopThread then an animation applied to the AI with setActionThread nothing happens. When I use setActionThread all the way everything looks fine.

I am using T3D1.1Beta.
#14
09/17/2010 (4:18 pm)
Fixed in 1.1 Beta 3.