viciious/qfusion — pull request #34 by hettoo (2013-10-28 18:33:55+00:00)
Title: Improved teamlist sorting

Using quicksort to sort the teamlists instead of the old naive approach allows removing the auxiliary lists, should be more efficient and saves some lines too.

In some gametypes less score might be better (like race, but not all race gametypes), so I added a gametype setting which indicates that the score ordering of those teamlists should be inverted.

To make the scoreboard look nicer I've made it order by name if scores are equal.
I just realized that this may not be desired, because it unnecessarily diverts the chase order from the scoreboard order even more, so you may want to remove line 76 and 77 from g_gameteams.c.

As an alternative I made this version which uses a list of all non-spectators, sorted the same way as the teamlists, to determine the order of chasing people: https://github.com/hettoo/qfusion/tree/playersorting2.
This could be nice, because you can estimate how many times you will have to click to reach a certain player. Maybe instead of sorting all players together it should be a concatenation of the teamlists to make it even more predictable.

However, the problem with that alternative is that the order is not static. You could miss a person because his score changed some small time before you clicked to chase him. This problem is increased by the fact that it takes some time before the scoreboard is updated at the client.