Page 1 of 1

Post itt every time you lol at the airstrike damage formula

PostPosted: Saturday, 24th June 2017, 04:46
by Hellmonk
Airstrike's overcomplicated damage formula has become a running joke on ##crawl.
From Duvessa's spell guide:
Airstrike's damage fomula is 8+random2(random2(4)+floor(random2(power)/6)+floor(random2(power)/7)).

Yet, for all of this nested die rolling nonsense, the effect of power on damage is pretty straightforward:
each point of power past 6 gives you about +0.08 mean damage and about +0.32 max damage, and the median isn't much lower than the mean.

It's easy to replace this damage formula with something much simpler that retains roughly the same mean damage. You want a formula that looks like A + random2(B + div_rand_round(pow,C)). A gives you some constant damage. B > 1 gives you some amount of variability in the damage even at 0 power, and B needs to be at least 1 or the first C points of power won't do anything. C divides spellpower and controls how well the damage scales. Div_rand_round is in there to avoid integer division, which would give really ugly power breakpoints. From there it is just a matter of finding good constants to fit airstrike's mean damage well across all power levels.

Duvessa suggested 8 + random2(2 + div_rand_round(pow,7)) on irc. This is slightly stronger at low power and slightly worse at high power. You could just as easily use 8 + random2(1 + div_rand_round(pow,6)) if you wanted it to scale a little better (the average damage is a couple points higher at 200 power). Or, if you really want to get fancy about it, you can find some fraction that gets even closer to the current behavior and multiply power accordingly. The effect of spellpower on damage becomes much clearer with a formula of this type, and it's easy to understand what to tweak if you decide that the balance needs to be adjusted later.

You do not preserve some other properties of airstrike's damage formula, including:
  • The first 6 points of power not doing anything (You can preserve this by making B = 0, but this behavior seems bad anyway)
  • The big max damage and the long tail of the distribution
  • The median damage being a few points lower than the mean damage
  • The mode always being 8
I don't think these features of the damage formula are interesting in practice. The only downside of changing the formula is that I will no longer be able to lol every time someone queries airstrike with sequell.

tl;dr: replace airstrike's damage formula with 8 + random2(2 + div_rand_round(pow,7)) or similar.

Re: Post itt every time you lol at the airstrike damage form

PostPosted: Saturday, 24th June 2017, 05:13
by duvessa
It's also worth mentioning that most spells use XdY instead of C+XdY. Airstrike's added constant of 8 is unusual, though it's not entirely without parallels (Vampiric Draining has one, and of course 5dY always does at least 5 damage).

For example, 2d(8+pow/14) provides the same mean as 8+random2(1+pow/7), and has a more familiar distribution.

Re: Post itt every time you lol at the airstrike damage form

PostPosted: Saturday, 24th June 2017, 13:15
by Lasty
gammafunk was right: just posting about it got me to do it.