Thursday, December 14, 2017

Roll the chance cube: Armada, dice, and probability

Everything's perfect: your attack is set up just right, you've got the enemy ship dead to rights. The dice roll is just a formality. Here come the dice, and... crap.

At least you won a young Jake Lloyd as a consolation prize?
Dice can and will betray you in any game that utilizes them. On the other hand, they add an element of excitement and vary the play experience. What to expect from them and how far to push them can take some getting used to, and this article aims to further explore that element of Armada.

The basics
Let's start with a fairly basic breakdown of each different color of dice. 

Red dice
Red dice have the following sides:
  • 1 double-hit
  • 1 accuracy
  • 2 hit
  • 2 crit
  • 2 blank
With 5 different kinds of results (compared to the 3 possible outcomes on blue and black dice), red dice have a well-deserved reputation for being the most swingy and unreliable color of dice - sometimes they produce disastrously bad results, but every now and then those double-hit and/or accuracy results show up when you weren't counting on them, surprising you.

Against ships, red dice do an average of 0.75 damage (6 total damage points divided by 8 sides), although it should be noted that 3/8 of their sides produce no damage at all, being either blank or having an accuracy icon, so their damage is inconsistent.

Against squadrons, red dice do an average of  0.5 damage (4 total damage points divided by 8 sides), although it's important to note here that 5/8 of its sides don't do any damage against squadrons, making them extremely unreliable against them.

Because only 1/8 of the sides on red dice have an accuracy icon, it can be frustrating (only showing up 12.5% of the time on a die-by-die basis). In small doses, the inclusion of an accuracy icon into the pool is often a waste - you're not doing enough damage to make locking down defense tokens as good as simply doing more damage would've been or don't get enough icons to lock down a pair of identical defense tokens, making the icon effectively a blank. Conversely, when you're pouring on red dice in large doses (for example, with Ackbar) you're really hoping to get an accuracy result to make your damage "stick" better, but if your pool is reds-only, you can't rely on that accuracy icon showing up under normal circumstances.

Blue dice
Blue dice have the following sides:
  • 2 accuracy
  • 2 crit
  • 4 hit
Blue dice are the only dice color with no blank sides, making them very reliable for producing results, even if they're not necessarily the results you wanted.

Against ships, blue dice do an average of 0.75 damage, the same as red dice. They gain from only 2/8 of their sides being damage-free, but they're never going to luck into a 2-hit side for a serendipitous damage spike.

Against squadrons, blue dice do an average of 0.5 damage, again the same as red dice. They're again more reliable, doing damage 50% of the time (4/8 sides), but without a lucky double-hit possibility you'll never see the occasional "how much damage, again?" silliness you get from Z-95s or Zertik Strom when they luck out; then again, you're also much less likely to see your attacks completely fail, either.

With 2/8 of their sides featuring an accuracy icon, blue dice have the best odds (25% per die) of rolling an accuracy result naturally. In enough numbers and/or with the help of red dice, you can generally count on decent odds of getting an accuracy result.

Black dice
Black dice have the following sides:
  • 2 hit+crit
  • 4 hit
  • 2 blank
Black dice are the kings of damage-dealing, although they lack accuracy icons and are typically only available at close range.

Against ships, black dice deal an average of 1 damage, making them 33% better at doing so than red or blue dice.

Against squadrons, black dice do an average of 0.75 damage, making them 50% better at doing so than red or blue dice.

Because they lack accuracy icons and have 2 blank sides, black dice often appreciate a bit of help from other dice colors or upgrades to assist them with locking down brace and scatter defense tokens as well as some upgrade support to provide them with a reroll to unlock their full destructive potential (more on that soonish).

Easy for you to say, Obi-Wan; you never had a game's outcome depend on a red dice roll!
Average damage
Determining how much damage an attack should do is simple on its face. Take the average of each type of dice, multiply it appropriately and then voila!

For example, an ISD-I front arc at close range attacking a ship should do (without rerolls):
3 red = (3*0.75) 2.25
2 blue = ( 2*0.75) 1.50
3 black = (3*1) 3
For a total of 6.75 damage.

There are a few important provisions to note about doing this kind of thing, however:
  • This is only the average amount of damage. Your results may vary, sometimes wildly. You can expect most rolls to stick near the number here (varying up or down in this example by 1-2 points).
  • This doesn't factor in any rerolls or dice modification.
  • This cares only about average damage and won't give you odds on generating accuracy results.
  • Obviously the effectiveness of the attack will be modified by your opponent's defense tokens, game state, shields, hull, etc. All this number is giving you is average raw damage. It's a somewhat-helpful tool for making quick decisions but it doesn't in any way replace reading the table well.
Because of all those provisions, getting to a more nuanced average can be done but it takes more time (much more in some cases). In-game, being able to fire off a basic average mentally can be done without too much trouble, but getting more detailed results usually needs to be done outside of the game.

"For luck" and also for awkward future Skywalker family reunions
You can modify averages if you factor in a reroll, although it's important to be really specific about under what circumstances you're using the reroll and how many dice are being rerolled. We'll start with the easiest:

Rerolling all dice [of one type] in a pool 
Red dice are the best example: say that you have an effect (like Darth Vader) that allows for easy rerolls of as many dice as you like (these are the easiest rerolls to plan for). When it comes to red dice, you'll obviously want to reroll the blanks. Do you want to reroll the accuracy results too? In some cases, you probably do: with small pools of red dice the accuracy results don't usually do much (but in some cases, such as when the defender has one high-value defense token, they do) and generating damage is probably better than locking down a low-impact defense token; alternatively, maybe you generated a lot of accuracy results already and you only want to keep one or two of them. Conversely, you might be starved for accuracy results and want to keep them. It's really difficult to say ahead of time exactly what you "should" do, which makes averages difficult to predict. Let's get that done mathematically to show you the difference.

A red die has a 2/8 (25%) chance of producing a blank, so by rerolling the 25% chances of a blank, you get another chance at damage, which averages out to 0.75 (as we covered earlier). So the math works out to:
0.75 (the original average damage) + [0.25(the chance of a blank, which will be rerolled)*0.75(a red die's average damage)] = 0.9375 average damage, a 25% improvement.

However, if you reroll the accuracy results as well as the blanks, the math changes (using the same formula as above, just with a 37.5% chance of being rerolled) to an average of 1.03125 damage, a 37.5% improvement (obviously).

So basically if you're trying to guesstimate the average damage of a pool of rerollable red dice, it will really depend on the rules you're applying to the rerolls (for example, rerolls on blue dice can be pointless if you get the number of accuracy icons you want the first time around - they don't have any blank sides).

Another important consideration is squadrons. Specifically, when ships attack them or non-Bomber squadrons attack back, you have much fewer useful sides on the dice. Let's use red dice again as an example, and let's assume it's a single red flak die that won't benefit from a single accuracy result (like the Quasar-II gets):

0.5 average damage + [0.625 (chance of not producing damage) * 0.5] = 0.8125 average damage, a 62.5% improvement.

If you want the short version, check out the table below, but it has the following assumptions:
  • Accuracy icons aren't rerolled against ships (which is a really smart thing to do under the right circumstances)
  • Accuracy icons are rerolled against squadrons, which in most cases is correct (as one or two dice flak attacks don't usually benefit much from accuracy, barring a hit+accuracy from two-dice attacks against scatter aces).
  • Multiple dice are involved. It gets a little different when considering just one, as you'll have no desire to keep accuracy icons on a single-die attack, which would improve the reroll vs. ship average.
    • Blue would be 0.94 against ships and red would be 1.03 against ships with a reroll.
    • The "vs. ship" values also apply to Bombers attacking ships, as they get damage from critical icons just like ships do against other ships.
  • Values were rounded to the nearest hundredth because who cares about it past that, right?

Dice type
Vs. ship
Reroll vs. ship
Vs. squadrons
Reroll vs. squads

If you're looking for averages outside of those specific assumptions, I've hopefully given you the tools so far to get there. If not, we still have other things to cover before we're done!

Stacked rerolls
In some circumstances (for example, Darth Vader + Ordnance Experts for black dice) you can get multiple entire-pool rerolls (usually for one color of dice). Determining averages for those just requires checking on the total number of dice that still qualify for a second reroll after the first. Changing up your qualifications for what should be rerolled the first time versus the second can produce better results than applying the same criteria to both rerolls. For example, let's look at black dice as they're easiest (accuracies aren't a worry about rerolling versus not) here:

If you reroll all non hit+crit results the first time, you get:
(25% of kept hit+crit dice are 2 damage = 0.5 average damage) + (75% of dice are rerolled with an average of 1 damage for the end result = 0.75 damage) = 1.25 average damage, same as the earlier results.

However, you'll find that with this reroll method, you still have an (75% rerolled chance*25% chance reroll turns up blank =) 18.75% chance per die of it being blank at the end of your first reroll. Even if your damage average remains the same as the more conservative reroll method (1.25), your highs are higher (better odds of getting hit+crits) and your lows are lower (better odds of doing nothing). We'll talk about this a bit more later when it comes to fishing for specific icons, but anyways...

With the second reroll you can now "correct" for all those extra blanks by rerolling only those. We maintain our first-reroll average damage of 1.25 but we add (18.75% chance of being blank*1 average damage =)0.1875, rounded to 0.19 additional damage for an end total of 1.44 average damage if you use a reckless black dice reroll followed by a "regular" black dice reroll.

Using a "regular" black dice reroll both times will produce an average that is lower:
You'll only have (25% chance of initial blank * 25% chance of turning up blank again =) 6.25% of "regular reroll" black dice turning up blank again on the first reroll, so you only add 1.25 + (6.25%* average 1 damage =) 0.0625 damage, rounded to 0.06; therefore the average damage of a black die using the "regular reroll" method twice in a row is only 1.31, about 10% lower.

There's a lot of trickiness you can probability out with stacked rerolls using different reroll methods for the subsequent rerolls to get end results a bit more fine-tuned (especially combined with stuff we haven't gotten to yet). Thankfully (for all of us), the ability to stack multiple-dice rerolls is fairly rare.

Rerolling only one die in a pool of multiple dice
Effects like Swarm or a concentrate fire token can allow you to reroll a single die. If you're trying to use this to calculate average damage, it works a little differently than effects that allow you to reroll a whole pool. You can math it out long-form by considering each die that qualifies individually, which I'll demonstrate below. Say you want to see what kind of a benefit your TIE Fighter gets from using Swarm and you're considering accuracy icons as reroll candidates. Therefore each individual die has a 50% chance of generating the crit or accuracy icon you would want to use Swarm on. Because you only need one candidate die, it works out like:
  1. The first die has a 50% chance of being a candidate.
  2. Should the first die fail (50% chance) the second die also has a 50% chance (50%*50% = +25% chance)
  3. Should the first two dice fail (25% chance), the third die has a 50% chance (25%*50%= +12.5% chance)
  4. We come to the conclusion that (50+25+12.5=)87.5% of the time, Swarm will be beneficial for a TIE Fighter rolling 3 blue dice. Because it allows a reroll of a 0.5 average damage blue die, we would multiply 0.875 (the chance of using Swarm) by 0.5 (the average damage of the rerolled die) = 0.4375, or 0.44 when rounded to the nearest hundredth.
  5. Therefore, a Swarm-using TIE Fighter improves from 1.5 to 1.94 average damage, a 29% improvement.
Obviously this is a bit of a hassle, so let me introduce you to my friend, the binomial distribution calculator, which does all the steps of determining total chance of 1 or more (whatevers) for you. Here's a bit of help on getting the hang of it. Just enter numbers into the top 3 boxes and hit "calculate":
  • Probability of success on a single trial: how many dice sides have what you want on them? It's a 12.5% chance per dice side, which would be entered as 0.125.
  • Number or trials: the number of dice of that type being rolled.
  • Number of successes (x): How many of a given result do you want from your roll? The resulting calculation will show you what the percentage chance is of getting exactly that many results, less than that number, equal to or more, etc.
You can use a binomial distribution calculator for a lot of probability-based things, but for our purposes it's easier to get into it with situations like this first before doing anything more complex. We'll talk more about the binomial distribution calculator later.

Other assorted reroll weirdness

By which I mean "reroll abilities that cost you something." I'm thinking primarily of Leading Shots here, as it costs you a guaranteed icon on a blue die for some rerolls. It's difficult to factor Leading Shots into pre-made calculations, because which blue die to give up for the reroll is going to be very context-dependent. Sometimes it's not worth it to give up a guaranteed (whatever) for small gains. For example, giving up a blue hit die to reroll a single blank black die is pretty much an even trade - you're giving up one damage for a die that should on average produce one damage. It's generally not worth it unless you're fishing for a black hit+crit result (we're getting to fishing for results later!). Similarly, giving up a blue hit to reroll a single blank red die is usually not worth it because you're giving up 1 for an average of 0.75. On the other hand, rerolling two blank red die by giving up a hit is usually worth it (1 versus 1.5). Giving up an unnecessary blue accuracy icon is a very easy choice, though, but it will definitely depend on the circumstance.

If you really must figure out your average damage considering Leading Shots, I'd subtract 0.75 (the average damage of a blue die, reflecting that in some circumstances you'd give up a hit, in others an accuracy) from the initial roll and then "upgrade" the remaining dice to their rerolled average values. It's still a bit weird, though.

You've made it this far and you're going farther?
Dice modification
Okay, so how do we factor in dice modification? When it comes to damage modifications, it's not too tough. When it comes to something like accuracy generation, it's very context-dependent and so I generally steer clear (sometimes you'll want/need that extra accuracy from H9 Turbolasers, sometimes you won't, factoring it into probabilities gets really weird unless you have a specific target in mind under specific circumstances and you're willing to go crazy with the binomial distribution calculator).

Anyways, let's use an example that combines some of the reroll concepts we've included already. Say, for example, we're trying to decide if using Turbolaser Reroute Circuits on an Arquitens is worth it with Darth Vader in the fleet compared to using Enhanced Armament (or Slaved Turrets, sure) instead. We make a few assumptions about our experiment and then it's number crunching time! Assumptions:
  • Darth Vader will reroll all blank and accuracy icons (so we're assuming we're not shooting flotillas)
  • We're considering one side arc attack only. The Arquitens can sometimes get front/rear attacks or shoot out of both side arcs at different targets (if it's feeling brave/suicidal), but for our purposes we care only about one side arc shot.
  • The TRCs would be used on a blank dice if possible or to upgrade a single hit to a double hit if that is not possible.
  • We will also assume that the Arquitens is using a concentrate fire dial in both cases, as it likes to do with Vader especially whenever it can.
Just in case it wasn't clear, the assumptions made in these kinds of trials are very rigid and don't always reflect what's right to do in a given game state, so they are limited by their nature. Still, it gives some kind of basis for comparison.
Enhanced Armament experiment
5 total red dice where all accuracy and blank icons are rerolled do an average of 1.03 damage apiece (as we covered earlier), so the average comes out to 5.15 damage.

That was easy, and now it's time to get a little more complicated with the TRC comparison.

Turbolaser Reroutes experiment
4 total red dice where all accuracy and blank icons are rerolled do an average of 1.03 damage apiece, so the average pre-TRCs is 4.12 damage.

Because there is a 3/8 chance (2 blanks, 1 accuracy) of rerolling any given dice and then a 3/8 chance those rerolled dice are once again not what we wanted, the odds of an individual "bad" dice showing up that can be easy fodder for TRCs is (3/8*3/8 =) 14.06% per die. If we toss that into our buddy the binomial distribution calculator, we find that we then have a 45.4% chance of that ideal situation occurring on at least one of our 4 dice. We also need to weed out the chance that we reach the promised land of a perfect roll of all double-hits on 4 dice(which means the TRCs would do nothing useful), which happens less than 0.02% of the time, so it can be disregarded.

So what that means is 45.4% of the time, TRCs will add 2 damage to this attack. The remaining 54.6% of the time, they will only add 1 by upgrading a hit or crit to a double-hit. We factor that in by doing the following two equations:
  • 0.454*2 = 0.91 (rounded up)
  • 0.546*1 = 0.55 (rounded up)
And we find that 4.12 (our pre-TRCs damage) + 0.91 + 0.55 = 5.58.

Now is it worth it to use TRCs and tap out the Arquitens' evade token for +0.46 average damage more? That's an exercise I leave to you, but at least we now have a grounds for comparison in our imaginary fleet.

By using similar methods you can determine what effect dice modification effects will have on the average damage of your ships compared to other upgrades, or perhaps as part of a suite of upgrades or other reroll/modify effects present in your fleet.

Chasing specific results
The final portion of this article will cover the odds of producing a specific result while rolling, sometimes when factoring in rerolls. This is often useful for chasing after/fishing for a specific icon: that can be accuracy icons for locking down specific defense tokens (often scatters on scatter-equipped units) or critical icons on specific-colored dice for triggering critical-dependent upgrades.

Simply determining your chances on an initial roll are fairly simple by just plugging the information into the binomial distribution calculator. For example, a Gladiator-I's side arc (with no extra help) has a 68.4% chance of generating 1+ hit+crit results to trigger a black crit ordnance upgrade. Once you factor in rerolls, though, you need to determine under what conditions you're rerolling. If you assume that the Gladiator in question can reroll every dice that's not a hit+crit (with commander Vader let's say), then we're looking at each dice's percentage chance of getting us that sweet sweet crit we're chasing is:
25% (initial chance) + [75% (chance of rerolling) * 25% (trying again for that 2/8 chance)] =  43.75% chance of getting a hit+crit per black die, which improves our Gladiator-I's chances to 89.9%.

Simply rerolling blanks in the above experiment gives us different chances of:
25% + [25% (rerolling only blanks) * 25%] = 31.25% chance of getting hit+crit per black die, which improves our Gladiator-I's chances to 77.7%.

The takeaway from our Gladiator number-crunching above is if you're using a black crit ordnance upgrade, you're generally better off going for the high-risk high-reward option of rerolling every black dice you can if you don't roll a hit+crit initially. If that makes you uncomfortable, maybe you're better off either accepting that your black crit upgrade won't fire quite as often or using a dice-adding ordnance upgrade instead.

You can also put together some of the things we've already covered to deduce a more complex average. Let's say that you have an ISD-I with Leading Shots that has a flotilla sitting in its front arc at close range, trying to just get in the way and jam up its flight path. We're not concerned with how much damage it's going to do because the answer is going to be "enough." We're concerned with whether it can get at least 1 accuracy result to lock down that annoying scatter. Here's how we would go through everything.

The 3 red dice in the front each have a 1/8 chance of getting an accuracy icon and their chances of producing at least 1 as a group are 33%.

The 2 blue dice in the front each have a 2/8 chance of getting an accuracy icon and their chances of producing at least 1 as a group are 43.75%

Because we don't care about our blue dice unless the red dice fail, that means our initial roll has a 33% + [43.75% * 67% (the chance of the red dice failing)] = 62.31% (rounded) chance of getting at least one accuracy against the offending flotilla.

Now let's factor in Leading Shots, which we assume will be used to reroll all red dice and the one remaining blue die if our initial volley fails to produce any accuracy results. The 3 red dice again have a 33% chance of doing what we want. The 1 blue die has a 25% chance, but we only care about that if the red dice fail, so our second roll looks like 33%+ [25%*67%] = 49.75%

Now before we get too excited, we need to also remember that this "frantically reroll, looking for accuracy icons once more" contingency only happens if our original attempt fails. So it's also dependent on the percentage chance of even being necessary. That makes our final equation work out to:

62.31% (initial chance) + [49.75% (chance on the reroll, if it's necessary) * 37.69% (chance the initial roll failed and the reroll is required)] = 81.06% chance.

So our example ISD has just a bit better than a 4 in 5 chance of blowing that flotilla to kingdom come. If that's not high enough for your liking, then build some better accuracy-generation tech into your fleet/that ISD.

Final thoughts
Hopefully this article didn't bore too many of you to tears, but I find the number-crunching occasionally rather insightful when it comes to challenging ideas I have about what to include in my fleet and what upgrades/support to use with it. It's impossible to go through every possible use for probability in a game like Armada, but hopefully the examples provided are sufficient to help interested players start crunching some numbers for themselves.


  1. Wait one the table of reroll math it says Blue dice vs ships are average of .75 damage with or without reroll is that right?

    1. I explained the assumptions immediately above the chart. It assumes that you're not rerolling accuracy results, which sometimes you are and sometimes you aren't depending on circumstances. If you are rerolling accuracy results, it changes things, and that different results are given above the chart.

    2. Oh sorry my bad

  2. Just found this, and I love it. Thanks for this.

  3. Could you explain how you calculated this here exactly?

    The 3 red dice in the front each have a 1/8 chance of getting an accuracy icon and their chances of producing at least 1 as a group are 33%.

    The 2 blue dice in the front each have a 2/8 chance of getting an accuracy icon and their chances of producing at least 1 as a group are 43.75%

    1. Binomial distribution calculator, is the short answer. You can do the math long-hand (and it's not that bad with fewer dice), but it's faster with the calculator. I can give you an example with the blue dice, though:

      You've got a 1/4 chance of the first blue die getting an accuracy.
      There's a 3/4 chance that the first one didn't get an accuracy (if it rolled one already, then our 1+ accuracies have already occurred), at which point the second die has the same 1/4 chance. We're looking for the odds of 1 or more accuracy results so the math comes out to:
      1/4 + (3/4x1/4) = 4/16 + 3/16 = 7/16 = 43.75%