## Post itt every time you lol at the airstrike damage formula

Although the central place for design discussion is ##crawl-dev on freenode, some may find it helpful to discuss requests and suggestions here first.

Crypt Cleanser

Posts: 689

Joined: Saturday, 12th December 2015, 23:54

### Post itt every time you lol at the airstrike damage formula

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.

For this message the author Hellmonk has received thanks: 7
duvessa, Lasty, Leszczynek, nago, Shard1697, Sprucery, VeryAngryFelid

Ziggurat Zagger

Posts: 8786

Joined: Sunday, 5th May 2013, 08:25

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

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.

Dungeon Master

Posts: 3160

Joined: Sunday, 5th August 2012, 14:52

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

gammafunk was right: just posting about it got me to do it.

For this message the author Lasty has received thanks: 8
duvessa, gammafunk, Hellmonk, MainiacJoe, nago, Rast, VeryAngryFelid, ZipZipskins