Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / multisync, enlarging lateness

Author
Message
Ondrej
16
Years of Service
User Offline
Joined: 18th Apr 2008
Location: Slovakia
Posted: 28th May 2008 21:31
For comunication betwen sever and client i use multisync.
in each loop client send info about position of player to server, then server draw object on this position. When game started, the latency is ok, but with enlarging time, also enlarging lateness -> when i move with player on client app, object on server is in lateness ( 1-3 second).

know some why? (can be problem in multisync)?

cout << sorry for my bad english;
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 29th May 2008 03:54
Quote: "in each loop"


Throttle that puppy! Try - 2 times a second, or 5 times a second, or 10.... but you're getting towards to much overhead - hard to find a sweet spot ... iterative...test test test ... but Each frame is probably to much IO.

Ondrej
16
Years of Service
User Offline
Joined: 18th Apr 2008
Location: Slovakia
Posted: 29th May 2008 11:39 Edited at: 29th May 2008 11:40
Quote: "Each frame is probably to much IO."


The message of position i send as string:

i try send less message per second.

cout << sorry for my bad english, veeery bad english;
Ondrej
16
Years of Service
User Offline
Joined: 18th Apr 2008
Location: Slovakia
Posted: 29th May 2008 13:11
yeah, it run great...
message is send each 30 ms. very thanks

cout << sorry for my bad english, veeery bad english;
Ondrej
16
Years of Service
User Offline
Joined: 18th Apr 2008
Location: Slovakia
Posted: 29th May 2008 18:58
, but when join more player, then it is as before. But when i set larger time betwen send message, the player on server have jerk move

cout << sorry for my bad english, veeery bad english;
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 29th May 2008 19:18
The jerkiness (is that a word?) comes from the delay between position updates. You have to write a movement routine that will interpolate between where the player was, and where they should be so that the movement will appear smooth. It's also a good place to put code for "movement prediction" which also helps with smoothing their movement and can allow you to send fewer movement update packets.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 30th May 2008 04:21
Without looking at any code, I can tell you that the problem is caused by messages being sent at a faster rate than the receiver reads them. Always make sure you read all messages in a loop until NetGetMessage returns 0, to avoid messages building up. If you send and read at the same rate, then the faster instance will send more messages than the other can keep up with.

Login to post a reply

Server time is: 2024-11-20 11:41:26
Your offset time is: 2024-11-20 11:41:26