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.

DarkBASIC Professional Discussion / get net message speed

Author
Message
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 10th Sep 2003 08:54
I am working on a game on one hand and the multiplayer program on the other which I intend to merge the two...

I am wondering for "ping" results whether it is a good idea to always
"get net message" every sync

Or should I put a delay (and how much of a delay) in here as it would interfere with game speed?

TKX
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Sep 2003 16:04
I think that you're looking at the wrong end of the messaging system. You should try and restrict the number of messages sent, and deal with receiving messages as fast as you can.

To work out ping times, I would implement a 'send and wait for response' type system, and halve the time taken, repeated a few times to smooth out the variation, and repeated at variable intervals to maintain accuracy (reduce interval if changed by 'a lot', otherwise increase interval).
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 10th Sep 2003 22:58
"Send and wait for responce"...
Now why didn't I think of that
Thanks for help!

Now that I think of it tho, this should not be used in the middle of the game loop, unless maybe a special call was made?

I will definately be restricting the number of messages sent.
average minimum ping time results.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Sep 2003 23:13
Oh, I didn't mean that you could do nothing else while you are waiting for the response.

In fact, your sync message doesn't have to be separated from other messages. If you always reserve 8 bytes in the memblock (if you are using memblocks) you can send your current timer value in 4 of these bytes, and return the timer value that another client has sent to you in the other 4. The machines are then effectively pinging each other every time they pass standard data to each other.

Really, you need to sit down and think of every piece of data (transmitted or implied) that you need to communicate between the running games, and then design everything in.

As a single example, don't just send your player position, but also include direction and speed, so if your direction and speed don't change you can let the other machine calculate where you are instead of having to tell it all the time. The other machine can calculate this far faster than you can transmit it.
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 11th Sep 2003 03:11
Not using memblocks.

Only strings so far... (trying to seperate data from chat.)

will be sending as much info in one packet as possible.

Was there ever a mention to only check for ping speed at the start of the game? in a menu (I think).

It is a sermountable challenge getting the ideas rolling so that things will work.

Login to post a reply

Server time is: 2026-07-25 08:12:00
Your offset time is: 2026-07-25 08:12:00