wabz
30th January 2007, 02:14
I have some suggestions regarding the way server querying is done:
All other games that I'm aware of use UDP for server querying. There are very good reasons for this:
Speed
Replies aren't essential - and if you miss out it's likely to be an unreliable server for you anyway
Speed
Microsoft Windows is a truckload of suck (explained below)
Speed
When the game is getting the server list, 16 servers (max) are sent per packet. A response is required between each packet. Please, think of the Australians. There are usually about 500 servers, that's about 30 packets. A round trip ping (directly from OptusNet, Australia's 2nd largest ISP) to master.liveforspeed.net takes at least 300ms. That's 9 seconds MINIMUM, just to get the server list. After that, 500 servers are sent 2 packets (from memory) and responses.
Now, the above wouldn't be so crucial[1], but in all its idiocy, Windows XP (and above) limits the number of outgoing tcp connections to 10 per second. :pillepall This limit is not imposed on UDP.
So, querying all servers, especially from Australia, takes a Very Long Time Indeed[2] (several minutes). Compare this to Steam, which uses UDP for server querying - it queries hundreds of servers per second.
Therefore, I have some suggestions:
Don't require a response after each packet when getting the server list. Just blast them at the client.
Start querying servers as soon as you start receiving them
Use UDP
Visit Australia :thumb:
[1] Despite distances, linux does the whole job in under 20 seconds (servers are queried once the first packet containing server IP/Ports response is received)
[2] I'm well aware of filters. However, there being few servers in the Oceana region, I often just want to get all of them. Filtering isn't a very scalable solution to this problem either. It might be worth doing what Steam does, and letting server admins specify what continent they're on, then be able to filter on that too.
All other games that I'm aware of use UDP for server querying. There are very good reasons for this:
Speed
Replies aren't essential - and if you miss out it's likely to be an unreliable server for you anyway
Speed
Microsoft Windows is a truckload of suck (explained below)
Speed
When the game is getting the server list, 16 servers (max) are sent per packet. A response is required between each packet. Please, think of the Australians. There are usually about 500 servers, that's about 30 packets. A round trip ping (directly from OptusNet, Australia's 2nd largest ISP) to master.liveforspeed.net takes at least 300ms. That's 9 seconds MINIMUM, just to get the server list. After that, 500 servers are sent 2 packets (from memory) and responses.
Now, the above wouldn't be so crucial[1], but in all its idiocy, Windows XP (and above) limits the number of outgoing tcp connections to 10 per second. :pillepall This limit is not imposed on UDP.
So, querying all servers, especially from Australia, takes a Very Long Time Indeed[2] (several minutes). Compare this to Steam, which uses UDP for server querying - it queries hundreds of servers per second.
Therefore, I have some suggestions:
Don't require a response after each packet when getting the server list. Just blast them at the client.
Start querying servers as soon as you start receiving them
Use UDP
Visit Australia :thumb:
[1] Despite distances, linux does the whole job in under 20 seconds (servers are queried once the first packet containing server IP/Ports response is received)
[2] I'm well aware of filters. However, there being few servers in the Oceana region, I often just want to get all of them. Filtering isn't a very scalable solution to this problem either. It might be worth doing what Steam does, and letting server admins specify what continent they're on, then be able to filter on that too.