Game Development Community

Difference between an object being added in-game, and during loa

by Gerald Fishel · in Torque Game Engine · 10/31/2005 (10:59 am) · 3 replies

Hi all,

I'm having a weird issue here. I have created a system where I can select individual polygons on DTS objects in-game. This works beautifully for static object. It also works for animated objects under certain situations.

For instance, I have a door with a looping sequence that opens and closes the door. If I add the door to the scene while the game is running, I can then select the polygons during any part of the animation, and it works correctly. However, if I save the mission, close the game, and restart the game, it no longer works correctly. Sometimes when the door is all the way open, I can select the polygons on the door by clicking in the opened space. And whent he door is all the way closed, I can select the polygons by clicking where the door was when it was opened.

Note that this only seems to happen with looping animations. I have another animation that just opens the door. If I run that animation, and the door stays open, then it works correctly.

Is there anything done different when an object is placed in the scene, as opposed to when it is placed during mission load?

Could it have something to do with the fact that I am doing the collision tests on the server container, and maybe the client animation is not in sync with the server?

Thanks

#1
10/31/2005 (11:17 am)
Well, after I posted this, I went ahead and tried doing my collision tests against the client container instead of the server container, and it works great. So I am guessing that when an animated object is added to the scene on game load, the sync between the server and client animations is screwed up somehow. Perhaps they aren't actually supposed to be in sync?

For the most part, I think the client tests should be fine for what I need. But for possible future reference, does anybody know how I can periodically force the client to sync the animations with the server?

Thanks
#2
10/31/2005 (1:11 pm)
I believe that this is an intentional part of the engine as an optimization. The assumption is that animation is a client visual only thing that doesn't need to be done on the server. This is true for many animations, but not for more functional ones, like the door opening one you are talking about. I had to add code to my project for the client to inform the server of the status of an animation at certain points. The way I did this in my project was single player specific, and would break a multiplayer project, so I'm not sure if the details of what I did would be helpful.
#3
10/31/2005 (6:31 pm)
I'm not sure how much this will help as well being how the question is not multiplayer but load/add in game. But this should prove useful in the future. On multiplayer, any player specific scrips like opening/closing a door triggered by a player will need to go through the server.