Overwatch Data Visualization
Exploratory data analysis and visualization of Overwatch ranked data
June 1, 2018
Table of Contents
In a previous post I talked about an Overwatch dataset I’ve been collecting from my ranked games. Before running any statistical analysis on the Overwatch data, it is usually a good idea to explore and visualize the dataset. This helps us get a general sense of data patterns, which can help generate hypotheses that can then be tested with more formal statistical models.
My own personal philosophy about data visualization/exploration is to approach it with targeted questions of interest. It is all too easy to fall down the rabbit hole of plotting absolutely everything, without a sense of what the goal is. Therefore, in each section I’ll be identifying a key question that I want to answer, and creating plots that address that specific question.
Rather than an in-depth exploration of the data, this post serves more as a Python/matplotlib tutorial demonstrating how to create different types of plots in service of answering specific research questions. This demonstration is particularly valuable in the case of matplotlib as plotting can be very verbose due to its low level API.
The overarching goal is to better understand how I perform in the game. I’ll be showing how to create plots (primarily) using matplotlib, how to wrangle data into a plottable format, calculating and plotting aggregate statistics, and quantifying relationships with correlations and regressions.
Imports and loading data
I’m using the dataset I described in a previous post. You can find all the required data files in my GitHub repo or on Kaggle.
Is there performance improvement over time?
To identify whether there is improvement over time, we can simply plot skill rating (SR) over time for each season.
We can either use a groupby
and create a plot for each season, or plot all seasons on the same graph (which I’ll show here).
Pandas offers some plotting tools, e.g. df.groupby('season').plot('Game #', 'End SR')
, but I generally find I have much more control when using matplotlib directly.
A linear fit is likely not the most appropriate here, but it’s good enough for approximating a crude trend. Clearly I went on a crazy losing streak in Season 3, but Seasons 4 and 9 generally show improvement over time. It makes sense that improvement in Season 9 was not as rapid as Season 4, as I had just returned to the game after a long break and was trying to find my footing again (new characters, new maps etc.)
Which role do I perform the best on?
When it comes to role selection, I usually fill when playing ranked, and that mostly means I end up playing support or tank. So first, we should see how many times I played each role, and then look at win percentage per role.
Note: role data was only available in Season 9
Suspicion confirmed: filling means playing support or tank. My highest win rate comes from playing the Defense role (mostly Junkrat), although the win % is biased due to the low number of total games played in that role. This is followed closely by playing Support, and the win % is more stable due to the larger number of games (owing to my new-found obsession with playing Moira). These ~50% win rates are in line with what Blizzard tries to enforce with their matchmaking.
Which game mode takes the longest to complete?
Do certain game modes take longer to play than others? And which specific map, within each game mode, takes the longest? To answer this, we first need to take the Match Time
variable (which was only available for Season 9) and convert it minutes for easier plotting.
There is generally a pretty good distribution of maps, although some of the maps (e.g. Dorado, Nepal) didn’t come up very often. I would have thought there’d be a more uniform distribution of maps – this is a good candidate for a Chi-square test to check the likelihood of getting a distribution like this, but I’ll save that for another post.
There is quite a range in game durations across the different maps, with Control maps (e.g. Nepal, Lijiang Tower) generally finishing faster than Assault/Escort maps (e.g. King’s Row, Numbani). Within each game mode, Escort maps seem to have the largest variability, with Watchpoint: Gilbraltar having a game time (almost) as short as some Control maps, and Dorado taking longer than some of the Assault/Escort maps.
Which game mode has a higher win percentage?
Most game modes have around 50% win rate (as expected), but Assault maps (e.g. Hanamura) have a slightly higher win percentage at slightly over 60%.
Does SR gain correlate with the SR difference between my team and the enemy team?
If we win a game, we would expect to gain more SR if the enemy team has a higher average team SR (i.e. we won against a better team), and vice versa. To check this, we can plot the SR difference between the two teams against the SR gain after a win or loss.
Note: np.polyfit
doesn’t handle missing data very well, so we need to grab only the rows where both variables of interest have valid values
The way the X-axis works is that positive values (> 0) are when our team has a higher SR than the enemy team. Negative values (< 0) are when the enemy team has a higher SR.
We hypothesized that winning against a better team should result in greater SR gains, and losing against a better team should result in smaller SR losses. So in the winning case, we would expect a negative relationship. In the losing case, we should expect a positive relationship.
The graphs show the expected pattern between team SR difference and SR gains/losses. However, the size of the relationships are small, particularly in the case of winning games. This suggests that, while team SR differences are important, there are other factors that play a role in determining SR gains/losses.
Does individual performance influence SR gain?
In addition to team SR differences, another factor that may influence SR gain is how well you perform in the game. For example, does the amount of healing you do affect SR gain when playing a support character?
Overall, it seems there is a relationship between how much healing you do and how much SR you gain after winning a game. This is clearest when looking at the healing medal received. There are of course other factors that determine how much healing you’re able to do in a single game (e.g. how many times you died, which character you played), but the positive trend suggests that individual performance does have an influence on SR changes.
Do deaths affect SR gain?
Dying during a game is one of the worst things that can happen as you cannot contribute to team fights, thus increasing the likelihood of losing the match. But does the number of times you die also affect how much SR you gain after winning a game? For that, we can plot number of deaths in a game against the SR change for that game (the following is for won games only).
There seems to be a very clear relationship: the more times you die in a game the less SR you gain for a win. So stop dying!
Now, causality isn’t clear here, because the more you die the less you can contribute to team fights, and it’s possible that it’s the reduction in contribution that’s causing the reduced SR gain. We can map a sequential colormap to the points to see whether there’s a relationship between deaths, SR gain, and contribution (healing done in this case)
If increased number of deaths is causing reduced healing contribution we should see a left-to-right gradient that is coloured white-to-black (i.e. if you die a lot you’ll do less healing). However, this doesn’t seem to be the case, which suggests that deaths and contribution are not related. Instead, what we see is more of a bottom-to-top gradient that goes black-to-white. This suggests that the more healing you do, the more SR you gain after a win, which supports the analysis in the previous section.
However, a confound here is match duration. It’s likely (and intuitive) that you’ll simply die more during longer matches, which is supported in the following graph, where longer matches are associated with more deaths.
We need to control for match duration in some way as it has a very direct relationship with number of deaths. So instead of looking at total number of deaths, we can calculate number of deaths per minute to factor out the confounding effect of match duration, and see how that is related to SR gain and healing done.
After accounting for match duration, we still see the same relationships as before. The more frequently you die the less SR you gain after a win. Furthermore, frequency of deaths is not related to total healing contribution during the match, and better individual performance (increased healing) is associated with larger SR gains.
There are many other ways to explore this data, and many other questions that I have not addressed, but hopefully this post provides a brief demonstration of how to create visualizations to answer specific questions.
You can find additional analysis of this data in my other Overwatch posts.