Skip to content

ChristianFMadsen/tf2_combat_efficiency_predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Predicting outcomes of a Team Fortress 2 match

When playing a competitive match in Team Fortress 2 (TF2) server plugins collect data on each individual and uses this to produce a log file displaying a range of different metrics such as kills, deaths, damage done, heals received and so on. These logs are uploaded to logs.tf where they can be viewed as well as downloaded through the API. As I am an avid TF2 player myself I thought it would be interesting to see if I could combine some of the metrics in the logs into a new metric which served as a good predictor of the match outcome.

Competitive format and gamemodes

This analysis is concerned with the 6v6 format of competitive TF2 and the matches used for the analysis are played under the European ruleset. There are some differences between regions in terms of ruleset but it isn't drastic differences. There are two gamemodes being played: Capture Point (CP) and King of the Hill (KotH). The CP gamemode as the name suggests is all about capturing points which can be done by standing on them. All CP maps consists of 5 capture points and when one team has captured all 5 they win a round. To win the entire match it is first to 5 rounds or whoever has the most rounds when the time limit of 30 minutes expires. In the king of the hill gamemode there is a single capture point in the center of the map and in order to win a round a team must capture and hold the point for an accumulated time of (typically) 3 minutes. In king of the hill the team to win a total of 3 rounds first is the winner of the match. So in its most simple form the game is all about capturing capture points however to do that you must force the defending team to retreat typically done by inflicting damage which can lead to kills or leave defenders hurt forcing them back.

Combat efficiency as a predictor of match outcome

The logs for a match keeps track of how much damage each player does, how much damage they take and how much healing they receive among other things. These metrics are very important as they influence how each player and team plays. Ideally you would want to maximize damage done and minimize damage taken as well as healing received hence I will define a new metric called "Combat Efficiency" which is: (damage done-damage taken)/(healing received). My hope is that whichever team has the highest combined combat efficiency is also (usually) the winner of the match. Using this approach and analyzing a 1000 matches I find that it correctly predicts the winner 77.7% of the time. Now there is of course a lot of intricacies of playing the game which is not captured by metrics and this is admittedly a crude way to predict a match winner. Despite this it correctly predicts the winner over 3/4th's of the time which I was pretty impressed by.

Combat efficiency edge cases

As we have seen combat efficiency is a pretty good predictor of match outcomes especially considering how crude it is but it isn't perfect. Suppose you play very bad i.e. you are not doing a lot of damage but you are taking a lot of it and because you take a lot of damage you receive a lot of heals. That means that your combat efficiency is negative which generally reflects bad performance however if you receive a lot of heals to boot then your combat efficiency essentially improves even though you're investing a lot of heals into a player who is not dishing out a lot of damage. In the limit of infinite healing received your combat efficiency tends toward zero indicating a kind of mediocre performance. However as healing is a limited resource this means that the rest of the team aren't received much and if they can somehow manage to play well i.e. do significantly more damage than they take then it could still result in a won match. All of this is just to say that there is a specific theoretical case where combat efficiency doesn't really capture how bad the performance is. With that being said I do think that this is rare since if you take a lot of damage you usually die a lot which means that you can't hog all the heals.

Other metrics as predictors?

Combat efficiency was the first and most intuitive idea of a metric that popped up however I did try a bunch of other ways to combine damage done (dd), damage taken (dt) and heals received (hr) but they all turned out to have worse predictive power compared to combat efficiency. The other metrics I tried to use were: dd/(hr - dt), dd/(dt * hr) , dd*hr/dt, dd/(dt + hr). This was mainly to try to fix the edge case for combat efficiency mentioned above however they all introduced their own specific edge cases and turned out to perform worse than combat efficiency.

Releases

No releases published

Packages

No packages published

Languages