Update Server Transform
by Ivan Mandzhukov · in Torque 3D Professional · 11/25/2009 (9:17 am) · 5 replies
I decided to create a new thread about what i am trying to do:
1:
I create a movable object.
This object is moving smoothly entirely on the client side via animation.
2:
I create a new networked object on the server.
I want this object to take the render transform of the first object and to syncronize its server position.
Good so far.
Torque motions are not optmized to do this.
In T3D the server moves the object on the server tick by tick,then the client interpolate the position between the ticks and all is in sync.
I am trying the opposite - the client moves the position,the server pull information.
The second object needs to move smoothly,so it needs interpolation too.
In its processtick i pull the normal transform of the first object.
I see on this step that the client transform updates good as expected,but server transform is wrong.
I mask the position and packupdate is passing the same transform,so it is impossible to be in sync this way.
The strange thing is that when i move the mouse around the object,its position updates,i can not understand why mouse did it ?
It is not inspectPostApply().
The reason i am doing this is i just want to update the collision information.
The second object is moving good,i see its render,but when i select it from the editor,its selection stops,the collision stops,but the render is right - it is moving.
So is it possible in Torque to get the client transform and syncronize the server transform ?
Right now can not find a similar mechanism.
1:
I create a movable object.
This object is moving smoothly entirely on the client side via animation.
2:
I create a new networked object on the server.
I want this object to take the render transform of the first object and to syncronize its server position.
Good so far.
Torque motions are not optmized to do this.
In T3D the server moves the object on the server tick by tick,then the client interpolate the position between the ticks and all is in sync.
I am trying the opposite - the client moves the position,the server pull information.
The second object needs to move smoothly,so it needs interpolation too.
In its processtick i pull the normal transform of the first object.
I see on this step that the client transform updates good as expected,but server transform is wrong.
I mask the position and packupdate is passing the same transform,so it is impossible to be in sync this way.
The strange thing is that when i move the mouse around the object,its position updates,i can not understand why mouse did it ?
It is not inspectPostApply().
The reason i am doing this is i just want to update the collision information.
The second object is moving good,i see its render,but when i select it from the editor,its selection stops,the collision stops,but the render is right - it is moving.
So is it possible in Torque to get the client transform and syncronize the server transform ?
Right now can not find a similar mechanism.
#2
In theory the client is out of sync with the server by default,so when animating on server, there will be a slight difference in position/rotation.
The reason i wish this to be client side is because i will need many of these objects in a single mission,so there will be a latency problem on the server side.
I am doing it for a single player game but the client-server architecture messed up completely this simple idea.
I am using a slightly modified version of the StaticShape class.
So you suggest to call the TSShapeInstance advanceTime() on the server ?
11/25/2009 (5:53 pm)
This is what i was trying to prevent.In theory the client is out of sync with the server by default,so when animating on server, there will be a slight difference in position/rotation.
The reason i wish this to be client side is because i will need many of these objects in a single mission,so there will be a latency problem on the server side.
I am doing it for a single player game but the client-server architecture messed up completely this simple idea.
I am using a slightly modified version of the StaticShape class.
So you suggest to call the TSShapeInstance advanceTime() on the server ?
#3
11/25/2009 (6:22 pm)
You could entirely skip sending data from the server to the client about each object. Perhaps a solution similar to the shape replicator would be a good one?
#4
They will move (via animation),the convex hull will stay in its initial position all the time.
So may be Manoel is right,this should be created and advanced on the server.
11/26/2009 (4:00 am)
Entirely client side solution will render them normally,but will not update the collision information.They will move (via animation),the convex hull will stay in its initial position all the time.
So may be Manoel is right,this should be created and advanced on the server.
#5
11/26/2009 (6:33 am)
Hmm. The code is there. I haven't checked, but with a few modifications, you should be able to bring any server side only code to the client. Of course, then there's the very convincing fact that Manoel is rarely wrong. :)
Associate Manoel Neto
Default Studio Name
What you want is to have the animation play on the server too, so the nodes' transforms are updated there as well. Server objects don't do this by default, but it can be done with a few code changes. What object class are you using?