From QWiki

Autotrack is a feature for comfortable game observing. Autotrack switches tracked players for you. It chooses the best player and switches the view to him.

There are different types of autotrack. ezQuake command "autotrack" will choose the best available autotrack for you automatically.

KTPro Autotrack

Based on events, e.g. Player picked up pent. Then calculates most valuable player. - add algorithm here

KTX Autotrack

Tries to behave like KTPro Autotrack. The info "who is the best player" is also stored in server-recorded MVD.

Client-side Autotrack

ezQuake Autotrack 4

In each frame it checks for "Switch moment". Switch moment means, that right now the algorithm will look for a new player.

 if (MVD_TrackedHasNoWeapon() && MVD_SomeoneHasWeapon()) return true;
 else if (MVD_TrackedHasNoPowerup() && MVD_SomeoneHasPowerup()) return true;
 else if (MVD_SomeoneHasPentWithRL()) return true;
 else return false;

If "Switch moment" returned true, following algorithm of picking the best player will happen. Players will be compared one by one, the best players will be remembered during comparing.

 BestPlayer() {
   bestplayer = players[1];
   for (each p in players) {
     bestplayer = Compare(bestplayer, p);
   return bestplayer;

This is the Compare rule used in previous algorithm:

 Compare(player sa, player sb) {
   if (HASPENT(sa) && HASRL(sa)) return a;
   else if (HASPENT(sb) && HASRL(sb)) return b;
   else if (HASQUAD(sa) && HASWEAPON(sa)) return a;
   else if (HASQUAD(sb) && HASWEAPON(sb)) return b;
   else if (HASPENT(sa)) return a;
   else if (HASPENT(sb)) return b;
   else if (HASQUAD(sa)) return a;
   else if (HASQUAD(sb)) return b;
   else if (HASWEAPON(sa)) return a;
   else if (HASWEAPON(sb)) return b;
   else return a;

ezQuake Autotrack 1-3

Allows you to create your own equations to calculate the value of players, then pick the player with the highest value. Uses the same "Switch moment" as ezQuake Autotrack 4