Proportional Camera Controller
by William Todd Scott · in Torque Game Engine Advanced · 02/12/2007 (10:11 pm) · 0 replies
Hi,
I am working on adding a proportional controller to my camera. Basically, a proportional controller (PC) takes the difference between the camera's location and the target object's location and sets the camera's velocity towards the target object based upon that distance.
For normal camera modes (third person, godview, orbit) I have gotten past most of the issues with having the camera properly synched up on the server and the client without creating jitter.
However, the problem with using a PC is that on the client objects are advanced one tick at a time, while on the server the control object can be ticked multiple times based on the number of pending moves.
This creates the following type of sitution that is problematic for a PC:
On the client:
player ticked
camera ticked
player ticked
camera ticked
....
On the server:
player ticked 5 times
camera ticked 5 times
This is a problem because on the client the camera will be setting its velocity based on each of the interim positions that the player enters while on the server the camera will be setting its velocity based on the final position that the player is in after 5 ticks.
Frankly, I'm stuck. I need to come up with some modification to the PC behavior that can handle the different client/server processing.
Any suggestions?
Thanks
Todd
I am working on adding a proportional controller to my camera. Basically, a proportional controller (PC) takes the difference between the camera's location and the target object's location and sets the camera's velocity towards the target object based upon that distance.
For normal camera modes (third person, godview, orbit) I have gotten past most of the issues with having the camera properly synched up on the server and the client without creating jitter.
However, the problem with using a PC is that on the client objects are advanced one tick at a time, while on the server the control object can be ticked multiple times based on the number of pending moves.
This creates the following type of sitution that is problematic for a PC:
On the client:
player ticked
camera ticked
player ticked
camera ticked
....
On the server:
player ticked 5 times
camera ticked 5 times
This is a problem because on the client the camera will be setting its velocity based on each of the interim positions that the player enters while on the server the camera will be setting its velocity based on the final position that the player is in after 5 ticks.
Frankly, I'm stuck. I need to come up with some modification to the PC behavior that can handle the different client/server processing.
Any suggestions?
Thanks
Todd