Multiplayer Ping

Blitz3D Forums/Blitz3D Programming/Multiplayer Ping

Tibit(Posted 2004) [#1]
In all games that have networking capability you have this "ping" which says how good your connection is to the server(or other players). lower ping means better connection. Anyone knows how to calculate ping any links to sites about this? I have a simple multiplayer chat and I thought I would add ping to it. Is there anyone who can help me with this? Code archives? Is ping just a name or does it follow a specific standard?


Jeppe Nielsen(Posted 2004) [#2]
I think a ping is the time in milliseconds (1/1000th of a second) to send/recieve a message over a network, thus the lower the better.


Tibit(Posted 2004) [#3]
k still, feels a bit unexact. The ping varies from game to game, even in LAN. But now I can atleast implend it. btw anyone who has an good idead how to actually test the connection of a player in a game. Is it just to send a msg and see how fast they reply in millisecs? or should you send a series of msg? Should I send a long long string?

It's good if one can actually nail those people who will make the game unplayable(laggy) before the game starts ;)


eBusiness(Posted 2004) [#4]
For the ping, the msg should be as short as possible, and it is important that the reciever check for pings often, and also the sender should check for respond often (every 5 ms is probably ok). Another thing, DON'T ever try to sort out laggers, it only makes people angry. If you want to test the lagprobability, you got to simulate the game. And by the way, if lagging occour, it could easily be your fault as the programmer.


Tibit(Posted 2004) [#5]
You mean I should ping the other players constantly? or just before teh game starts? And by "sort out laggers" I meant that the host will (if he wants to) kick those who have 33k modems ;)


eBusiness(Posted 2004) [#6]
How often you ping depends on how often you need it, I can't tell. Have you by the way considered what to do when people lack, to a certain point there is often a better way than pausing the game, and if want to hit the lackers then just leave out halting the game. (you could let the host adjust this)


*(Posted 2004) [#7]
One good way of doing this is to have a special ping packet most command sets in blitz have a message type I normally set aside 99 for ping packets (with the data being either + or - for if they are pinging or being pinged) when the client gets this it duly responds and vice versa this will enable them to get an accurate ping time from that particular person :). Remembering to keep a timer handy to measure the time ;)


Paul "Taiphoz"(Posted 2004) [#8]
PING.

In this case it might be a good idea to send a ping with a packet the same size as your average game data packet. this way you will get the ping for your game, this is why some games ping servers better than others.

Also dont ping all the time there is no need to do so. as the connection wont really change over time, unless a client is downloading while playing which aint normally going to happen, id say just ping once every 50 netwrk sends, ie every 50th bit of network data you send out is a ping.

just my 2p.