If I remember correctly, how the team randomization worked for tribes is that it'd parse your GUID into a randomiztion script and if it was even, you'd end up on Team2, and if it was odd, you'd end up on Team1 upon joining a game of even players. Otherwise you were forced onto the team with the fewest players and that was that. It wasn't perfect, but then again, tribes is a different game.
A good system for trem would be to generate GUID's based on names through substituting each character for a number.
Then, each map, it'd generate a random number set based upon the GUID's of each individual who was in the game when it started; if nobody was in a server when the server started it would revert to a default script or the previous seed file.
It would group the GUID's into a sequence of smallest to largest, then for GUID's of equal length, oddest first then evenest by sum of odd and even numbers. So 221122 has a sum of 4 even 2 odd, and 223344 has the same sum; 221123 is 3 even 3 odd. Then for GUID's of equal evenness or oddness it would put the lower number under the higher number on the list and finally, if their numbers were equal, both players would be kicked (as a check against smurfing).
Once the sequence was generated, it would add it up and see if the resulting number was even or odd and notate it in a varaible called polar.
Finally, it would multiply then divide the sequence in order, so:
212121
324568
221122
would end up
212121
*
324568
/
221122
=
311356.12344316712041316558280045
then multiply it by a power of 10 such that there was no remainder. Any seed sequence over 256 numbers long would be cut in half lengthwise and divided until it was less than 256 digits. If the number was irrational then it would simply be truincated after 100 digits or until it hit 256 numbers
=31135612344316712041316558280045
The final number would then be the random seed, and from that all randomness taken for the game. To generate teams it would take the random seed and parse it into even/oddness; zero designated an even number, 1 an odd:
1111101010011011000111011000001
Then multiply it by the polar variable; if the polar variable was 1 then it would reverse the sequence, if it were 0 then it'd leave the sequence alone.
1111101010011011000111011000001
Finally, the random seed would be taken and GUID's compaired to it by digit. If the evenness or oddness matched between the first number of your GUID and the random seed, you'd end up on team 1. If they didn't, team 2 was for you. For each function it did of this it would add 1 to a sequence number called n and utilize the n'th number from the left.
Random seed: 1001101010011011000111011000001
If the seq number was 10, then it'd use
would be taken and if the first digit were even
1
212121
1 odd, 2 even; no match, team 2.
0
324568
0 even, 3 odd; no match, team 2.
0
221122
0 even, 2 even; match, team 1.
Upon doing this it would sum each teams playercount and compair; if one team had 2 more players than another team, it would assign matching functions to numbers, the numbers being set by the script itself, to determine who got moved. For example:
1: least even
2: least odd
3: most even
4: most odd
5: highest guid
6: lowest guid
7: average guid
8: median guid
9: most digits/length
0: least digits/length
Finally, it would take those, the seq number, and the original seed number and begin performing matching operations on the team with the most players to determine who got switched. If no match was found, or it tied, then it'd simply go onto the next number until the teams were even.
31135612344316712041316558280045
seq 8
num =2
2==least odd
switch the least odd player
seq + 1
If a MATCH occured
31135612344316712041316558280045
Seq 9
number=3
3==most even
switch the most even player
seq + 1
and so on, until the teams are even.
Simple, fast, and highly random. If I could code I'd do it myself but I suck at programming.