Ping to different servers in serverbrowser
I'm designing the UI to my game, and I plan on having an in game server browser. Now I was wondering how for example UT2k3/4 calculates the pings to all the different servers. The client gets the entire server list from a master server, and does it then ping each and every server on that list? This seems a bit brute force to me, but I can't think of a different way to do it.
[size="1"]Daedalus Development | E-Mail me
Yes, it pings all servers.
Most master servers will hand you a raw server address list. They might perform some filtering based on a few options you supply (like a particular modification, or a specific map), but they will not give you much more info than the address. Your client program (server browser), will ping and query each of these servers for game information.
If there are many many servers (the number of CS servers in Half-Life is very high), this can be a bit slow depending on your connection speed. I guess you could call it "brute force", but honestly, its the only way. The master server can't tell you the ping it has to those servers, because that information is useless. You want to know what ping you have to them, because you're the one who's going to play there. As for the game informations... The master server saves bandwidth by not constantly re-querying for all the game info to keep it accurate.
I think the best way to save bandwidth is by having the master server keep track of some basic filtering options (like the current modification, or perhaps even the currently played map), and reduce the amount of servers the client has to ping. Keep in mind, however, that a ping packet is usually very small (< 64 bytes). The main resource hog is actually the game info. So reducing the amount of game info a server returns could help too.
Good luck with your game ;)
Most master servers will hand you a raw server address list. They might perform some filtering based on a few options you supply (like a particular modification, or a specific map), but they will not give you much more info than the address. Your client program (server browser), will ping and query each of these servers for game information.
If there are many many servers (the number of CS servers in Half-Life is very high), this can be a bit slow depending on your connection speed. I guess you could call it "brute force", but honestly, its the only way. The master server can't tell you the ping it has to those servers, because that information is useless. You want to know what ping you have to them, because you're the one who's going to play there. As for the game informations... The master server saves bandwidth by not constantly re-querying for all the game info to keep it accurate.
I think the best way to save bandwidth is by having the master server keep track of some basic filtering options (like the current modification, or perhaps even the currently played map), and reduce the amount of servers the client has to ping. Keep in mind, however, that a ping packet is usually very small (< 64 bytes). The main resource hog is actually the game info. So reducing the amount of game info a server returns could help too.
Good luck with your game ;)
Since it takes time for the client to ping every server on the list, why not have the master perform occasional pinging to get the servers on its list in a very rough order of latency. So the players will, in general, get more lower ping servers first.
Vox
Quote:
Original post by Max_Payne
If there are many many servers (the number of CS servers in Half-Life is very high), this can be a bit slow depending on your connection speed. I guess you could call it "brute force", but honestly, its the only way. The master server can't tell you the ping it has to those servers, because that information is useless.
Hehe, I think that's what Half-Life used before. You had to manually refresh the servers to find out the real ping value.
The new list where you can browse around while it's pinging is much better, I still don't find it too exact if you don't refresh them manually though, but that is most likely because of the mass-pinging.
Quote:
Original post by Voxelsoft
Since it takes time for the client to ping every server on the list, why not have the master perform occasional pinging to get the servers on its list in a very rough order of latency. So the players will, in general, get more lower ping servers first.
Because the master server is a very busy machine, and because the ping is not a property of someone's connection, but rather a property of the network path packets take to travel between two specific machines on a network. The master server could have a very bad ping to a server that is just next doors to you, or even on your own LAN.
Quote:
Original post by Max_Payne
Because the master server is a very busy machine
Hence I used "occasionally", I dont think it would be a major load to ping a server every couple of days.
Quote:
Original post by Max_Payne
and because the ping is not a property of someone's connection
Hence I said "in general", "very rough order of latency". This would at least guarantee that the laggiest offender servers tend to be at the bottom of the list.
Might be a good idea to run a couple of master-servers anyway, say one in Europe and one in US as the transatlantic pings tend to be high. Both lets the user choose the closest matching master and lets the show go on when one goes down.
Mmmm also, could apply their sorting criteria such as uptime?
Vox
Quote:
Hence I used "occasionally", I dont think it would be a major load to ping a server every couple of days.
That would make the data even more useless my friend!
Quote:
Might be a good idea to run a couple of master-servers anyway, say one in Europe and one in US as the transatlantic pings tend to be high. Both lets the user choose the closest matching master and lets the show go on when one goes down.
Most games actually have multiple master servers. The game servers update their status to multiple servers. And the clients pick the master server they have the best connection to.
Quote:
Mmmm also, could apply their sorting criteria such as uptime?
Thats a good idea that could possibly work, and help know if a server is reliable... I personally don't like playing in non dedicated servers... Because of that the hosts often end the game a few minutes after you joined. However, this could also be implemented by having a simple "dedicated" flag in the server info query. Though the master server could also possibly compile reliability stats.
Quote:
Original post by Voxelsoft
Since it takes time for the client to ping every server on the list, why not have the master perform occasional pinging to get the servers on its list in a very rough order of latency. So the players will, in general, get more lower ping servers first.
I know it may be a bit late to jump i on this conversation, but I just wanted to show my experience with this:
I love to play on one particular server at my house (ToadRunner Cable). I would get ping times of 20ms to the server. It was great. However, when we had our LAN party, with a sponsored DSL connection by Verizon, the ping time jumped from 20ms to over 500ms.
However, the DSL like wasen't slow. It was an SDSL corporate line. Other servers were fine, with pings averaging 30ms.
My point is that one net connection may take a totally different route to the host.
In most cases, it's not the server that lags, but the net connection between the client and the host that sucks donkey balls.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement