How does TF2 determine the “Best Available Server”

team-fortress-2

When I choose to play a multiplayer game on TF2 (without manually picking a server), after choosing the map type, the game informs me that it is searching for the "Best Available Server".

To say nothing of often getting hundreds of results, I can do this, leave a server and start again and it will always go to one different than the one I just left.

So clearly it's not using a basic single-item criteria, and likely it's ignoring recently-visited servers, but on a whole, what actual physical qualities does TF2 look for when picking a "best server" for you to play on?

Best Answer

Without actually seeing their code, one could assume their logic leading to a 'best available server' would be the following:

A server...

  1. you can access - Is it password protected?
  2. that isn't full - What good is joining a server you can't join?
  3. that isn't empty - Playing by yourself would suck!
  4. with a good response rate and close to you (Does a simple ping check and gets the avg)
  5. that is using an official map pack
  6. running cheat prevention like VAC.

Once it has a list, it probably picks the best one out of the criteria above with strong weighting towards things like response time/latency, cheat prevention software, official server/maps, etc.

Hope this helps give you some insights!