Author Topic: Calculating the average damage per round  (Read 461 times)

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Calculating the average damage per round
« on: August 22, 2012, 06:28:38 am »


               Hi,

Does someone know a reliable formula to do this?(considering everything like chances to hit and crits etc...) I have found the D&D damage averager on the web but I wonder if the formulas it uses are up-to-date, or if there's a better formula I should use instead? (I'm balancing a large number of NPCs...)

Thanks!


Kato 
               
               

               


                     Modifié par Kato_Yang, 22 août 2012 - 05:33 .
                     
                  


            

Legacy_the.gray.fox

  • Full Member
  • ***
  • Posts: 214
  • Karma: +0/-0
Calculating the average damage per round
« Reply #1 on: August 24, 2012, 03:14:50 pm »


               For your own good: I suggest you to think of something else.
Then again, it is *your* time -- spend it however you wish.


Anyhow...
There would be a lot of data to account for: equipment, feats, racials, current spell bonuses, class and level, and of course number of attacks per round, and which weapons are used during which attack (for dual-wield). Currently there is not enough support to query all of it. Least of all in real time.

The tracking and querying of active spells effects alone would require massive modding, spanning over hundreds of scripts just to build the _tools_ to do said tracking & querying.
For starters you would have to rescript the Dispel System. That is not something you want to deal with, believe the fox.

At any rate there is no way you could do it all in one slick script. You would TMI out of it long before reaching job completion. You would be forced to split the workload on multiple scripts running in disjoint contexts (to dodge the TMI), which in turn prevents you from doing it all in real time -- that is: actual game time elapses from the moment you start the query and the moment the job is finished. In that timeframe more scripts can run and more things can happen, potentially invalidating your query.



Can NWNX query spell effects and return you their properties? I mean, on _Windows_ not just Linux?
If it can -> you must definitely employ it. That chops off the biggest slice of the work, and the rest of the pie can be taken on with regular scripts.


-fox
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Calculating the average damage per round
« Reply #2 on: August 24, 2012, 03:32:09 pm »


               You can look into PRC, they tried to do this as they in past had to fake extra attacks via special scripting routines for Tempest class. Yet, FYI that solution never worked perfectly because all what fox wrote is true.
               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Calculating the average damage per round
« Reply #3 on: August 24, 2012, 03:42:08 pm »


               Thanks for the infos, Gray Fox. Considering all this I think I'll keep on using the D&D damage averager, indeed.

@ShadoOoW: Nice info, I'll take a look for sure, to at least learn from the system you mention '<img'>


Kato
               
               

               


                     Modifié par Kato_Yang, 24 août 2012 - 02:46 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Calculating the average damage per round
« Reply #4 on: August 24, 2012, 09:32:10 pm »


               Kato- it sounds to me that you don't need to calculate this in real time, but simply want an estimate while designing an encounter. Is that correct?
               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Calculating the average damage per round
« Reply #5 on: August 24, 2012, 09:42:57 pm »


               Yes Henesua.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Calculating the average damage per round
« Reply #6 on: August 24, 2012, 10:14:20 pm »


               Thats an interesting way to handle this. I'll have to try it out.

Normally I consider the strength and weaknesses of a creature and what kind of PC is more likely to fall victim to their special attacks rather than damage output.

For example, one creature is able to cast that AOE mind fog spell that lowers will saves by 10, and then a gaggle of monsters with special attacks requiring will saves lowers the boom on the party. This would wipe out a fighter of equal level, but for a mixed party would range from a minor nuissance to a challenge depending on the mix. To up the challenge I'd throw in a couple heavy hitters (high HP, high damage output melee attackers). And the spawn could be designed to adjust the challenge based on which classes and levels of PCs have entered the encounter zone.

So anyway thats normally how I think about it. I've never optimized an encounter based on average damage per round before. It seems to me that that would work well for melee focused NPCs but when it comes to spell casting it would break down since saves can cause wide swings in terms of how much damage is dealt, and particular defenses can make it nearly impossible for a PC to muscle through until they figure out how to "crack the encounter".
               
               

               


                     Modifié par henesua, 24 août 2012 - 09:14 .
                     
                  


            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Calculating the average damage per round
« Reply #7 on: August 24, 2012, 10:19:44 pm »


               If you know the AB, AC, attacks per round, and a rough estimate of damage per hit you can figure out how much damage per round a creature will do.  Spells are easiest to figured out in general.

For example, if a player has 15 AC and the mob has an AB schedule of 10/5 with 10 damage per hit, you have...

80%/55% = 1.35 hits per round, or an average of 13.5 damage taken per round.  Different weapons have different crit ranges, but you can figure out an upper bound at a minimum.  Assuming the attacker has a basic longsword and lacks Improved Critical, you have a 10% chance to crit if every critical that threatens actually crits.  Which, with a x2 multiple, is 10% more damage on average.

So now we have 14.85 damage taken per round.

Now, if we add additional attackers they get a +2 flanking bonus which you'd have to factor in, but that's a basic gist.
               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Calculating the average damage per round
« Reply #8 on: August 24, 2012, 10:55:29 pm »


               Indeed, I guess that'll do it, thank you all for the insight '<img'>


Kato
               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Calculating the average damage per round
« Reply #9 on: August 25, 2012, 06:42:55 pm »


               As a side note, in case it can be helpful, I have written down the formula, starting from MagicalMaster's calculations, which BTW give the same results as the D&D damage averager, since having the formula offers more flexibility than using the mentioned tool.

n = bchm + (b-bc)h

Where:
b = avg weapon damage(including IPs) + str modifier + weap spe feats + avg dmg from buffs
h = sum of hit chances in the schedule (in percentage)
c = crit chance (in percentage)
m = crit multiplier

Example: Attacker str 18, longsword, AB schedule 20/15/10/5, vs target AC 30

8.5*0.1*(0.55+0.30+0.05+0.05)*2 + (8.5-8.5*0.1)0.95 = 8.8825 avg damage/round

Cheers

Kato
               
               

               


                     Modifié par Kato_Yang, 25 août 2012 - 06:20 .
                     
                  


            

Legacy_MrZork

  • Hero Member
  • *****
  • Posts: 1643
  • Karma: +0/-0
Calculating the average damage per round
« Reply #10 on: August 26, 2012, 10:31:38 am »


               One might also take into account that many attack rolls in the crit range won't actually be crits, which lowers the total DPR a bit. The effect isn't typically that big - accounting for failed threat rolls in in the example above, the DPR is 8.75, which is very close. But, it edges toward significance for weapons with a wide crit range or large multiplier, particularly in situations where AB is much lower than AC.

For example, if the same attacker above were using a keen scimitar against an AC 35 opponent, the bh[1+c(m-1)] formula (above) gives DPR of 4.4, whereas true DPR is 3.6. Still not a huge difference, but whether it's worth working out depends on what you're doing with the information.
               
               

               


                     Modifié par MrZork, 26 août 2012 - 09:35 .
                     
                  


            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Calculating the average damage per round
« Reply #11 on: August 26, 2012, 04:00:14 pm »


               

MrZork wrote...

One might also take into account that many attack rolls in the crit range won't actually be crits, which lowers the total DPR a bit. The effect isn't typically that big - accounting for failed threat rolls in in the example above, the DPR is 8.75, which is very close. But, it edges toward significance for weapons with a wide crit range or large multiplier, particularly in situations where AB is much lower than AC.

For example, if the same attacker above were using a keen scimitar against an AC 35 opponent, the bh[1+c(m-1)] formula (above) gives DPR of 4.4, whereas true DPR is 3.6. Still not a huge difference, but whether it's worth working out depends on what you're doing with the information.


Yes, the formula assumes a successful crit for each chance. How would you fit the failed threat rolls in the formula? Or if you prefer, how do you reach the numbers you posted?


Kato
               
               

               


                     Modifié par Kato_Yang, 26 août 2012 - 03:00 .
                     
                  


            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Calculating the average damage per round
« Reply #12 on: August 26, 2012, 05:18:18 pm »


               Well, for the longsword, you have a 10% chance to threaten critical.  If you do, on the first attack you have a 55% chance of actually landing the critical, a 30% chance of actually landing a critical on the second, 5% on the third, and 0% on the fourth.

So if you break the attacks down...

First attack
- 55% chance for a hit
- Within that 55% chance for a hit you have a 5.5% chance for a crit.  Thus a 49.5% hit and 5.5% crit
- With a x2 multiplier, you get 49.5% + 11% = 60.5% damage of a hit

Second attack is 30% hit with a 3% crit, so 27% + 6% = 33% damage of a hit

Third attack is 5% hit with a 5% crit, so 4.75% + 0.5% = 5.25%

Fourth attack is 5% hit, no chance of a crit, so 5%.

60.5% + 33% + 5.25% + 5% = 103.75% hits per round

8.5 damage * 1.0375 = 8.81875 (round it to 8.82).

Edit: Curious to see where the difference between my number and MrZork's comes from.

Edit 2:

MrZork wrote...

For example, if the same attacker above were using a keen scimitar against an AC 35 opponent, the bh[1+c(m-1)] formula (above) gives DPR of 4.4, whereas true DPR is 3.6. Still not a huge difference, but whether it's worth working out depends on what you're doing with the information.


So...

0.3/0.05/0.05/0.5 with the scimitar

Default formula would give 0.45 * 7.5 * 1.3 = 4.3875 (round to 4.4)

Actual breakdown gives...

30% chance to hit, 30% of the hits will be crits, so 21% + 18% = 39%

5% chance to hit, 5% chance to crit, so 4.75% + 0.25% = 5.25%

5% chance to hit, 0% chance to crit = 5%

5% chance to hit, 0% chance to crit = 5%

So 39% + 5.25% + 5% + 5% = 54.25%

7.5 * 0.5425 = 4.06875 (round to 4.1)
               
               

               


                     Modifié par MagicalMaster, 26 août 2012 - 04:24 .
                     
                  


            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Calculating the average damage per round
« Reply #13 on: August 26, 2012, 05:29:56 pm »


               Nicely explained MagicalMaster, I'll modify the formula accordingly, thank you.


Kato
               
               

               


                     Modifié par Kato_Yang, 26 août 2012 - 04:45 .
                     
                  


            

Legacy_MrZork

  • Hero Member
  • *****
  • Posts: 1643
  • Karma: +0/-0
Calculating the average damage per round
« Reply #14 on: August 27, 2012, 10:25:41 am »


               I don't know what step I was flubbing last night, but tonight I am getting the exact results that MM posted. Sorry if that caused any confusion. ':blush:'