PathCamera is a bit Jerky
by Jeromy Stroh · in Torque Game Engine · 05/22/2006 (3:22 am) · 7 replies
It works fine but I'm having a bit of problems with it jerking.
I have the keybindings set so when a certain key is down it sets the pathcamera's state to forward and to stop when the key comes up.
When the key comes up though the camera kind of jerks forward a bit and the back and then stops.
Anyone have any idea how to fix this? (I know C++ and have messed with the code a bit but haven't found a solution as I'm a bit new to the source)
I have the keybindings set so when a certain key is down it sets the pathcamera's state to forward and to stop when the key comes up.
When the key comes up though the camera kind of jerks forward a bit and the back and then stops.
Anyone have any idea how to fix this? (I know C++ and have messed with the code a bit but haven't found a solution as I'm a bit new to the source)
#2
05/22/2006 (6:20 am)
Ok so moving the actual movement function call from interpolateTick to advanceTime makes it nice and smooth on the client side but then the server doesn't know my position. How do I tell it my position? Am I totally off base doing this? I'm such a noob!
#3
05/22/2006 (5:24 pm)
Man, i really wish i understood the client server sync a little better myself. Perhaps someone else can help. I'd kinda like a little more insight on this.
#4
interpolateTick is where the client interpolates until it gets a server update.
processTick is where the server does its update on the object.
advanceTime is a client only update.
So what I'm thinking happens in my situation is that on keydown I send a message to the server to transition the state of the pathCamera. Then as long as I don't transition state the client/server doesn't talk to each other about the pathCamera. Then when I let up on the key and it transitions the state to Stop the server sends it's version of the position which is different from what interpolateTick updated the client to and thus the bounce back occurs correcting for the interpolate discrepancy.
Ok so I guess what I need to do is have the server update the client more often, but I'm not sure how to go about that in this instance.
I was thinking of having a function that was called continuously for the entire time i held the keydown so that I could increase the updates but I'm not sure how to do that :P
damn learning curves!
05/22/2006 (5:43 pm)
Ok so it seems like it's like this:interpolateTick is where the client interpolates until it gets a server update.
processTick is where the server does its update on the object.
advanceTime is a client only update.
So what I'm thinking happens in my situation is that on keydown I send a message to the server to transition the state of the pathCamera. Then as long as I don't transition state the client/server doesn't talk to each other about the pathCamera. Then when I let up on the key and it transitions the state to Stop the server sends it's version of the position which is different from what interpolateTick updated the client to and thus the bounce back occurs correcting for the interpolate discrepancy.
Ok so I guess what I need to do is have the server update the client more often, but I'm not sure how to go about that in this instance.
I was thinking of having a function that was called continuously for the entire time i held the keydown so that I could increase the updates but I'm not sure how to do that :P
damn learning curves!
#5
arf.
The movement is fine, it's just that little jerking at the end that's driving me maddddddddd
05/22/2006 (6:06 pm)
Well I tried sending the state update more often using the schedule function but it doesn't seem to help at all.arf.
The movement is fine, it's just that little jerking at the end that's driving me maddddddddd
#6
What you might try is changing your network settings, opening up the bandwidth to send and receive more packets to and from the server. This helped me clear up a bit of jerkiness I was getting from My BOTS as they moved. it also decreased my mission load times...even in a local connection..weird I know..
take a look in your prefs.cs and fiddle wikth these settings...see what works best.
$pref::Net::PacketRateToClient = "24";
$pref::Net::PacketRateToServer = "32";
$pref::Net::PacketSize = "400";
Dan
05/22/2006 (7:57 pm)
I assume your running on a dedicated server? otherwise the interpolate stuff should be near to nothing..What you might try is changing your network settings, opening up the bandwidth to send and receive more packets to and from the server. This helped me clear up a bit of jerkiness I was getting from My BOTS as they moved. it also decreased my mission load times...even in a local connection..weird I know..
take a look in your prefs.cs and fiddle wikth these settings...see what works best.
$pref::Net::PacketRateToClient = "24";
$pref::Net::PacketRateToServer = "32";
$pref::Net::PacketSize = "400";
Dan
#7
I'm running just on one local machine.
Are there any settings I should set for a single player game running the client/server on one machine/instance?
I tried changing those prefs and didn't see any real improvement.
Thanks:)
05/22/2006 (8:24 pm)
Thanks Dan.I'm running just on one local machine.
Are there any settings I should set for a single player game running the client/server on one machine/instance?
I tried changing those prefs and didn't see any real improvement.
Thanks:)
Torque Owner Jeromy Stroh
How do I go about syncing those better?