Game Development Community

Animations not working networked

by Mike Rowley · in Torque Game Engine · 08/13/2006 (8:00 am) · 3 replies

I have 2 avatars in my game. 1 for the player, and another for the AI.
In single player, everything works perfectly.
In multiplayer, the connecting client has no animations, and crashes out as soon as someone dies.
I figured the best way to do this was to copy the necessary parts of the player datablock in player.cs that I needed, and derive the rest from PlayerBody.

IE:
//This is the AI Guards datablock
datablock PlayerData(PlayerGuard : PlayerBody)
{
   renderFirstPerson = false;
   emap = true;
   
   className = Armor;
   shapeFile = "~/data/shapes/player/player.dts";


   // Allowable Inventory Items
   maxInv[HealthKit] = 1;
   maxInv[CrossbowAmmo] = 50;
   maxInv[Crossbow] = 1;
};

The playerbody datablock is unchanged eccept for the shapefile.
What I don't understand here is why the information isn't being sent across the net?
Any help would be greatly appreciated.

#1
08/13/2006 (8:25 am)
Are you using two separate player.dts and player.cs (TSShapeConstructor) files? Also, are both the TSShapeConstructor files using a unique dts file name?

E.g.

For your main player:
datablock TSShapeConstructor(PlayerDts)
{
   baseShape = "./player.dts";
   sequence0 = "./player_root.dsq root";
   sequence1 = "./player_forward.dsq run";
...
...

For the AI:
datablock TSShapeConstructor(badDudeDts)
{
   baseShape = "./player.dts";
   sequence0 = "./player_root.dsq root";
   sequence1 = "./player_forward.dsq run";
...
...

It's possible you are not. This explains why it works in single player, why no animations are present across network and why it crashes on death. If torque can't find the death animation the engine will crash.
#2
08/13/2006 (11:05 am)
Tim, you are correct. I tried your suggestion, but then my animations don't work client side eather.

What I have is:
The default orc player unchanged. (I went back to the original setup for this test)
I have added another avatar that is actually supposed to replace the orc. I changed the name of the human player.dts from it's original player.dts to human.dts and made the appropriate changes in his player.cs and in my game.cs loading code. For some odd reason, it's not preloading the avatar now. I'm going to have to do a little more research in the code to find the reason. Thankyou for pointing me to the right place. :)

Edit to add
Gahh, stupid newbie mistake. "baseShape = "./player.dts";" forgot to change this. :blush: it's working now. Now to test across my network.
Thanks again.

Edit 2
Player animations work as expected across the net. :-)
Orc animations don't work on client connected. :-(
Client crashes upon death of Orc. :-(
But, at least i know where to look to figure it out. :-) Thanks.
btw, the orc AI is back to using the default PlayerBody datablock in this test. (wanted to make sure it wasn't my code messing things up.)
#3
08/14/2006 (7:19 pm)
Thankyou Tim. Your help was invaluable. I renamed all the dsq files, and the dts file, then added everything back in and now it is all working properly. Thankyou again. :)