|
From: <gi...@cr...> - 2017-06-24 13:15:15
|
via a0cb86122693c77584186d15147a6a4da2aafefb (commit)
from 85d6d27d4c04dd879824d0057879b32aae023901 (commit)
-----------------------------------------------------------------------
commit a0cb86122693c77584186d15147a6a4da2aafefb
Author: Corin Buchanan-Howland <co...@bu...>
Date: Sat Jun 24 09:12:28 2017 -0400
Simplify Airstrike damage formula (Hellmonk)
The old formula involved multiple layers of nested randomization for no clear
benefit. In the words of HellMonk, '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'
-----------------------------------------------------------------------
Summary of changes:
crawl-ref/source/spl-damage.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/crawl-ref/source/spl-damage.cc b/crawl-ref/source/spl-damage.cc
index 7195c21..4394df8 100644
--- a/crawl-ref/source/spl-damage.cc
+++ b/crawl-ref/source/spl-damage.cc
@@ -982,8 +982,7 @@ spret_type cast_airstrike(int pow, const dist &beam, bool fail)
enable_attack_conducts(conducts);
- int hurted = 8 + random2(random2(4) + (random2(pow) / 6)
- + (random2(pow) / 7));
+ int hurted = 8 + random2(2 + div_rand_round(pow, 7));
bolt pbeam;
pbeam.flavour = BEAM_AIR;
--
Dungeon Crawl Stone Soup
|