Page 1 of 1

### Why is Airstrike's Damage Formula So Bizarre? Posted: Wednesday, 13th July 2016, 12:22
I mean, seriously:
Code:
`7 + 1d(1d4 - 1 + (1d(Power) - 1)/6) + (1d(Power) - 1)/7 damage.`

### Re: Why is Airstrike's Damage Formula So Bizarre? Posted: Wednesday, 13th July 2016, 12:29
Because that's how it's been and there's no reason to change it because the player doesn't see it anyway.

### Re: Why is Airstrike's Damage Formula So Bizarre? Posted: Wednesday, 13th July 2016, 14:12
Because we let a theoretical mathematician write it.

### Re: Why is Airstrike's Damage Formula So Bizarre? Posted: Wednesday, 13th July 2016, 14:53
wheals wrote:Because we let a theoretical mathematician write it.

Way too many numbers for theoretical maths. I see no mention of sheafs or cohomology anywhere. Must be Hungarian.

### Re: Why is Airstrike's Damage Formula So Bizarre? Posted: Wednesday, 13th July 2016, 16:27
I think |amethyst summed up pretty well how most formulas in crawl are decided upon:

|amethyst[24/24]: <|amethyst> but also the general Crawl principle of "we'll do some weird hard-to-tweak shit for our probability distribution, then figure out the math later"

### Re: Why is Airstrike's Damage Formula So Bizarre? Posted: Wednesday, 13th July 2016, 18:50
Hands: Polya told us to do it like this!

### Re: Why is Airstrike's Damage Formula So Bizarre? Posted: Saturday, 16th July 2016, 07:20
All formula should be written in a way that the hardware should be able to process in the most efficient manner possible. Or were we devolving into the "don't think, but feel" society?

All formula shall now be done in DnD format. Dice role! 1d100

### Re: Why is Airstrike's Damage Formula So Bizarre? Posted: Saturday, 16th July 2016, 08:39
MainiacJoe wrote:I mean, seriously:
Code:
`7 + 1d(1d4 - 1 + (1d(Power) - 1)/6) + (1d(Power) - 1)/7 damage.`

according to the source code the bracketing is wrong, it's actually supposed to be
Code:
`7 + 1d( 1d4 - 1 + (1d(Power) - 1)/6 + (1d(Power) - 1)/7 )`

Source code:
Code:
`1004     int hurted = 8 + random2(random2(4) + (random2(pow) / 6)1005                    + (random2(pow) / 7));`

### Re: Why is Airstrike's Damage Formula So Bizarre? Posted: Saturday, 16th July 2016, 09:56
The weird thing about this formula is not so much that it's complicated looking as that its distribution is remarkably similar to ones given by much simpler formulas. For example, going by canofworms' formula above, nearly the same distribution is obtained by the much simpler 2d(2*power/13) + 1d6 + 4. See http://anydice.com/program/8dbd for simulations. Notice how much easier it is to understand the impact of power in this other formula.

The distribution from the formula is essentially the distribution for a throw of two dice, plus a small die to smooth it out a little.

### Re: Why is Airstrike's Damage Formula So Bizarre? Posted: Saturday, 16th July 2016, 14:34
TIL.

### Re: Why is Airstrike's Damage Formula So Bizarre? Posted: Sunday, 17th July 2016, 10:02
Hm, upon further review, it turns out anydice expands nested d's in a way that in this case just passes the inner result through, so the distribution it gives for the airstrike formula as written is actually just the one for 7 + 1d4 - 1 + (1d(power) - 1)/6 + (1d(power) - 1)/7.

The anydice output struck me as odd since the distribution given by, say, 1d(1d10), should skew left. It's a basically a descending triangle. Iterated applications of "d" act like integrators, it turns out. One consequence of this is that you can't actually express distributions like this in terms of simple sums of dice because such distributions will always have zero skew. So, sorry about that!

### Re: Why is Airstrike's Damage Formula So Bizarre? Posted: Sunday, 17th July 2016, 21:14
goodcoolguy wrote:Hm, upon further review, it turns out anydice expands nested d's in a way that in this case just passes the inner result through, so the distribution it gives for the airstrike formula as written is actually just the one for 7 + 1d4 - 1 + (1d(power) - 1)/6 + (1d(power) - 1)/7.

The anydice output struck me as odd since the distribution given by, say, 1d(1d10), should skew left. It's a basically a descending triangle. Iterated applications of "d" act like integrators, it turns out. One consequence of this is that you can't actually express distributions like this in terms of simple sums of dice because such distributions will always have zero skew. So, sorry about that!
dammit why couldn't you have kept your mouth shut we almost got airstrike buffed

### Re: Why is Airstrike's Damage Formula So Bizarre? Posted: Sunday, 17th July 2016, 23:51