Page 1 of 1

D&D 3.x Expected Damage Calculator

Posted: 2009.10.05 (06:35)
by t̷s͢uk̕a͡t͜ư
I decided to faff around with making a Windows application today (like, with a GUI, which is actually new territory to me), and this is the result.

This is intended as a tool for your use as well as a request for feedback. Like I said, this is my very first application with a graphical frontend that I'm comfortable enough to release, so if you find any glaring problems, please let me know.

This is just the very first version of this thing I made. I already know plenty of ways I can expand this thing to be more than this simplistic little thing, such as adding support for multiple attacks, saving and comparing user-generated profiles, throwing in more statistical information, etc. I may very well do some or all of these things if I get around to it, and promise nothing.


And for those of you wondering what the hell use this serves...

Expected Damage:
When I'm creating a character with a decent number of levels and I want to compare the effectiveness of his physical attacks, the figure I rely on to get a good idea of the tradeoffs of various combat styles is a number I call the "expected damage." I've never seen anyone else use this metric for evaluating a character's prowess in combat; this is a benchmark that I came up with, and the existence of any similar benchmark is completely coincidental as far as I'm concerned.
Expected damage factors in number of attacks, accuracy, damage, and critical hit potential to give you a good estimate of how much damage you can expect to deal each round against a given opponent.

Its calculation is pretty straight-forward. You need to know the attacker's attack bonus, the critical hit information for his weapon, and his average damage, as well as the defender's AC.
  • Take the number of values on a d20 that would land you a normal hit (not including the critical threat range) and divide by 20 to get the probability of landing a regular hit. This is the starting value for the expected number of hits from this attack.
  • Take the number of rolls on a d20 that would threaten a critical hit and divide by 20 to get the probability of threatening a critical.
  • Take the number of rolls on a d20 that would confirm a critical hit threat, divide by 20, and multiply by the critical hit multiplier to get the number of expected hits from a critical hit (basically, consider a critical hit to be multiple hits). Multiply it again by the probability of threatening a critical hit and add to the number of expected hits for the round overall.
  • Take the number of rolls on a d20 that would miss, divide by 20, multiply by the probability of threatening a critical hit, and add this number to the number of expected hits this round.
  • Multiply the total number of expected hits this round by the average damage, and you have your expected damage from that attack.
  • Repeat this process for every attack the attacker has in the round.
Here's an example:
Bob is using his rapier to attack an enemy with AC 18. Bob's attack bonus with the rapier is +10 and his damage is d6+3. The critical threat range on a rapier is 18-20, and the critical hit multiplier is 2.
The average value on a d6 is 3.5, and Bob's damage bonus gives us an average damage of 6.5 for this attack.
  • If Bob were to roll a d20 and get a number from 1 to 7, he would miss. There is a 7 in 20 chance that he would deal no damage with this attack. The sum of the expected number of hits Bob would make is so far zero.
  • If Bob were to get a number from 8 to 17, it would be a normal hit. The range 8 to 17 includes 10 numbers, so there is a 10 in 20 chance that Bob will land a normal hit. The sum of the expected number of hits Bob would make is now (10/20), or 0.5.
  • If Bob were to roll a number from 18 to 20, that would be a critical hit threat. There is a 3 in 20 chance that Bob will threaten a critical hit.
    If Bob threatens a critical hit, he can confirm the critical hit with a roll from 8 to 20, which is 13 numbers. So the probability that Bob gets a critical hit is (3/20) x (13/20). Since the critical hit multiplier is x2, we can consider a critical hit from Bob to be the equivalent of two normal hits. The sum of the expected number of hits Bob would make is now 0.5 (from the previous figure) + (3/20) x (13/20) x 2 = 0.695.
  • If Bob threatens a critical hit, he can achieve a normal hit by rolling a number from 1 to 7. The probability that Bob will deal normal damage from an unconfirmed critical hit threat is (3/20) x (7/20). This puts the final number of expected hits to 0.695 (from the previous figure) + (3/20) x (7/20) = 0.7475.
  • On average, Bob will land 0.7475 hits per round on his opponent. Since each hit deals an average of 6.5 damage, we can expect Bob to deal 6.5 x 0.7475 = about 4.86 damage per round.
Or to be more succinct, here's what's usually on scratch paper I use to figure this out:
Image
"Miss" is there to make sure my numerators add up to 20.
I multiply everything that isn't "miss," and then multiply by the average damage. Bam.

But anyway, point is, this thingy I've attached does this for you (for one attack).

Enjoy.
<3 Suki


PS: For those interested, I can throw in the source for a console-based calculator I use that calculates expected damage against a range of AC's and plots them for you (requires gnuplot).

Re: D&D 3.x Expected Damage Calculator

Posted: 2009.10.05 (22:56)
by blue_tetris
Breaks the spirit of the game. Math is easy. Roleplay is legitimate.

Re: D&D 3.x Expected Damage Calculator

Posted: 2009.10.06 (05:32)
by taaveti
Out of curiosity, did you do the GUI stuff manually or did you use some framework?

In terms of interface design, it would probably be a good idea to get into the habit of displaying some kind of warning message (e.g. via MessageBox) when you fail out of the button handler. Users tend to be happier about "invalid parameter" warnings than buttons that don't seem to do anything.

In any case, it's certainly better than my first foray into GUI programming was (back when the world was black and white and Roosevelt was in office...).

Re: D&D 3.x Expected Damage Calculator

Posted: 2009.10.07 (08:31)
by t̷s͢uk̕a͡t͜ư
blue_tetris wrote:Breaks the spirit of the game. Math is easy. Roleplay is legitimate.
I separate the two. As long as my stats represent what my character is, I see zero problems. So if I'm playing a legendary war machine, I want to be damned sure that my character is a legendary war machine. I've seen "expert assassins" who blew goats at assassination when it came down to practice, and I don't like that that happens.
The games I'm used to these days have extremely few combats in them, anyway.
taaveti wrote:In any case, it's certainly better than my first foray into GUI programming was
Thanks!
taaveti wrote:Out of curiosity, did you do the GUI stuff manually or did you use some framework?
Microsoft has a program called MSDNAA. I don't remember what the heck it stands for, but through it, computer science students get free software.
This program was written in C# and written / compiled in Visual Studio 2005, which has a form-building toolkit. I built the GUI purely through a graphical approach involving clicking and dragging.

Re: D&D 3.x Expected Damage Calculator

Posted: 2009.10.07 (19:43)
by blue_tetris
4E is superior for roleplayers like Tsukatu.

It makes the numbers exceedingly less important by balancing all factors much better than 3E every balanced them. You can play a wider assortment of characters in 4E without sacrificing your personal concept to make sure you travel down a well-munchkinned route. You may want to play some more 4E sometime, Sook.

If you strongly separate flavor from mechanics (and, I prefer to also), it's the system for you. I played a 4E game where a few simple renames for powers enabled a perfectly Oriental setting. In 3E, choosing certain abilities also set your character's flavor.

Re: D&D 3.x Expected Damage Calculator

Posted: 2009.10.10 (02:28)
by Pikman
Bah, /me agrees with blue. This just seems to ruin the fun.

"Hey, let's run a GENERATOR! It can do all of this shit for us!" "Booooooooooring."

Re: D&D 3.x Expected Damage Calculator

Posted: 2009.10.21 (11:38)
by SlappyMcGee
blue_tetris wrote:4E is superior for roleplayers like Tsukatu.

It makes the numbers exceedingly less important by balancing all factors much better than 3E every balanced them. You can play a wider assortment of characters in 4E without sacrificing your personal concept to make sure you travel down a well-munchkinned route. You may want to play some more 4E sometime, Sook.

If you strongly separate flavor from mechanics (and, I prefer to also), it's the system for you. I played a 4E game where a few simple renames for powers enabled a perfectly Oriental setting. In 3E, choosing certain abilities also set your character's flavor.
Jesus Hertz Christ, you want to pimp out 4E.

I like your program a lot, Tsukatu, although I hardly have a game I could use it in.