Dice Calculator Help

By SirToastsalot, in Star Wars: Armada Off-Topic

Hey all,

So I'm trying to work on an armada dice calculator. X-wing has an online one and its super helpful so I've been slowly building one. I started with just a basic enter number of dice and it will return expected damage, expected crits, expected accuracy results, chance of at least 1 crit, chance of at least 1 accuracy, and the individual chance of a crit on each color die.

My next step is accounting for brace tokens and ECM. I'm not 100% sure how to implement this since its been a while since I've done any probabilty.
What I currently has is Expected Damage - (Expected damage/2*(1-Odds of rolling at least 1 accuracy)).

So for example:

Expected damage from 3 red and 4 blue: 5.25

Odds of rolling at least 1 crit on 3 red and 4 blues is 78.80%

Expected damage with a brace token is 2.625

So 5.25-(2.65*(1-.7880)) = 4.69 expected damage.

Am I implementing this correctly?

What do you mean by accounting for brace tokens and ECM?

If you're accounting for a single brace without ECM, then... you've pretty much got it, I think. You'll need to round odd damage totals up after dividing by 2 though, before multiplying by the chance of no accuracy.

Basically trying to make more user friendly. Have a spot to input if you have brace and if you have ECM etc. Just have a single space for output. So if you have a brace token and ECM it means you'll always be able to brace the attack. This started out as a thing to determine if ECM or EWS was better against a 3 red 3 black die attack.

But if it's just expected damage do you need to round up first? If the expected damage is 5.25 without a brace, then with a brace expect should be 2.63.

Hmm. You’re right, simply rounding up isn’t correct. But brace doesn’t just halve damage, which affects the math.

For instance, if your average damage is 4.5 before brace, it’s not just halved to 2.25; it’s slightly higher than that because every instance in which 3 damage occurs leads to 2 after brace, not 1.5. Same with outcomes resulting in 5 initial damage.

So unless I’m mistaken, you need to find the chances of having even or odd damage totals, then translate them to brace that way. This will vary by color and number of dice rolled.

Take an attack pool of 1 black die. We know there’s a 25% chance of 2 damage, which can be braced to 1. There’s a 25% chance of 0 damage. And then there’s a 50% chance of 1 damage, which can’t be reduced by brace, for a total of 0.75 average damage.

This gets challenging quickly and doesn’t *necessarily* seem to scale (a pool of 2 black dice, for example, deals 1.25 avg damage after brace.) Even just a pool of 2 red dice is tricky (note the integers are the damage after bracing, multiplied by the probability):

(0.1406*0)+(0.375*1)+(0.3437*1)+(0.125*2)+(0.0156*2) = ~1 avg damage. Halving the pool would have yielded 0.75 (which makes this a bad example, because it would happen to work plugged into the original formula.)

There is probably a pattern, but it’s 2:30AM where I am and I don’t have the mental energy to find it right now :)

Edited by The Jabbawookie
4 hours ago, The Jabbawookie said:

Hmm. You’re right, simply rounding up isn’t correct. But brace doesn’t just halve damage, which affects the math.

For instance, if your average damage is 4.5 before brace, it’s not just halved to 2.25; it’s slightly higher than that because every instance in which 3 damage occurs leads to 2 after brace, not 1.5. Same with outcomes resulting in 5 initial damage.

So unless I’m mistaken, you need to find the chances of having even or odd damage totals, then translate them to brace that way. This will vary by color and number of dice rolled.

There is probably a pattern, but it’s 2:30AM where I am and I don’t have the mental energy to find it right now :)

Ok you're right, now I see the issue. I hadn't considered that before. So then it may be a little more complicated than I thought.

So I found a pattern with the black dice, the first die is 0.75 damage, and each additional die adds an additional 0.5 damage.

I'll see if theres a pattern for red dice and blue dice, then figure out how things combine next.