(This is for a game I am designing) Lets say that there are 2 teams of players in a game. Each team will have 4 players. Each player has a rank(0-9), where 0 indicates a bad player and 9 indicates an amazing player. There is a queue (or list) of players who are waiting to play a game (This could be a small number or a very large number). Lets say that each teams’ overall rank is an average of the 4 players within in. There are multiple open games and teams where a player can be placed.
Question: What is a good algorithm that places a player in the waiting queue/list on a team so that each team in a game will have more or less the same overall rank in a game (Does not have to be perfect)? Also, the players should not have to wait more than a minute to be placed on a team(Can be more if very little players) [The faster they are placed, the better]
You should start to build the table with one person. If person A has a rank of 8, and another player joins the game with a rank of 4, and your placement guide is a factor of 2, then
Player A has the table
Player A has a rank of 8
Player B enters the room
Does player B not have a rank between 6 & 10?
If that is true, then the rank is not within the limits of the table and you should start a new table with Brank as the rank you compare to.
If that is false, then the rank is +- 2 of the table’s declared rank and that player can join.
If you really want to get fancy, you can declare the ranking based on the number of people waiting for a table.
If 100 people in lobby, make the limit +- 2.
If 15 people in lobby, make the limit +- 4. (make it more uneven game, but will not cause people to wait as long).