How SELFISH can you be: League of Legends Kills and Assists
Spoiler alert: we’ll find out which player position has the biggest impact on winning or losing! What mental metric can we use in-game to predict if we will win? Scroll down to access my Google colab file.
Anyone who plays multi-player video games understand that there are two types of glory: individual glory and team glory. But let’s start with the basics.
(Side note: this article can be compared to the process of discovering a Key Performance Indicator by using domain knowledge to create new performance metrics! Transferable skills for the job! Cool!)
Is there some way to self monitor and predict if you’ll win the game?
Each game of league is, on average, a commitment of 30 minutes. That’s a lot of time to think in the midst of a fast-paced strategy like League of Legends.
(please check this out on my original website augurnauts.com)
League Basics
Here’s a layman’s overview of the structure of a typical League game:
- square playing field
- two teams, red at the top and blue at the bottom
- each team has five positions:
Top, Middle, Jungle, Support, ADC
- goal: destroy the other team’s Nexus first
Why League? Why should I care?
League is ideal for game theory analysis
Thanks to Oracle’s Elixir we have extremely precise game metrics to work with; there is little left to human error when an entire game can be recorded and the player stats are recorded by the computer algorithms. No errors due to measurement tools, no eyes squinting at a screen to jot down the approximate time something occurred, just plain numbers automatically registered by the system. Parfaît! (If you really wanted to watch a video replay of your game with your own eyes, League has stats and video archive of games going back several years here, although as of today, May 29th 2010 the sight seems to be down.)
Video games are dominating the economy
The advent of the digital age has radically changed the dynamic and composition of our economy; it’s a small world after all when you can access people and products from the opposite side of the globe in mere seconds. Here’s a comparison (1, 2) of traditional media behemoths (the box office movie industry and the music industry) compared to the gaming industry:
Video games as the future of sports entertainment and gambling
As more people are hermit-ing in their homes (whether it’s due to Coronavirus or a general trend towards introversion) or connecting with long-distance friends over the internet, it’s safe to say people are doing more online and that this audience will only increase. As of 2019, the population of people who watch esports is equivalent to the population of the United States of America.
Many people rave about Ready Player One for a reason: it’s perhaps augur of a digital age to come where someone’s gaming prowess can have heavy real-life consequences (2012: Knight Capital Group loses $440 million in 30 minutes because of a glitch in their algotrading); in Ready Player One, “while the world outside of the OASIS [the digital environment] is falling apart, the virtual world remains — yup — an oasis, a utopian expanse where anything is possible and everyone is emancipated by their online presence.” Some of the main narratives going around that rationalize the deluge of digital populations is the idea that, with an online world, external factors can be minimized and dynamics are streamlined through algorithms and one’s familiarity with the rules, the gameplay and computing resources- all from the comfort of your home without having to change out of your jammies.
What do you actually have to do to win??
From my experience playing league (I started playing the fall of 2014), I already had an in-depth understanding of the relationships between player stats, so this background understanding helped me hone in on which aspects where the most significant. I’d like to believe this enhanced my understanding of the available data compared to someone who has never played league before; there are definitely super useful guides that spell out how to play, but you only really understand the ramifications and difficulty of executing such playing principals if you have actually played.
I chose the data of the 2019 League World Championships because these players have specialized for years are are most likely to exhibit the experience and player statistics necessary to demarcate the difference between winning and losing; when teams are new the results tend to be more up to chance, but with worldwide championships there is less random adverse selection but rather a cream of the crop that gather together to duke it out on a world stage.
Deciding on which metrics to monitor
Measuring other players: what numbers are available to me?
Some metrics are those that every player can view [pressing the Tab button during game play] regardless of what team you’re on; here’s an example of an in-game tab:
- k, the number of kills a player is credited with
- d, the number of times a player has died
- a, the number of kills the player has significantly contributed to
- minionkills, how many computer monsters you have last-hit- each last hit rewards the player with gold; this minion kill number is important for indicating how much gold a player has and how well they time their attacks
Measuring yourself
In game you can find your own metrics here:
When you’re in the middle of playing, you need to be able to make decisions quickly. If one player’s stats are relatively weak, we may want to focus on that player for killing to boost our overall team stats, since this will demoralize our target into being defensive and it will boost all allies’ in-game experience levels.
Quick, in-game metrics help us decide who to attack, who to avoid one-on-one, and generally inform us what we’re up against. We need to make fast and easily accessible calculations, thus, we look at some form of ratio.
Initial exploration of data
There are so many metrics to choose from; of the 90 metrics Oracles Elixir had sourced, I initially explored 46 metrics
with a Seaborn pairplot that took me about 25 minutes to populate in Google Colab:
Why Seaborn pairplots?
These pairplots provide three immediate visual telltale signs:
- a hue of your choice (select a categorical variable; I chose “result” where orange is a statistic in a game that is won, and blue is that of a game lost).
- many scatter plots comparing two variables at once; compared to excel, Seaborn pairplots are so much more efficient, and you’d know that individually creating so many scatter plots is extremely tedious and prone to error. These scatter plots tell the relationship between variables and, combined with the win/loss hue, can visually describe economies of scale and time.
- density plots that compare the distribution of hues (winning statistics and losing statistics). Close overlap implies that there isn’t much statistical difference between the categories.
This picture is intentionally not focused because these variables are not specific enough.
I quickly noticed sandwiches of death that deterred me from using certain variables for analysis: There were two main clusters:
- lower left corners of the scatterplots: shorter game times mean that the player stats have yet to develop and become distinct, like a longer game would enable
- higher right corners of the scatterplots: these reflect longer game times, which would be pointless for trying to use for self-monitoring and prediction.
We want to know things early on!!
Team fight tactics
(Not to be confused with League’s other popular game play Teamfight Tactics)
Each team is a portfolio of skills: magic damage, attack damage, self-evident champion functions like the assassin (dealing heavy damage quickly and in bursts), tanks (have the ability to take heavy damage while your teammates engage), etc. Although the strategy, function and effect of each player position is unique with an infinite combination of abilities, there are general principals of playing that everyone tries to abide by:
- die (d) as few times as possible
- kill (k) as much as possible
- advance into enemy territory as much as possible when opponents are absent (read: dead or coming back from base [preferably because they died] or roaming elsewhere)
- last hits, the ones that get you credit for killing a player, are the money makers and enable you to buy items to level up faster
After squinting at the zoomed in picture of 46 metrics worth of pairplots for the amount of time it takes fermented bread to rise, I had realized I seriously needed to narrow down my options: why not evaluate on how selfish something can be?
There were several metrics that were derivative of core metrics, like okpm (opponent kills per minute that took the number of kills your corresponding position opponent had and divided that by the minutes of game play) or earnedgpm (earned gold per minute, with starting gold and inherent gold generation removed; gold is rewarded for kills and kill shots and gold aggregating player items and is not the easiest number to keep track of, nor is it something you can view of all players).
Still, some metrics like okpm and earnedgpm are not easily calculated in-game and these numbers are not accessible by everyone.
We want to mentally and quickly calculate how good is the opposing team and how relatively good YOU are.
Team Variables
Because team statistics are aggregate of individual positions we can expect their density plots to be relatively more normally distributed than an individual position’s distribution.
These tell us that teams tend to well when there are overall
- low deaths
- high kills
- high assists
- low KAR
NULL HYPOTHESIS and IMPLICATIONS: right off the bat we can see that the winning distributions (orange) are generally more normal and have smaller standard deviations than the losing distributions (blue); this may be something to explore with t-statistics to determine whether this distribution is significantly different; if the KARs of losing and winning positions are not significantly different from each other, then we accept the null hypothesis that KARs do not make a difference in a game’s outcome. If the winning distribution has a higher concentration of low KARs, then this means a team will be more likely to win if they engage in more team fights than if they fought individually, which would contribute to a higher KAR.
In order to understand the makeup of the winning team’s distributions we need to look at their underlying distributions, those of the other positions of Top, Middle, Jungle, Support, ADC. From my domain knowledge of game play, I know that KAR is most distinctive for Top and Support Positions, so we begin with analyzing these positions first.
First I will explain how I calculated KAR and then I will go into the KAR for Support and the KAR for Top:
Kill to Assist Ratio (KAR)
Although the personal glory of getting the most kills and “carrying” the team to victory sounds appealing for your self, I think that a team is more likely to win if players generally have a lower Kill to Assist Ratio.
What ratio of kills to assists is the winning golden ticket? Stay humble and bet low.
Notes on cleaning the KAR values
Some KAR calculations returned inoperable values like NaN, when both ‘k’ and ‘a’ were zero, or inf, when ‘a’ was zero. These only caused issues on individual position density plots, rendering them obsolete because of the ‘inf’ (infinite) value; to resolve this, I filtered the datasets for KAR’s less than or equal to one; thankfully only 3 rows were discarded. NaNs, of course, did not affect the ability for the data to be graphed, and therefore did not have to be filtered out.
Filtering to exclude infinite values , we see that only three observations were lost out of 184, a relatively insignificant loss of (useless) players.
Support Position KAR T-test
Support Position Variables
We can see a clear difference between Support Position Density Graphs of Winning (orange) and Losing (blue) teams:
- k (kills) are staggered
- winning Support assists are more concentrated
- winning Support KARs are much more concentrated
SNS pairplot
How significant is the KAR for a support? If we only look at assists, we would be disregarding the support’s tendency to take kill shots and thus it would not reflect their tendency to go solo or skillfully time their attacks in accordance with their teammates (who are generally supposed to take the kill shot to level up and deal more damage).
Winning supports have a relatively higher concentration of low KAR values than losing supports, which are more widely distributed. Is this significant enough?
2-sample T-test test for comparing Winning and Losing Support KARS
Because the t-statistic of the average kill assist ratio for winning Support positions has a high absolute t-statistic and p-value below .05, we can strongly reject the null hypothesis that the winning Support position KARs is not significantly different from losing Support position KARs; a lower KAR is indeed strongly associated with winning.
What about other positions?
It’s easy to easily identify that there is a major difference in the density distributions of winning and losing KARs of the Top position, so I conducted another T-test in a similar manner; all other positions had relatively unremarkable differences in distribution.
2-sample T-test test for comparing Winning and Losing Top KARS
Because the t-statistic of the average kill assist ratio for winning Top position has an extreme absolute t-statistic and p-value far, far below .05, we can also confidently reject the null hypothesis that the winning Top position KARs is not significantly different from losing Top position KARs; a lower KAR is strongly associated with losing, especially for a Top position. This suggests that Tops need to be more risky and engage in quick and heavy solo play, more-so than other positions.