(Don't worry about LF2.5 - I'm still working on it ... and I'll release it in three days!!)
I've decided to help Mgccl, a fellow LF2 modder, build an online ladder system for LF2.
The ladder should have the following features:
- Track and store the results of all ranked games. (No idea how we'll do this - for now we'll do it on an honor system, where players submit their game results.)
- Keep track of each players' wins, ties, and draws.
- Calculate each player's rating, using a variant of the ELO system.
- Support clans and countries, and rank them as well as ranking individual users.
- Support all possible team combinations, from 1-vs-1 to 2-vs-5 to 4-vs-4.
- Track which character each player uses, and rank them on each player (i.e. best Davis players, best Julian players, etc.)
country_id , country_name , country_flag , country_wins , country_total_elo, country_total_exp
clan_id , clan_name , clan_leader , clan_wins , clan_losses , clan_draws , clan_ranking, clan_total_elo, clan_total_exp, clan_members
stat_id, stat_elo, stat_exp, stat_rank, stat_win, stat_lose, stat_draw
user_id, clan_id, country_id
game_id , team1_id , team1_winrounds, team2_winrounds
Mgccl also singlehandedly coded the ELO script (this guy's amazing at PHP!) Now we are missing one crucial feature - ranking for team games. Since I'm good at math, it falls to me to solve the following problems:
- I must find a way to average the team members' ratings to create a team rating. A simple arithmetic mean won't work - a team with one member rated 1500 and one member rated 1000 does not have a 1250 rating!
- Figuring out 1) will let us play 2-vs-2, 3-vs-3, and 4-vs-4 games, but what if we want to play a game with unequal teams? I must calculate how to adjust the temporary team ratings, to account for the fact that teams with more players have a much better chance of winning.
- Once I find 1) and 2), I am able to use Mgccl's ELO algorithm to find how to adjust each team's rating, but wait! Teams aren't rated - only players are! I must figure out how to apply the rating adjustment to the team members. As far as I see, the answer to this is to simply take the team adjustment and adjust each team member's rating by it, but I'll have to do some more research on this.
Some data to help me: The ELO system is designed so that if two players (or teams) have a rating difference of 200, then the stronger team should have a 75% chance of winning. I think that if I take a few logarithms, I should be able to figure out the answer to 1) and maybe 2) from that statement.
Whew. Long, very long, incredibly long, post.