## Sunday, March 11, 2012

### Starmada Sunday: Continuing Damage, Repeating, and Geometric Series

The Homeworld ion frigate - inspiring G-arc inverted range mods repeaters since 1999

So I mentioned in my previous post on ship design that there were a number of other topics I wanted to cover.  A lot of this is going to be rapidly obsoleted by Starmada Nova when it launches, but for those who don't convert (ha), it might be useful.

So, first topic.  Of the weapon traits, Continuing Damage and Repeating get a lot of discussion as being terrifyingly good.  While this is actually true of Continuing Damage, it's only situationally true of Repeating.  To show this, it's necessary to show that the number of hits generated by both of these traits can be modeled as a geometric random variable.  This is is a formalization of the process of flipping a coin until it comes up tails for a coin which has a probability p of landing heads-up, and its output is the number of flips it took to get tails.  Try it a few times and write down how many flips it took each time.  If you do this enough times, and your coin is fair, you'll get an exponential function, where it'll take i flips about 1/(2^i)th of the time (so 1 flip half the time, 2 flips a quarter of the time, and so forth).  If you work out the math with generating functions, the average number of flips it'll take to get heads works out to be 2 for a fair coin.

Continuing Damage's performance is easy to explain under this idiom.  Rather than ending the series when we get heads, we end it when we roll an odd, which happens with the same probability.  Thus, we can expect to get two points of systems damage per die of Continuing Damage, on average.  Further, under the standard interpretation of how Continuing Damage works, we get a hull hit for each point of Continuing Damage; if we roll an odd the first time, then it's a hull hit, and if we got an even initially, then we keep rolling until we get an odd, and hence a hull hit.  Therefore, each point of Continuing Damage is exactly twice as effective as a normal point of damage against starships, as a normal point of damage is guaranteed 1 point of systems damage and gets a point of hull damage half the time.

So, what's the problem with Continuing?  The issue actually isn't, mathematically, that it guts ships without killing their hulls, since it does hull damage on each die, and the ratio of systems damage to hull damage is the same, on average, as with non-continuing damage.  The problem is actually that it's underpriced, at a price multiplier of x1.7.  Since it's twice as effective as normal damage (on average), it should probably be x2, like Double Damage.  It also has the nice property that it scores a hull hit on every die, which is only shared by Extra Hull Damage, which is much more expensive at x3.  It's possible that the community as a whole has misinterpreted the wording on Continuing Damage, but it appears that if Cricket originally intended it to work differently, he has since forgotten.

So, short version: Continuing actually is probably the most reliably cost-supereffective anti-ship weapon trait in the game, scoring x2 hits all the time for x1.7 price, for a 1.18 effectiveness / price multiplier.  Use it if you like blowing up the enemy's ships (and I think most of us probably do), or houserule it to an x2 price multiplier.  For all that Continuing looks like a swingy trait on the surface, it's actually very reliably effective, since it always gets a hull hit.  For bonus points, combine with Catastrophic.

Repeating's a bit harder to analyze.  Here we have a coin that we quit flipping when we miss...  which means that the number of hits we get varies with accuracy, and our probability isn't always 1/2.  Fortunately, the expected number of heads we get before we get tails on a biased coin with probability p of heads is p / (1-p).  We can then work out the expected number of hits per point of RoF based on our accuracy rating:

• 6+: p = 1/6, so (1/6)/(5/6) = 1/5 hits per repeating RoF, on average.  1.2 times as effective as 6+ Acc without repeating.
• 5+: p = 1/3, so (1/3)(2/3) = 1/2 hits per RoF, 1.5 times as effective as 5+ non-repeating
• 4+: p = 1/2, so (1/2)/(1/2) = 1 hit per RoF, 2 times as effective as 4+
• 3+: p = 2/3, so (2/3)/(1/3) = 2 hits per RoF, 3 times as effective as 3+
• 2+: p = 5/6, so (5/6)/(1/6) = 5 hits per RoF, 6 times as effective as 2+
So, what this analysis shows is that Repeating is much, much better on highly accurate weapons.  OK, that makes sense.  But when is it cost-effective?  Repeating has a cost multiplier of x3.  This means that with Repeating on a 3+ weapon, you're breaking even.  With repeating on 4+ or higher, you're paying for more than you're getting.  And on 2+, you're getting twice what you paid for; for the price of one 2+ repeater with 6 expected / effective RoF, you could instead get 3 RoF of 2+ weapons, which would be half as effective on average.

Thus, repeating is only broken if you can use it on 2+ weapons...  or if you can make your weapons 2+ during combat by way of range modifiers.  In general, you're going to want to use Inverted Range Mods with these; you want to be obliterating people far away before they obliterate you, ideally during the first round of real firing.  3+ Inverted Range Mods Repeaters and 4+ Inverted Double Range Mods Repeaters are both terrifyingly effective; I've seen them in action, and can attest that they core battleships like nobody's business.  My first win ever was with the Grumm from Hammer and Claw, whose capital ships mount several variants of the aptly-named Eviscerator as their bow weapons.  Range 12-15, Acc 3+, Imp 3-4, Damage 1, Inverted Range Mods, Repeating.  Now, the Grumm only ever being a few of these to battle, and no more than one per ship, so when you score a weapon hit on the Grumm, there's always that chance that you'll get the Eviscerator (and then you celebrate, and the Grumm are sad).  But if you were to build a fleet armed with these as their primary weapons, rather than a few specialists...  Eesh.

On the flip side, if you know your opponent is bringing the good kind of repeaters (3+ or 2+), bring Countermeasures.  That -1 Acc really mitigates Repeating's effectiveness.  Evasive Action can likewise seriously reduce the amount of hurt they can put on you; try to get up to speed, then coast on evasive action through their long-range killzone if you're playing with Newtonian Movement.  Once you get into short range where they're not at 2+, you'll at least be on even footing mathematically.  On the flip side, if your enemy knows you're bringing out the Repeater-cheese, they'll have Countermeasures, so buy Fire Control.  It's worth it (and hey, if they don't have Countermeasures, then it becomes free Directed Damage, which can increase your expected number of hull hits by a factor of 1.5).  Also bring some secondary guns in case they close past your long-range repeaters.  You could also try to maintain a dispersed formation of killzones, so that each ship is in the long-range, high-effectiveness area of another ship's repeaters.  This suffers from the standard problem of dispersed formations, though, namely that the enemy only has to deal with part of your force at a time, and can use his entire force effectively.

So, the verdict on Repeating: it's situationally good, or tactical by my reckoning.  The problem is that getting into that sweet spot is pretty easy; with inverted range mods and long ranges, you can pull it off most games.  Likewise, the payoff when you do is huge, and the penalty for failing to do so is not very severe (even when you take into account the x1.4 cost multiplier for Inverted Range Mods, 3+ repeaters at medium range are still fairly cost-effective).  You only lose at close range.  This is what pushes it into borderline-degenerate territory.  Also: never ever put repeating on 5+ or 6+ weapons.  Generally avoid putting it on 4+, since you'll usually be losing effectiveness if you do.  3+ is fair game, and if you're buying 2+ weapons, Repeating is extremely cost effective.