Sunday, September 6, 2015

Number of LoL Games Played per Month - NA Server 2014 to 2015

Due to Riot's new API endpoint I refactored some of my data mining code. As a stability test I decided to mine some extra data to figure out how many games of League of Legends are played each month on the NA server from 2014 to 2015. The result is below (interactive chart).

It seems to me that there is a small but steady decrease in number of games played. For example, 48 million games were played in August 2014. Comparably, there were only 32 million games played in August of 2015. That being said, keep in mind that the absolute number of games played may not be the best indicator of the game's health or popularity because:

1. It is possible that games in Season 5 are longer, so fewer games are played for comparable hours of entertainment.
2. It is possible that a lot of the "extra games" in Season 4 were due to Dominion bots.
3. Riot has increased monetization of their game with ward skins, icons, chromas, and various skins at higher price tag (1350RP+), so even with fewer players and less play time their revenue may actually be growing.

In case you cannot view the interactive chart below, try the imgur image (non-interactive).
Data: data • Chart ID: LineChartID102832b0102cgoogleVis-0.5.10

Sunday, August 16, 2015

Damage Contribution - A Small Critique on Its Usage

Damage Contribution (sometimes referred to as Damage %, Damage Distribution, or Damage Share) seems to be one of the key statistics used for competitive League of Legends these days. It is often displayed on live streams as a summary statistics to argue the prowess - or lack there of - of players.

Generally speaking, Damage Contribution is computed by dividing a player's damage dealt to champions to the sum of his team's damage dealt to champions. While this can be useful in evaluating the playstyle of teams and of players, a problematic issue with this measure is that it does not take into account of the champions being played. Simply put, a pokey and/or AOE heavy champion will do far more damage than a single target, bursty champion (aka assassin), skewing the numbers depending on the champion played.

To quickly illustrate this effect, I retrieved 150k Platinum+ NA solo queue games from Patch 5.12 and computed the Damage Contribution of 20 most popular mid laners and Kog'Maw for won games.



ChampionAverage Damage Contribution
Ezreal31.8%
Kog'Maw29.6%
Viktor28.4%
Vladimir28.2%
Ziggs27.9%
Talon26.7%
Diana26.2%
Azir26.0%
Ahri25.9%
Katarina25.9%
Annie25.9%
Lux25.5%
Malzahar25.4%
Twisted Fate25.1%
Yasuo25.1%
Zed24.2%
Cho'Gath24.2%
Orianna23.6%
Fizz23.5%
LeBlanc23.4%
Ekko21.4%

Below is a graphical representation of the comparison of Damage Contribution for Zed, Viktor, and Kog'Maw.



Therefore, we see that on average, mid lane Ezreal is about 8% higher Damage Contribution than Fizz on average, seemingly due to the fact that they are different champions and they deal damage differently: Ezreal is a poke champion, Fizz is an all-in assassin. While this is data from solo queue and not competitive, it's not hard to see that the similar effect can be observed for competitive (but we can never verify the effect due extremely small number of competitive games per patch). With this in mind, it is interesting to ponder if it is meaningful to compare Damage Contribution for different players who may have been playing different champions.

Saturday, August 15, 2015

Jungle Item Enchantment Popularity: Patch 4.20 to 5.15

Some plots for the jungle enchantment popularity from Patch 4.20 to 5.15 for NA solo queue, junglers only (top lane smite users are not counted).

Note:

  1. To keep my sanity, I renamed "Patch 5.1" as "Patch 5.01" and so on. I think it makes more sense anyway.
  2. Cinderhulk was introduced in Patch 5.5. Runeglaive was introduced in Patch 5.12. Devourer was reworked in Patch 5.13 (with Sated).




The same information in a different plot.



Saturday, August 1, 2015

Black Market Brawlers Statistics

280k Black Market Brawlers (BMB) games collected with win rate computed per champion (non-mirrors only). Additionally, since BMB is very similar to Blind Pick, I collected 100k Blind Pick games from the same patch with comparable players for comparison.

Note that BMB games are Blind Draft - 6 bans are given. This has definite impact on champion popularity (see: Yasuo).

1. Win Rate and Popularity (Click on the columns to sort)

ChampionBMB PopularityBlind PopularityPopularity DifferenceBMB Win RateBlind Win RateWin Difference
Aatrox7.60%5.29%2.31%53.97%51.58%2.39%
Ahri11.60%11.34%0.26%53.36%53.02%0.34%
Akali4.40%5.06%-0.66%47.84%50.45%-2.61%
Alistar5.80%6.66%-0.86%49.25%49.06%0.19%
Amumu4.50%4.28%0.22%54.48%54.32%0.16%
Anivia2.90%2.80%0.10%52.71%50.99%1.72%
Annie11.90%11.95%-0.05%51.16%51.66%-0.51%
Ashe17.50%16.85%0.65%51.20%49.52%1.68%
Azir5.60%6.64%-1.04%45.41%46.48%-1.07%
Bard11.90%15.47%-3.57%42.79%43.03%-0.24%
Blitzcrank15.10%17.96%-2.86%53.30%54.09%-0.79%
Brand5.60%4.49%1.11%52.39%52.91%-0.52%
Braum6.40%5.39%1.01%51.85%52.70%-0.85%
Caitlyn13.90%11.33%2.57%50.77%49.70%1.07%
Cassiopeia2.60%2.35%0.25%45.34%45.31%0.03%
Cho'Gath7.80%6.58%1.22%50.84%51.80%-0.96%
Corki3.20%4.26%-1.06%49.68%49.51%0.17%
Darius16.30%18.39%-2.09%49.05%49.21%-0.16%
Diana16.60%17.62%-1.02%51.35%52.05%-0.70%
Dr. Mundo2.80%2.49%0.31%47.66%48.38%-0.72%
Draven6.20%7.72%-1.52%50.13%51.94%-1.82%
Ekko11.60%10.95%0.65%47.11%48.44%-1.32%
Elise7.60%9.57%-1.97%51.52%52.17%-0.64%
Evelynn4.90%5.57%-0.67%45.74%43.22%2.52%
Ezreal13.30%13.10%0.20%46.01%47.25%-1.23%
Fiddlesticks3.50%2.99%0.51%47.24%45.47%1.77%
Fiora7.70%5.80%1.90%53.27%53.71%-0.44%
Fizz13.90%16.72%-2.82%50.13%50.34%-0.20%
Galio1.70%1.36%0.34%52.20%51.60%0.60%
Garen10.60%9.37%1.23%51.32%51.43%-0.11%
Gnar9.40%9.01%0.39%47.38%48.79%-1.41%
Gragas3.20%3.83%-0.63%45.69%47.76%-2.07%
Graves14.40%14.38%0.02%50.20%49.43%0.78%
Hecarim4.70%4.36%0.34%49.17%49.43%-0.26%
Heimerdinger9.70%6.03%3.67%54.55%54.76%-0.21%
Irelia5.90%6.87%-0.97%49.78%51.06%-1.27%
Janna7.30%6.56%0.74%54.11%53.95%0.17%
Jarvan IV5.50%5.37%0.13%50.26%49.77%0.50%
Jax10.50%9.34%1.16%52.11%51.19%0.92%
Jayce4.10%4.46%-0.36%46.75%48.75%-2.00%
Jinx22.40%19.51%2.89%52.09%51.39%0.70%
Kalista6.80%7.93%-1.13%46.63%46.24%0.38%
Karma5.10%3.57%1.53%50.39%48.91%1.49%
Karthus2.00%1.80%0.20%50.43%48.63%1.79%
Kassadin1.50%1.62%-0.12%40.49%42.55%-2.06%
Katarina9.20%10.47%-1.27%50.15%49.95%0.20%
Kayle7.20%7.72%-0.52%52.15%51.55%0.59%
Kennen2.50%2.71%-0.21%48.66%50.30%-1.63%
Kha'Zix6.00%6.77%-0.77%46.12%46.92%-0.80%
Kog'Maw7.70%9.52%-1.82%48.09%49.06%-0.97%
LeBlanc5.90%5.78%0.12%44.61%46.13%-1.52%
Lee Sin12.70%19.03%-6.33%44.56%46.01%-1.45%
Leona10.20%8.45%1.75%54.09%53.70%0.39%
Lissandra1.70%1.68%0.02%50.46%51.80%-1.34%
Lucian6.10%7.27%-1.17%48.83%47.56%1.27%
Lulu5.50%4.71%0.79%49.91%49.90%0.01%
Lux15.30%12.65%2.65%51.43%51.61%-0.17%
Malphite7.20%8.87%-1.67%51.86%53.31%-1.45%
Malzahar7.10%3.10%4.00%55.76%55.35%0.41%
Maokai3.70%3.84%-0.14%48.76%50.45%-1.69%
Master Yi16.60%18.05%-1.45%51.79%50.18%1.61%
Miss Fortune28.40%21.37%7.03%51.37%51.69%-0.32%
Mordekaiser2.90%2.06%0.84%53.29%50.59%2.69%
Morgana10.80%9.27%1.53%50.38%50.53%-0.16%
Nami8.60%8.87%-0.27%50.58%51.19%-0.61%
Nasus8.60%8.97%-0.37%48.66%50.37%-1.71%
Nautilus15.60%16.76%-1.16%51.16%51.21%-0.05%
Nidalee11.80%14.26%-2.46%45.44%45.72%-0.28%
Nocturne4.50%4.41%0.09%52.48%50.16%2.32%
Nunu5.50%3.42%2.08%50.55%47.47%3.07%
Olaf4.40%3.98%0.42%48.41%46.61%1.80%
Orianna4.40%5.59%-1.19%48.20%47.17%1.03%
Pantheon5.40%5.04%0.36%48.05%50.00%-1.95%
Poppy1.50%1.72%-0.22%45.67%46.63%-0.97%
Quinn11.30%12.28%-0.98%47.50%48.85%-1.36%
Rammus2.40%1.92%0.48%51.85%54.11%-2.26%
Rek'Sai4.50%4.89%-0.39%46.97%47.99%-1.02%
Renekton4.10%3.84%0.26%52.52%51.28%1.25%
Rengar10.50%12.34%-1.84%46.25%47.10%-0.85%
Riven10.40%15.50%-5.10%48.57%49.79%-1.22%
Rumble2.50%3.44%-0.94%46.83%50.73%-3.90%
Ryze2.00%2.39%-0.39%40.22%41.48%-1.26%
Sejuani2.70%2.45%0.25%51.28%50.54%0.73%
Shaco9.20%8.40%0.80%47.04%48.14%-1.10%
Shen7.10%7.84%-0.74%50.43%51.01%-0.59%
Shyvana12.00%10.19%1.81%55.19%52.86%2.33%
Singed3.20%2.78%0.42%51.23%48.58%2.65%
Sion4.70%3.18%1.52%52.68%52.52%0.16%
Sivir8.70%9.57%-0.87%52.34%52.03%0.31%
Skarner1.90%1.32%0.58%50.76%52.59%-1.84%
Sona13.90%8.99%4.91%53.26%54.21%-0.95%
Soraka6.80%6.49%0.31%51.70%50.27%1.44%
Swain2.80%1.95%0.85%50.88%52.68%-1.80%
Syndra2.00%2.11%-0.11%48.18%46.65%1.53%
Tahm Kench24.60%24.13%0.47%42.25%42.54%-0.30%
Talon4.80%4.79%0.01%51.59%51.42%0.16%
Taric2.40%1.92%0.48%53.16%50.56%2.61%
Teemo15.60%15.74%-0.14%48.42%51.79%-3.37%
Thresh17.60%22.16%-4.56%49.04%50.17%-1.13%
Tristana10.90%11.63%-0.73%48.34%49.06%-0.72%
Trundle4.00%2.85%1.15%52.33%52.18%0.16%
Tryndamere10.70%8.50%2.20%54.72%52.71%2.01%
Twisted Fate13.40%13.79%-0.39%47.54%48.25%-0.71%
Twitch4.30%4.30%0.00%46.23%47.23%-0.99%
Udyr10.80%9.15%1.65%52.86%53.35%-0.49%
Urgot0.80%0.99%-0.19%47.20%46.35%0.84%
Varus7.50%6.87%0.63%51.22%50.17%1.05%
Vayne24.40%30.17%-5.77%48.43%50.75%-2.32%
Veigar5.20%4.15%1.05%50.54%48.98%1.56%
Vel'Koz4.70%3.16%1.54%52.67%50.05%2.62%
Vi7.60%6.65%0.95%51.37%51.86%-0.49%
Viktor13.10%14.66%-1.56%49.29%48.50%0.79%
Vladimir6.00%5.38%0.62%49.22%48.54%0.68%
Volibear5.70%4.87%0.83%52.20%52.20%0.00%
Warwick11.00%9.54%1.46%54.18%53.34%0.84%
Wukong7.90%7.81%0.09%52.00%53.63%-1.63%
Xerath2.60%2.44%0.16%51.34%48.80%2.54%
Xin Zhao13.60%11.09%2.51%53.82%54.30%-0.48%
Yasuo19.90%26.75%-6.85%50.06%51.22%-1.16%
Yorick1.70%1.55%0.15%47.68%47.97%-0.29%
Zac2.20%1.95%0.25%48.64%46.95%1.69%
Zed11.00%13.79%-2.79%46.95%48.33%-1.38%
Ziggs4.20%2.54%1.66%49.87%48.97%0.90%
Zilean1.70%1.47%0.23%48.77%46.42%2.35%
Zyra3.20%1.99%1.21%52.69%53.89%-1.20%


2. Blue side advantage

Blue side win rate for BMB: 52.9%
Blue side win rate for Blind Pick: 48.9%
Note that the discrepancy here may be caused by different matchmaking algorithms.

3. Game length

It seems that BMB games on average have comparable length to Blind Pick games. However, past the 20 minutes mark, it is possible that BMB games end slightly faster. Below is a density plot of game length of the two game modes.






Note: Player composition for the games above:

League TierBMBBlind
Unranked32.8%37.7%
Bronze18.4%16.6%
Silver27.9%26.8%
Gold13.1%11.8%
Platinum6.0%5.5%
Diamond+1.8%1.6%

Sunday, July 26, 2015

Are /r/leagueoflegends users really all challenger players? A quick analysis using self-reported flair data

There is a common meme on the /r/leagueoflegends subreddit that everyone is a Challenger (or more succinctly, challenjour). But what exactly are the compositions of /r/leagueoflegends users based on ladder ranking?

I mined flair data on /r/leagueoflegends for the last three days and got a sample of 1276 valid flairs from users (valid as in the flair is in the format <[summoner name] (region)>). After removing an additional 324 flairs in which the summoner name does not actually exist (or in a region without Riot API) and 146 flairs in which summoner name exists but has no ranked records, I am left with 806 flairs. The ladder distribution of these users are as follows:


In comparison, this is the ladder distribution for the NA server a few weeks ago:


It seems that /r/leagueoflegends users are mostly in Gold or Platinum. Comparably most players on the NA server are in Silver. This is probably not a surprising result since we can reasonably infer that the users on a discussion board for a game are more skilled than the average player population.

However, as with all analyses, it's good to note the limitation of the data at hands. Unlike /r/summonerschool, /r/leagueoflegends do not have a verification process built in place, so theoretically a user can masquerade as someone else with ease. Furthermore, many users choose to not report their summoner name as their flair so there is non-response bias within the data. Overall, there is room for a better study in the future.

Saturday, July 18, 2015

Technical Note on: How Long Does It Take for a Season 4 Gold Player to Return to Gold in Season 5?

This is a technical side note on How Long Does It Take for a Season 4 Gold Player to Return to Gold in Season 5?. This is written separately to provide some deeper insight on the analysis as well as giving me an opportunity to rant about certain things.

First of all, I don't actually have data on the exact number of wins when a Season 4 Gold player returns to Gold. All I have are snapshots of the entire ladder ranking at certain points in time - usually one snapshot per month. In other words, my data looks somewhat like this:


In this case, we see that this player was Platinum 5 on January 11th (Season 4) with 255 wins. On March 1st (Season 5), he is Gold 1 with 40 wins. 5 days later he is Platinum 5 with 52 wins. This means that this player managed to retain his Platinum rank within 40 to 52 wins. 

It's not always possible to find this range for each player. Sometimes, the left hand end point does not exist because the player was never seen in a rank lower than his Season 4 rank. For example, for this player below:


He is a Platinum player in Season 4 and was never seen (by me) to be lower than Platinum in Season 5. Therefore, he retains his Platinum rank within 0 to 43 wins.

On the other hand, some players do not have the right hand end point because he simply haven't played enough games. For example:


This player is Platinum in Season 4, but only has 5 wins and currently in Silver in Season 5. Therefore, the number of wins he needs to retain Platinum is between 5 to infinity. 

Overall, we see that the data I have gathered are far less than ideal. There are several reasons for this:

1. It's not possible to track more than one million players on a game-by-game basis since the Riot API and I both have limited bandwidth.

2. Even if it is possible to do this (I technically can since I have a production key now), it takes too much effort and space to store and manage the data.

3. The ranking data from the Riot API is actually slightly "bugged"; as far as I understand, due to some deep level architectural design, the data pulled can behave in unexpected ways. 

That being said, I am a strong believer that statisticians should always be ready to work with less-than-ideal data, since "ideal data" does not require statistics to analyze. To this end, it's fairly easy to see that this data can be analyzed using an interval-censoring model - which is exactly what I have done here. I do need to assume that the censoring is independent of the time-to-event, which is probably not exactly true since many players stop playing after achieving Gold 5; however, it is an assumption which I am personally comfortable with. 

There were more problems, however. To my best knowledge, R has a package for interval censored data called interval(see the published paper for this package here). Unfortunately, this package seems to be written with survival analysis in mind and works very slowly with large amount of data. The fact that it uses bootstrapped CI makes CI computation all but impossible for my purpose. It is probably possible to remedy this situation by avoiding bootstrapping (my impression after some cursory reading on interval-censored data is that it doesn't need to be bootstrap), but it may take a lot of time and effort. Therefore, CI is not plotted on the diagrams.

Solo Queue Ladder Analysis: How Long Does It Take for a Season 4 Gold Player to Return to Gold in Season 5?

One way to examine the effectiveness of the ladder is to look at how well a player can retain his rank after a reset. For example, if a player who is Gold is actually worthy of being Gold, we should expect to see this player to keep being Gold (or perhaps higher) after a ladder reset. Today, I am going to present some statistics on how the players' ranking have moved from late January 2015 (Season 4) to early July 2015 (mid-way of Season 5) - roughly a six months period.

First let's see how the players have moved. The table below presents the ladder transition from Season 4 to Season 5 for ~1 million players on the NA server who have ranked solo queue ladder records in both seasons.


For example, we see that after six months, 80.83% of Season 4 Bronze players remain in Bronze in Season 5; on the other hand, 53.94% of Season 4 Platinum players remain in Platinum whereas 10.6% of them are now Diamond or above.

Below is a more visual representation of the transition of these players.

Therefore, we see that more than half of the players who have records in Season 4 and played in Season 5 have retained their original rank (or better) after about six months. While this is interesting by itself, it does not take into account of the fact that many players are below their Season 4 ranking because they haven't played much. So for the next study, we will also take into the number of wins (number of games would be better, but they are not as readily available as number of wins via Riot API) into account. We are interested in, for example, how many wins it takes for a Season 4 Gold player to return to Gold (or higher) in Season 5?

As it turns out, the amount of wins required to return to Gold heavily depends on if the player was, say, Gold 5 or Gold 1. As you will observe below, a Gold 1 player from Season 4 will retain Gold in Season 5 far quicker than a Gold 5 player.

This is time-to-event plot similar to the one I used for the AFK analysis where our event of interest is to retain the same rank (e.g. Gold) from Season 4. The plot shows that the chance of a Season 4 Gold player staying below Gold in Season 5 (vertical axis) decreases as the player wins more games (horizontal axis). In particular, it suggests that a Gold 5 player in Season 4 has about 40% chance of staying below Gold after 100 wins (purple line); for Gold 1 players, this percentage is only about 2% (red line). Overall, as the player goes up within the Gold tier, he is able to more  quickly retain the Gold tier after a ladder reset. I believe this is good evidence that the League system is actually working fairly well.

For some of the technical notes on this entry, click here.