Hi,

Ok, what I was suggesting on the clients would be to use dplay_latency to arrive at a percent rate to move on the clients.

You are sending update every 1/4 seconds + the time it takes the message to be recieved by the client from the server.

So, right after every new position list is sent every 1/4 sec, take the current latency on client and try to figure out just how slower the client should move adjusted for the latency. The difference in movement speed should hardly be noticeable and should keep more fluient movement happenening on the client.

The equation for figuring out the percent rate to move at would look something like this:

latencyAdjust = .25/(.25 + (dplay_latency/1000)/2);
(I don't know how your movement works though, so this could be a totally wacky equation, and probably is)

.25 seconds (update rate) / (.25 seconds (update_rate) + (dplay_latency (milliseconds)/1000(now in seconds)/2 (latency is round trip, so divide by 2 to estimate send time));

Now let's say we has a latency of 100 milliseconds, we divide that 1000 to get latency in seconds and then divide that by 2 to get approximate send-to-client time. Which comes out to equal .05 seconds. Now that we have the approximate send delay time, we can try to move the client at a percent rate to compensate for the approximate delay time.

so basically we do .25/(.25+.05) = .83

So we move client at 83% of normal speed on client.

Anyway, just throwing that out there. May not really be a good idea even. Just something to think about.

One thing I did notice is that you are not multiplying your unit_speed.x*time in that client code.

You are using time with pan:

my.pan = my.pan + ang(dire.pan-my.pan) * 1 * time;//i am turning

But not with your x force (which you have as unit_speed.x). I think it would behoove you to add before c_move():

unit_speed.x = unit_speed.x * time;
(could make major difference if server and client are somehow not running same FPS)

If you were trying my crazy idea above it would be:

unit_speed.x = unit_speed.x * latencyAdjust * time;

Anyhow, thats all I know.

Later,
Loco

Last edited by Locoweed; 05/09/06 01:49.

Professional A8.30
Spoils of War - East Coast Games