|
|
Making the Computer Crunch Numbers
Last post 09-25-2008, 8:27 PM by DClown. 41 replies.
-
08-05-2008, 1:18 PM |
-
iamtienpham
-
-
-
Joined on 06-08-2008
-
-
Posts 77
-
-
|
Making the Computer Crunch Numbers
Being extremely interested in this game and being math guy, I felt the need to calculate the percent chance of roll outcomes. Looking in to the ways to do it by hand is rather time consuming and didn't allow for what I wanted to do. So the natural solution is to write a program and make the computer do it for me. Basic concept here is to make the computer run thousands of dice rolls in the matter of milliseconds and give me a fairly accurate percentage of outcomes.
Anyways, running a trial on Hodoon versus Gorebelly, limiting to one attack against Gorebelly to see the likely outcomes.
Including Crit modifier. Accurate to within +/- 2% (closer to 1% I think, but just to be on the safe side due to rounding). Program is currently being coded in Visual Basic 2008 Express Edition. Limited at the moment to only one attack, and very little info about "on crit" effects. So the program is far from useful.
Using Hammer of Naaru (4 attack against 3 defense, on crit 4 magic against 1 resist)
0 Damage 32% 1 Damage 24% 2 Damage 20% 3 Damage 12% 4 Damage 7% 5 Damage 4% 6 Damage 1%
So it's not a great attack on Gorebelly, only about 45% chance of doing 2 or more damage.
Using Hammer of Wrath (5 magic against 1 resist, on crit damage +1, stats based on comic con demo report by Corle http://entertainment.upperdeck.com/WOW/COMMUNITY/forums/thread/1323113.aspx)
0 Damage 2%
1 Damage 8%
2 Damage 20%
3 Damage 28%
4 Damage 26%
5 Damage 13%
6 Damage 3%
Much better overall and consistantly able to deal 2 damage or greater close to 90% of the time. Not to mention tick costs.
Now that was the data, now the real topic. I'm at a moral decision. I'm not sure if such a program should be made public. I would definitely be using it myself for my theorycrafting, but I do see problems that can arise from such a program. Such as during a match, a player may use such a program to accurately predict dice roll outcomes. Clearly, if used correctly will get said player an advantage. Yes it would be an advantage, but is it an unfair advantage. For example more experience being a fair advantage, and using steroids being an unfair advantage.
If I were to release a program like this would it be a good idea for the state of the game. It is merely a tool, and how useful the tool is highly depends on it's user. So for an experienced player, instead of wasting time thinking about the chances of success for a move, it could be given in an instant. More time to think about strategy instead of chances. For a not-so great player it could be completely useless.
To focus thought on the subject, after looking at the data, did it change your perception on Hodoon's chances against Gorebelly? Taking the program a step further, after crunching more number, based on armor and resist I am able to determine the best chance to deal X amount of damage with my available attacks and abilities. Is it an unfair advantage?
WoW Minis Unofficial Calculator: In Alpha Stages
Download Link: https://sourceforge.net/projects/wowminiscalcula/
|
|
-
08-05-2008, 1:25 PM |
-
Raktosman
-
-
-
Joined on 02-27-2008
-
Elwynn Forest: Goldshire
-
Posts 372
-
-
|
Re: Making the Computer Crunch Numbers
it would be pretty cheaty...to know whether to attack or not
I serve no man. I kill he who wishes me to serve him.
level 24 blood elf warlock: raktos: demon soul
by way im sauronspawns brother
|
|
-
08-05-2008, 2:05 PM |
-
BlueRider
-
-
-
Joined on 08-30-2006
-
San Diego
-
Posts 4,379
-
-
|
Re: Making the Computer Crunch Numbers
1. That's not cheating, that's strategy. 2. While a good idea, you're going about it in the wrong way. Instead of making "random" rolls and calculating probabilities based on that, use math to find the actual probabilities. Lets take Hammer of Wrath for example. You're rolling a total of 6 dice(5 for the attack, 1 for the defence). Each die has 10 sides, so thats a total of 1,000,000 outcomes. Each attack die has three possible results; a miss(1, 2, 3), a hit(4, 5, 6, 7, 8, 9), and a crit(10), while the defense die only has a miss(1, 2, 3) or a hit(4, 5, 6, 7, 8, 9, 10). There are two possible ways to deal zero damage. The first is to roll a miss on all the attack dice, the second is to roll one hit on the attack dice and a hit on the defend die. There are three ways to get a miss on any die, so the total number of ways to roll all misses is the number of ways to miss with a die times the number of dice you need to miss on times 10 because you need to take all possible rolls of the defense die into account even though it doesn't mater. So you end up with 3 * 5 * 10 = 150. Now you figure out all the possible ways you can get 1 hit on the attack and one hit on the defense. One hit on the first attack die and misses on number two through five would be the total number of ways to roll a hit(6) times the total number of dice you need to roll a hit on(1) times the total number of ways to roll a miss(3) times the total number of dice that need to roll a miss(4), or 6 * 3 * 4. But you have to take into account every possible combination, ie. hit on the first die miss on the rest, hit on the second die miss on the rest, etc. There are five total dice you can roll a single hit on, so you multiple all that by 5. So we're at 6 * 3 * 4 * 5. Now we multiply all that by the total number of ways to roll a hit on the defense die(7). 6 * 3 * 4 * 5 * 7 = 2,520. Now we add the two numbers together and divide by one million to get the final chance to deal zero damage. (2,520 + 150) / 1,000,000 = 0.267%. Rinse and repeat. Someone correct me if I messed up my math somewhere. It's been a while since I've done probability stuff, but that's the basic idea. 3. Python! Learn it, love it. No more of this Visual Basic nonsense. :P
====================== Sweet Zombie Uther! It's a dirty job, but someone has to do it.
|
|
-
08-05-2008, 2:49 PM |
-
iamtienpham
-
-
-
Joined on 06-08-2008
-
-
Posts 77
-
-
|
Re: Making the Computer Crunch Numbers
Working in pure math instead of simulations is rather hard, and I believe it would take much more work mentally at least. Under the reason of statistics, taking a random sampling of say 10,000 rolls, you are able to come up with a reasonably accurate guess to within a few percentage points.
The main reason I went with a statistical and simulation approach is to allow for the program to be applied to more complex situations such as say the chances of Hodoon and Ruby to take out Gorebelly in one tick. Or even more complexity of predicting chances of success with multiple attacks and multiple targets (possible appication in determining attack strategies). In terms of computing power billions and trillions of rolls and recorded outcome it barely would stress the computer.
Another reason is to deal with "on crit" effects. Currently there are only a few known but they greatly increase the amount of possible outcomes. Which is missing from the above post by Bluerider (which is a great explanation of probability). Again, it's made worst by the inclusion of multiple attacks and targets.
As for the programing language... I'm a nub at it. It's not quite my professional field, the idea of learning another programing language is rather daunting, so I'll have to pass on it.
WoW Minis Unofficial Calculator: In Alpha Stages
Download Link: https://sourceforge.net/projects/wowminiscalcula/
|
|
-
08-05-2008, 2:59 PM |
-
Foolproof
-
-
-
Joined on 11-25-2006
-
Insane Fort Wayne
-
Posts 702
-
-
|
Re: Making the Computer Crunch Numbers
Somebody say "you're probabily right"
Seriously
please
Nothing is foolproof
|
|
-
08-05-2008, 5:06 PM |
-
Jacquen
-
-
-
Joined on 07-03-2008
-
Columbus
-
Posts 9
-
-
|
Re: Making the Computer Crunch Numbers
I get bored pretty easily. I made a spreadsheet one day predicting odds to hit, and to miss based on dice rolled. Its at the moment outdated because it was made with the assumption 1-4 = miss, 5-9= hit 10 = crit which was later found to be not quite right. Its actually much simpler than you would think to calculate. All you really need is a basic grasp of how to apply a paschal triangle to the multiplication of a base percent... that probably makes no sense at all to some, and perfect sense to the rest. In any case the easiest way to find a average attack...
assuming hodoon's 2 hander against gorebelly's plate
7/10 hit chances * x attack dice = average hits x = 4
average = 2.8
7/10 hit chances * x defense dice = average mitigated
x = 3
= 2.1
average damage = .7
crit probability = (1 - (9/10)^x)
x = 4
= 34%
average damage on a crit roll = 2.8 - .7 = 2.1
2.1 * 34% = .714
average damage per swing including crits = 1.414
its not too unwieldy. definately easier than creating a program in the short run in any case. and, its probably easy enough for most people to be able to estimate on the fly in a game, especially if crit effects are simply +1 damage
|
|
-
08-05-2008, 5:07 PM |
-
Saucius
-
-
-
Joined on 07-29-2008
-
-
Posts 57
-
-
|
Re: Making the Computer Crunch Numbers
First off, I don't think it would be cheating if you
released the program just as long as people weren't using it as they played,
which probably wouldn't be allowed in tournaments anyway.
Even if someone was to use it along side the actual game, it
wouldn’t be that extreme of an advantage because the game uses common sense and
luck along side with those kinds of statistics.
Looking at your example, during the first game I played I knew that
Hodoon’s Hammer of Wrath would do more damage to Gorebelly than his regular
attack would. I didn’t need a percentage
calculator to figure that out. Sure, I
didn’t know the exact percentages, but I still knew that if Hodoon threw down
his HoW on my Gore I would be in trouble.
Also, sometimes people can just be extremely lucky or unlucky. During my second game, my opponent’s Hod crit
with his regular attack and still only did a total of one dmg to my Gore.
Also, let’s look at some games that give similar statistics
in the game. In Fire Emblem games, you
are told exactly how much damage you will do with each hit, your hit %, and
your crit %, along with many other stats.
The game still requires tremendous strategy to win. In Civ IV, you are given a % of success
against your opponent’s troops that is probably calculated in a similar fashion
to this outcome calculator. However,
there are still times when the computer with work your ass and you fail
miserably.
Now that’s not to say that this calculator is useless or
dumb; I think it’s really cool and I want the program! I think its real value will come in planning
strategy and building teams. From the
way it sounds, both players will reveal their teams at the same time, so you
can’t really bring guys to counter your opponent’s guys because you won’t know
who they are. So say you’re building a
Horde team. You can run different
attacks and action cards against prominent Alliance and Monster team builds in order to
create a well-rounded team. Once again,
though, this information could be roughly figured out without a calculator,
meaning that the calculator does not give any unfair advantages. What it does do is provide the serious player
with a time saving tool that can help in the building of teams. I really would like to get a hold of
something like that. Good work, iamtienpham.
|
|
-
08-05-2008, 5:51 PM |
-
iamtienpham
-
-
-
Joined on 06-08-2008
-
-
Posts 77
-
-
|
Re: Making the Computer Crunch Numbers
Jacquen: A flat out average has it's uses, but it is limiting. Over the long run the damage would average out to your numbers, but figuring out if it's worth a shot at destroying a Gorebelly at 4 life, averages don't narrow it down enough. Using a program or excel spreadsheet, such data can be found and examined quickly. With enough experience at playing the game, I sure anyone can say if this or that attack is a good idea.
To aid in gaining that experience, number crunching is very much a part of that. Instead of playing a huge number of games, and possibly having misconceptions about your own chances or strategies, crunching numbers like this should improve play.
For example here's some numbers I crunched based on demo minis (disclaimer +/- 2% of error if I programmed it right)
Hodoon's Hammer of Wrath, Ruby's Arcane Blast, and Fire Blast chances of doing 9 or more damage to Gorebelly: 57% (example of how complex the calculations can get)
Chances of Gorebelly (6 attack) one-shotting Ruby: 36%
Chances of Lothrin using P. Scream (5 attack, I think that's the right number) to make Hodoon move 3 or more spaces: 38%
Now armed with this information, a player goes in to a match much more prepared. Taking the chances of Gorebelly one-shotting Ruby, knowing that those are your chances it might be a good idea to have a backup plan like Lothrin within striking distance.
WoW Minis Unofficial Calculator: In Alpha Stages
Download Link: https://sourceforge.net/projects/wowminiscalcula/
|
|
-
08-05-2008, 7:45 PM |
-
imackid
-
-
-
Joined on 10-04-2006
-
-
Posts 66
-
-
|
Re: Making the Computer Crunch Numbers
I was working on a C++ calculator for this. If you want I can give you my code. So far, it only returns the % chance of hitting with x amount of dice when using 2-10.
I'm sure it would be possible to use this and compare the %s of hit/miss for the attacker and defending minis to get a % chance of doing x amount of damage.
I'm not at home right now (where the code is) but if anyone wants it, i'll post it.
|
|
-
08-05-2008, 10:47 PM |
-
TehHuntre
-
-
-
Joined on 04-29-2008
-
-
Posts 688
-
-
|
Re: Making the Computer Crunch Numbers
I don't think its cheating in any way. But I don't want anyone to use or see such a program because that will make them more informed and thus harder for me to defeat.
I said this before and this is the last time I'll mention this program, but google "smallroller.exe" Play with it some and you'll see it does 90% of the things we need/want it to do.
Psychic Scream uses 7 dice.
I wouldn't mind seeing that code at some point, Imackid, but only because I'm trying to slowly teach myself some programming skills.
|
|
-
08-06-2008, 12:29 AM |
-
trist1
-
-
-
Joined on 05-22-2008
-
-
Posts 253
-
-
|
Re: Making the Computer Crunch Numbers
Such as during a match, a player may use such a program to accurately predict dice roll outcomes.You're not allowed calculators et al in tournaments. If I were to release a program like this would it be a good idea for the state of the game. Yeah, good for the game, the more theory the merrier. It's easy enough to write a program that takes two minis as arguments and punches out 1v1 win percentages. That's my next programming task. While a good idea, you're going about it in the wrong way. Instead of making "random" rolls and calculating probabilities based on that, use math to find the actual probabilities.Easy enough to use math to find the simple stuff. There isn't really an effective way to generalise it and with 1.6 million simulations you're getting a 99% confidence interval of .1% which is good enough for me. As for the chance hammer of wrath does zero damage, here's the formula: 0.3^5 + 5*0.3^4*0.6*0.7 which comes to 1.94% Jacquen, that math is only a good estimation for high attack vs low defense*. It's not quite as simple as "attack dice - defence dice * 0.7 = average damage", as you can't get 'negative' defence results. For instance, hodoon attacking hodoon doesn't average 0 damage with a primary attack(ignoring crits). *as long as the attack dice are at least double the defence dice, your formula will only slighly underestimate damage and makes for a decent rule of thumb.
A Mini Journey
|
|
-
08-06-2008, 7:04 AM |
-
iamtienpham
-
-
-
Joined on 06-08-2008
-
-
Posts 77
-
-
|
Re: Making the Computer Crunch Numbers
Psychic Scream 7 attack, really? That's kinda really scary...
Anyways, Chances of Lothrin using P. Scream to make Hodoon move 3 or more spaces is now 78% and 24% to make him move 5 spaces or more. It looks way too effective, but then again Lothrin isn't suppose to survive for long up close.
On the programming theory side of things, currently I have the program run only 10,000 simulations. The number of dice being thrown would be all the attack and defense dice times that number. I find that a higher number than about 15,000 there is a noticeable delay between hitting the run button and seeing the result. The little improvement in accuracy isn't worth it to me. But still I need to set the number of simulations to be a use defined variable, that's easy enough to do.
WoW Minis Unofficial Calculator: In Alpha Stages
Download Link: https://sourceforge.net/projects/wowminiscalcula/
|
|
-
08-06-2008, 7:35 AM |
-
trist1
-
-
-
Joined on 05-22-2008
-
-
Posts 253
-
-
|
Re: Making the Computer Crunch Numbers
|
-
08-06-2008, 7:37 AM |
-
trist1
-
-
-
Joined on 05-22-2008
-
-
Posts 253
-
-
|
Re: Making the Computer Crunch Numbers
I'm suprised you're getting significant delays. If memory serves, I was only getting a few seconds of processing from 30 million dice rolls
A Mini Journey
|
|
-
08-06-2008, 8:09 AM |
-
iamtienpham
-
-
-
Joined on 06-08-2008
-
-
Posts 77
-
-
|
Re: Making the Computer Crunch Numbers
I wouldn't call it significant, I call it noticable. I would guess the delay is less than a second at about 100,000 simulations, but it still bothers me. I'm sure other people have more tolerance for waiting.
WoW Minis Unofficial Calculator: In Alpha Stages
Download Link: https://sourceforge.net/projects/wowminiscalcula/
|
|
Page 1 of 3 (42 items)
1
|
|