PDA

View Full Version : Team Fortress 2 Win Probability Calculator


AlphaChannel
02-22-2010, 06:08 PM
I've created a tool that calculates the probabilities of winning based on game situation. Based on the map, the point being fought over, which classes are up, and uber-advantage, the calculator gives each team's probabilities of capturing the next point, as well as the probability of taking the round.

It works by comparing the current game situation to every time that the same situation occurred in the past, and computing how often each team took the next cap or won the round.

The data comes from 187 pug/.na matches. Special thanks to Cinq for sending me the data.

I hope you find it useful.

Team Fortress 2 Win Probability Calculator (http://connett.net/tf2/wp/)

NeoRussia
02-22-2010, 06:14 PM
would be amazing if you could calculate players individually. Use my pug.na name if you can I know it must be possible. Great work anyway.

Atavax
02-22-2010, 06:16 PM
hmmm, if one color has all but the last point and both teams have an ubercharge rdy. and if the defending team's demoman is dead. the offensive team has a better chance at winning if their demoman is dead then if hes alive...

AlphaChannel
02-22-2010, 06:45 PM
Thanks for the feedback, guys.

NeoRussia: For this tool I'm just looking at the aggregates. My goal here was to compare the class roles and trends when pushing/defending. I do have some ideas for computing probability using individual stats. I'll be posting more about that to my TF2 stats blog (http://tf2data.blogspot.com).

Atavax: In the situation you described, double check the team names in the output box. I get that the situation indeed improves for the attackers. The names flip so that the mid-owners are on top. That is probably confusing in retrospect. I'll try to make it clearer.

Atavax
02-22-2010, 07:30 PM
output box when both have ubercharge, red has demoman dead but everything else alive, blue has everyone alive and is on red's last point:

"Win Probability
P(Blue Caps): 75% ±9%
P(Blue Wins Round): 89% ±9%
P(Red Caps): 25% ±9%
P(Red Wins Round): 11% ±9%"

outboard box for same situation as above, except with blue losing their demoman:

"Win Probability
P(Blue Caps): 81% ±21%
P(Blue Wins Round): 100% ±21%
P(Red Caps): 19% ±21%
P(Red Wins Round): 0% ±21%"

AlphaChannel
02-22-2010, 07:54 PM
Ok, I see now. This one is a case of small sample size. With a sample of "only" 187 games, unfortunately strange inversions like this can occur. I put in a margin of error term because I knew the data might have reversals, especially in the rarer lineups. It's probably a small comfort, but the difference is well within the margin of error. It'll get better with more data, and I'm always looking to add more.

djfivenine
02-23-2010, 01:44 AM
Haha very fun to play with. NIcely done. But individual players are the biggest variables in TF2 and it is so damn hard to put percentages just on classes being down and stuff...

Either way, very fun, nicely made!

JonDigweed
02-23-2010, 01:31 PM
Wowza! I'm loving this.

I have a few questions:

1) How do you determine when a class dies at a certain point? For example, during the mid-fight, at which point does a demoman death constitute a mid-fight death?

2) Do you plan to link this up to the TF2lobby stat system? Or any stat system?

3) How much work is involved in an export feature? I'd love to be able to have a link to send to people where certain settings are saved and the results are displayed.

---
I see this tool being potentially useful for competitive teams. If you were able to hook this up to a team's scrim/match data, off the top of my head I can tell you some great applications. Some ideas:

1) To track the win/fail factor of say a mid valley push

2) The overall progress of a team's skill level. (i.e. You can statistically say your team has won more and more badlands mid-fights over the course of 1 month)

3) To make judgement calls on retreats/pushes

The last point is an interesting one because currently players can tell when it's likely that a push is going to fail. i.e. Pushing last on badlands without an uber when the enemy team is 6 up is a bad push. You would want to retreat when you lose your demoman on mid.

However, I see this bringing awareness to new situations. Should you try to re-take spire if you have a scout and soldier up? As opposed to having a demoman and a scout up?

Anyway keep up the good work!

AlphaChannel
02-23-2010, 06:27 PM
Sigh, I had a whole response typed out that got lost to a login timeout. Here I go again.

djfivenine: I'm planning to work individual stats into the mix in some fashion. I'm getting lots of great feedback, and my todo list is growing =). Thanks for the compliments.

JonDigweed: The fights are defined as the spans of time between successive captures, and the mid-fight is everything before the first capture. So if the demo dies before the capture, that's a mid death. After the capture is considered part of the fight for the next point.

I'd love to collaborate with the tf2lobby guys. I know they're very busy right now with feature coding, and I'm getting lots of great suggestions to implement. I hope it'll happen, but maybe not right away.

I'll add bookmarking/linking support to my todo list. It should be pretty straightforward.

Tracking the success rate of specific strats is more difficult than it sounds because the game logs have no concrete indication of when a specific strategy was employed. It would have to be manually annotated in some way.

I plan to release my code so that teams could build their own databases of their matches if they wish. The code is fragile to incomplete logs right now.

And the kind of questions you raise at the end were actually my original motivator for this project, to inform on the likely payoffs and values of various plays at certain times. I'm definitely going to be exploring some of these.

Thanks for the encouragement everyone. It's nice to know people think this is cool.

2thumbs
02-24-2010, 08:45 AM
Alpha - Firstly, awesome job, man. Really. Something else that may make this tool more functional. Given a larger sample size...Months and months worth I mean:

I wonder if it could be plugged into a HUD such that it would show you A stop light rating for your success odds. If it's your 6 wih uber vs there 3 without; Green Light.. even teams yellow, if your team is dom'd in the situation red light. Effectively and simply telling you to push/retreat. It could use the percentage ratings also. So if you're at 50% and your scout drops you know where your chances lie now..

I'm no coder, but it's an idea.

Again, kudos on your hard work and beautiful results.

brainpower4
02-24-2010, 09:06 AM
I don't think there's any way for a pluggin to tell if they have an uber ready. If there was, and it told you, that seems more than a little like cheating.

2thumbs
02-24-2010, 09:47 AM
I reckon that's true. Just brainstorming aloud.

Elandriel
04-17-2010, 12:49 PM
Haha, nice. I saw the discussion above so I know it's caused by the low amount of data on rare events but I just thought this one was also funny^^

When blu is defending the last point and only the demoman is left he has more chance (5%) of winning when the entire red team is up but he's completely screwed if either a scout and a soldier or just the red demoman are remaining.

Fish #641
04-17-2010, 01:03 PM
Can we get this to sync with lobby data?

LeoA
04-18-2010, 05:44 PM
According to this you have a better chance of winning if at mid you have your med down, rather than a demo down. It kinda makes sence but not really =P

defiance
04-18-2010, 06:07 PM
If one had uber, then it would be a lot different. Often times (I know I have been guilty of this) teams worry TOO much getting the medic, or think that having a medic down is the end all to mid and you win. We just saw it in the eMg match, if banny went down fast, eMg lost mid.

NeoRussia
04-18-2010, 06:08 PM
According to this you have a better chance of winning if at mid you have your med down, rather than a demo down. It kinda makes sence but not really =P

this may be due to aggressive strats such as when 2 heavy classes jump valley, but die only to get a medic pick, and get wiped with the enemy medic down. On badlands and maybe granary not too sure you don't really get an uber in time to save the middle point. Also before a team dies at middle a soldier may hide and jump on the medic at the last moment.

esseph
04-21-2010, 08:55 AM
this may be due to aggressive strats such as when 2 heavy classes jump valley, but die only to get a medic pick, and get wiped with the enemy medic down. On badlands and maybe granary not too sure you don't really get an uber in time to save the middle point. Also before a team dies at middle a soldier may hide and jump on the medic at the last moment.

I don't remember who it was we were playing, but out of 5 pushes to mid, I think we got the med 4 / 5 times. The demo went down 3/5 times.

We still not only lost mid, but got rolled every round.

Sure, we got their med. By then though they had simply done such a rediculous amount of damage to our team that we couldn't recover. They we just using a super aggro strat and then all they had to do was build up 1 uber and push into last.

What we SHOULD have learned there is about three-fold.

(1) Killing their medic at mid is irrelevant if we can't protect ours along the way.
(2) Killing their med is not effective. We should be focusing on those soldiers, knowing their going to jump every time on us. One thing we could have done is attempted a suicide run on their demo as a worst case scenario, let them take mid, and then push back on them trying to go through choke. If our roamer is down but their demo is down, the calc says we should retake mid if all other things are equal. Sometimes teams are just so proficient with a mid strat on a certain map that it's often better to just concede(sp?) mid from the beginning and work against them in a stronger positon for us, and after the game we can watch the stv demo and figure out how to prevent their strat next time, so next time we can counter it on the fly.
(3) Med picks can win games, but not if it's going to cost your team 100 health each to do it just to get rolled. There is a time and place for med picks, and it's much cooler to simply wipe the enemy team from the beginning and kill their med as he flees in terror.
(4) Force early pops before they could push last and then counter their multi uber with a single ubered soldier or demo and push against them. Have your team push in right as your uber expires to help clean up. Do enough damage and they'll either die or be forced to retreat. Just because we kept getting wiped at one point doesn't make it impossible to regain cap points, you just have to be smart about it and not get freaked out.

defiance
04-21-2010, 11:26 AM
If your soldiers were jumping and getting their medic/demo each time and you still lost mid every time, then your scouts and demo are doing something wrong.

brainpower4
04-21-2010, 11:57 AM
well if the scouts were getting out DMed repeatedly, that sounds about right. Soldiers jump, only scouts protecting your med, their scouts beat your scouts, med goes down, no one is around to protect the demo, he goes down, team wipes.

-fine
04-28-2010, 07:36 PM
Wow, that's pretty cool. It's fun to play with

Iller
04-30-2010, 12:10 PM
This was interesting. So the probabilities are based on real matches ?

I guess you need much more matches to have enough statistical data on every situation though. The idea is really nice however, and if you give this some time and input more and more data this could be very useful.

Right now you get some really strange results using the calculator.