I'm not too familiar with a lot of programming terms, so there may be some information not translated appropriately, but overall post is informative.
Original Post: http://pgr21.com/pb/pb.php?id=free2&no=53290
First I took all the games since HotS launch on TLPD and saved as JSON (TLPD Link)
Source Code: http://ideone.com/8txBxh
There are total 22300 games.
When I sorted all the tournaments by game number (link), all the major tournaments are at the top, but there are some I've never heard of before. I thought about it for a while and decided to include all the games because smaller tournaments impact the result only slightly due to small game numbers and it's not clear which tournaments to exclude.
Also, I didn't separate Koreans and non-Koreans. It's part my laziness and part technical difficulties. So if a player dodges all the Koreans and just slaughter non-Koreans, that player's score will be high. Also, because of WCS region lock, this phenomenon will be more easily observed.
Little bit of background on TrueSkill. It's a Bayesian rating system developed by Microsoft. In essence it ranks players. You are probably familiar with ELO rating system. ELO system calculates win chance between new player and old player as 50% if their rating is the same. Also, it doesn't consider that some players may fluctuate more in skill from game to game.
If you want to know more about the algorithm, you can go to the following links
http://www.moserware.com/2010/03/computing-your-skill.html
https://dl.dropboxusercontent.com/u/1083108/Moserware/Skill/The Math Behind TrueSkill.pdf
Or you can read the research paper
http://research.microsoft.com/pubs/67956/NIPS2006_0688.pdf
In short, TrueSkill doesn't assign one number to represent the player's skill. It has two factors, skill and distribution. Skill is expected average skill of a player, while distribution is how the player's skill varies from game to game, or the uncertainty of the player's skill when s/he has limited number of games.
In ELO rating system, if a player with very high score loses to a new player, there is huge decline in score. But in TrueSkill system, due to the uncertainty factor, there is no big decline in this case. Uncertainty generally declines as number of game increases, but if the result is not what the system expected, it can also increase. Skill and distribution change is calculated by pretty complex Bayesian inference, and since it's developed by smart people, I will just use it as is.
There are many advantages to TrueSkill system compared to ELO system. First, it calculates the player's skill level more quickly. Also, because it was originally developed for Xbox multiplay, it can be applied to team games. Games like League of Legends and many others use ELO system for team games, but it's just tweaking ELO system a little and applying it to team game and has no mathematical merits. TrueSkill uses Factor Graph and explains how a system can be applied to 1 vs 1 and expanded to N vs N.
With all the introduction out of the way, I came up with an idea to apply this team game application to HotS
Couldn't you figure out race balance as well as map balance in SC2?
It goes like this.
Let's say a terran player A and a zerg player B are playing on map M.
For racial balance, you can make a player TvZ and ZvT.
For map balance, you can make M_ZvT and M_TvZ.
Then instead of looking at a game as A vs B, you can view the game as a team game between [A, TvZ, M_TvZ] and [B, ZvT, M_ZvT].
After calculating all 22300 games this way, if you calculate expected win percentage of player TvZ, wouldn't that give expected win percentage of the matchup given equally skilled players on perfectly balanced map?
Or you can calculate which way any map, say Yeonsu, is favored in Protoss vs Terran?
...so I calculated to get the ridiculous result that Terran is expected to win 80% of the time on that map. I thought about the reason for a while and realized that if a terran player wins against zerg player, player TvZ score goes up and player ZvT score goes down, increasing the gap more and more.
In online game, especially in a team game, it's very difficult for all players to play from the beginning to the end of the game. Especially in FPS, there are players entering and leaving in the middle of the game. So TrueSkill calculates for contribution based on the time player is in the game.
So, I applied this tool and applied that each mirrored players (TvZ and ZvT for instance) are only in the game for 50% of the time. Obviously there is really no verified mathematical reasoning behind this, but whatever. This whole exercise was for fun anyway. Can't you just say half the games you played Terran vs Zerg and the other half you played Zerg vs Terran?
When I applied this, the gap we saw before decreased, but TvP and PvT still increase/decreased equally. Base rating is (25, 8.3) and if TvP is (25.3, 8), then PvT is (24.7, 8).
So, if I want to know how balanced Terran vs Protoss is I just have to calculate win probability between TvP and base rating of (25.0, 8.3).
and we get the following
TvZ: 53.33%
PvZ: 52.44%
TvP: 52.19%
But, because it includes all the games since HotS launce, it doesn't reflect the impact of the recent patches. There is also impact of the maps, which you can analyze in depth later.
You can calculate map balance in similar way.
If you look at the ladder and GSL map Daedalus Point,
PvT: 77.83%
ZvP: 69.17%
ZvT: 67.88%
...........
Whoever made this map should go sit in the corner.
Anyway, when there's time, you can get into more detailed analysis. For example, you can take a player and see how his skill changed over time, or how any specific patch impacts the balance, etc. etc. Or you can used more developed TrueSkill through Time algorithm, which could somewhat compensate for the fact that players are separated into different regions. I currently don't have tools to do this. It might even be interesting to see how Classic is fairing after the race switch.
You can even calculate the who is more likely to win on a certain map... I guess people who bet on the game will like this.
Anyway, you can find the calculated result in the following link as a excel file.
https://www.dropbox.com/s/yapbmxchwh97hsa/Sc2Trueskill.xlsx
First worksheet, players only (선수만), doesn't care about map and race, and simply ranks the players assuming that a better player will win.
Second worksheet, maps (맵별), shows how balanced matchups are on each map. Closer to 25, better balanced it is.
Third worksheet, players (선수별), calculates rating knowing all the map and race data.
Fourth worksheet, races (종족별), calculates how each race matchup is balanced given the same map. Again, close to 25, better balanced it is.
