Imperial Assault Damage Calculator

By aermet69, in Imperial Assault Skirmish

This calculator is really good: http://mattyellen.github.io/imperial-assault-calculator/

Does anybody know the guy/gal that made it? Would be really nice if it could be updated with a few items such as:

* -1 or more [Surges] to calculate probability of landing a condition.

* -1 or more [Damage] to calculate probability of damage from rGamorreans and/or Multi-Fire from Sentries (I know I can just subtract 1 from the result, but still).

* Rerolls.

34 minutes ago, aermet69 said:

This calculator is really good: http://mattyellen.github.io/imperial-assault-calculator/

Does anybody know the guy/gal that made it? Would be really nice if it could be updated with a few items such as:

* -1 or more [Surges] to calculate probability of landing a condition.

* -1 or more [Damage] to calculate probability of damage from rGamorreans and/or Multi-Fire from Sentries (I know I can just subtract 1 from the result, but still).

* Rerolls.

I really wish this builder implemented rerolls, some they're such a big part of the game at this point.

58 minutes ago, ThatJakeGuy said:

I really wish this builder implemented rerolls, some they're such a big part of the game at this point.

I agree it would be awesome, but from a programmer's point of view it's really hard to do because re-rolls are so situational. Beyond the obvious re-rolling of a blank white die, when would you do a re-roll?

Like say you roll 2 hits on a red die. Going straight "by the numbers" you should probably look to re-roll this, since on average you're going to get a better result. But what if you're attacking a 5-health figure and you're doing exactly 5 damage? Well in that case you're almost never going to re-roll since it's not worth the risk of having the 1 hit side show up. Do you re-roll the single surge on a blue die? Depends on both your surge abilities and on how many other surges you've rolled. Or say you roll the 1-damage, 2-accuracy side of the yellow die and you have unused surge abilities. Is it worth re-rolling into a (guaranteed) better damage result, but risking losing the accuracy? And finally, which side is controlling the re-roll? Right now both the attacker and the defender have a chance to re-roll defence dice, for example.

If it were me coding it, I think I would solve the first problem by giving the user the option to define the damage thresholds they're looking for. "Re-roll for at least x damage" (for attack re-rolls) and "Re-roll for a max of y damage" (for defense re-rolls).

As for the rest of it, I can't think of any way around it other than through brute force simulation (although maybe the statisticians among you could do better?). Basically for every calculation you run, you'd have to run it over and over assuming that each die was re-rolled and then take the best result. I'm not sure how he does the simulations behind the scenes now, but that could potentially add a long time to each calculation.

Edited by ManateeX

I can imagine that the rerolls are hard to program in - but the two other features shouldn't be that hard I assume.

1 hour ago, aermet69 said:

I can imagine that the rerolls are hard to program in - but the two other features shouldn't be that hard I assume.

I think that the conditions piece is fairly easy to estimate. You can use the calculator's second page and run an attribute test to get the odds of at least one surge. But more often you can adjust the damage curve to imagine a surge instead.

For example, the odds of a focused Chewie stunning Vader:

On the calculator, I roll (1 innate) + RBYG against 5 blocks (I just set Vader's defense to 5 blocks, assuming that with the re-roll and Zillo, he can probably get near there regularly.

This yields a damage curve of:
1: 100%
2: 92%
3: 74%
4: 46%
5: 18%
6: 3%

Now, if I assume that this damage curve includes surging for 2 damage, then I can pull everything 2 spaces left and take the 3 value: Against 5 blocks, Chewie has a 74% chance of landing 1 damage + stun.

It's not precise, because some of the cases included in that 74% may be pure-damage cases (Innate 1 + R2 + B2 + G2 +Y2 = 9 damage. 9 - 5 blocks = 4. 4 >3, so it's one of the cases included in the 74% chance of dealing "at least" 3 damage against 5 blocks). On the other hand, some of the cases might include redundant surges, since there's no way to include Chewie's +2 acc or stun surges in the calculator, and, after all, one of his dice is yellow. Also, because of the yellow die, your odds of rolling more than one surge are pretty good, so you may not need to take the damage curve position that's a whole 2 less in the first place -- my method has a bit of mathematical conservatism to it.

So you're left with an imprecise result: somewhere near or better than 7 in 10 odds of stunning Vader with Chewie, short of shenanigans on either side?

That can answer the basic question for me: Can Chewie reliably stun Darth Vader? The answer is "yes," but with the cautionary note that lots can still go wrong. Vader could roll 7 blocks instead of 5 (odds drop to somewhere around 18%). Vader could Brace for Impact . Chewie could whiff the roll badly, or roll up damage on the yellow die. Etc.

Still not a perfect tool, but as @manatee_x wrote above, it's really difficult to get a tool that can precisely simulate gameplay decisions. This one at least shows what's possible and, to some extent, what's likely.

Edited by GottaBadFeelingAboutThis
5 hours ago, ThatJakeGuy said:

I really wish this builder implemented rerolls, some they're such a big part of the game at this point.

I pulled mattyellen's code and implemented some attack-based reroll options. I could use some beta testing, for sure.

https://christopheremmick.github.io/imperial-assault-calculator/

7 hours ago, cnemmick said:

I pulled mattyellen's code and implemented some attack-based reroll options. I could use some beta testing, for sure.

https://christopheremmick.github.io/imperial-assault-calculator/

Thats cool, but as a next step can you add the ability to remove symbols from attacks?

Such as removing the Dodge for Hired Guns, or Evades/Surges if Weakened.

11 hours ago, cnemmick said:

I pulled mattyellen's code and implemented some attack-based reroll options. I could use some beta testing, for sure.

https://christopheremmick.github.io/imperial-assault-calculator/

The problem that I have found is that rerolls and normal attacks come out exactly the same, because your odds for rolling any one side of the dice remain constant. adding the reroll doesn’t show any percent change in damage.

2 hours ago, player1155101 said:

The problem that I have found is that rerolls and normal attacks come out exactly the same, because your odds for rolling any one side of the dice remain constant. adding the reroll doesn’t show any percent change in damage.

Indeed, but you only reroll worst cases, so the effect is that damage curve is slightly higher overall. How much lower/higher depends on die and situation.

Edited by Golan Trevize
14 hours ago, cnemmick said:

I pulled mattyellen's code and implemented some attack-based reroll options. I could use some beta testing, for sure.

https://christopheremmick.github.io/imperial-assault-calculator/

Nice job, but the impact of a reroll looks negligible. I tried Han Vs Black die rerolling green die and it feels wrong. Usually Han's reroll can bring at least one additional damage in a consistent way. I understand rerolling conditions you can set are more limited than the actual rerolling strategy of a player but results are misleading for a reader. They suggested to me Han doesn't really gain anything from reroll.

5 hours ago, Golan Trevize said:

Nice job, but the impact of a reroll looks negligible. I tried Han Vs Black die rerolling green die and it feels wrong. Usually Han's reroll can bring at least one additional damage in a consistent way. I understand rerolling conditions you can set are more limited than the actual rerolling strategy of a player but results are misleading for a reader. They suggested to me Han doesn't really gain anything from reroll.

Ok, I see where I went wrong with implementation. This is *exactly* why I needed some fresh eyes on it. Thanks, everybody!

On 3/12/2018 at 6:30 AM, aermet69 said:

This calculator is really good: http://mattyellen.github.io/imperial-assault-calculator/

Does anybody know the guy/gal that made it? Would be really nice if it could be updated with a few items such as:

* -1 or more [Surges] to calculate probability of landing a condition.

* -1 or more [Damage] to calculate probability of damage from rGamorreans and/or Multi-Fire from Sentries (I know I can just subtract 1 from the result, but still).

* Rerolls.

You can find the creator on board game geek. I'd have to do some digging to find the thread, but that's where this calculator was originally posted.

6 hours ago, cnemmick said:

Ok, I see where I went wrong with implementation. This is *exactly* why I needed some fresh eyes on it. Thanks, everybody!

Let us know when fixed, I will give it a go! Also at the moment you can combine roll condition with AND, I wish to use OR in some cases. In example for Han:

Reroll GREEN if 0 or 1 damage
- OR -
Reroll BLUE if 0 or 1 damage

We would still lack of control on surges but this would be a nice improvement.

Reroll is a bit finicky to implement: it all depends on what was the result and what abilities each unit have. Take Han for example, let's say he rolled the maximum dmg possible: 2D on blue, 2D on green1, 1D1S on green 2

Theoretically you wouldn't want to reroll, but if your opponent rolls an evade then you'd want to reroll green 2 (and thus make it looks like you're making suboptimal decisions: why are you rerolling perfect rolls? when yes you're deliberately trying to reroll that surge:+2D away)

I'd love to see some kind of "if X then Y" triggers

Deadly is "if surge then -dodge"

Weaken is "if surge then -surge" or "if evade then -evade"

You can also somewhat simulate reroll with this: Vader's foresight would be "if 1 block then +1block" and "if evade then +1 block" (you can usually reroll into something better). Against enemy that can do surge:Pierce 3 you'd just remove the 2nd if-then

One just has to love the most context dependant die of them all, the Yellow die.

Depending on the surges on your deployment card, the right choice of reroll or not will be exceptionally different. Rerolling the max damage die (2 damage) will happen frequently as it has less then max range and no surges and if you are meeting range and do not have super sucky surges then the max damage result may well be the worst or second worst one in competition with the 1d+2r side.

And then we have the defence Dice. If pierce 3 is better then +2 damage will depend on the roll on the defence Dice, if we need to try to reroll into more surges will depend on the defence Dice, ....

And then we have deployments automatic defence effects that complicates things even further.

So making the analysis of the optimal reroll will be pretty tricky to code.

Edited by Ram
15 hours ago, ricope said:

Reroll is a bit finicky to implement: it all depends on what was the result and what abilities each unit have. Take Han for example, let's say he rolled the maximum dmg possible: 2D on blue, 2D on green1, 1D1S on green 2

Theoretically you wouldn't want to reroll, but if your opponent rolls an evade then you'd want to reroll green 2 (and thus make it looks like you're making suboptimal decisions: why are you rerolling perfect rolls? when yes you're deliberately trying to reroll that surge:+2D away)

Actually, you want to reroll the green with 2 damage. No matter what you either break even (single surge or back into 2 damage) or you go up (one of the 1 damage, 1 surge faces).

15 minutes ago, ThatJakeGuy said:

Actually, you want to reroll the green with 2 damage. No matter what you either break even (single surge or back into 2 damage) or you go up (one of the 1 damage, 1 surge faces).

In the case where the opponent does not roll an evade, you do not want to reroll since you can not really do any better (2 damage or 1 damage + surge for 1 damage) and in one case (single surge for 1 damage) you will do worse. Assuming the +2 damage has already been used from the surge from the other green die in the original example.

Edited by Ram
1 hour ago, Ram said:

In the case where the opponent does not roll an evade, you do not want to reroll since you can not really do any better (2 damage or 1 damage + surge for 1 damage) and in one case (single surge for 1 damage) you will do worse. Assuming the +2 damage has already been used from the surge in the original example.

I was just working within the "single evade rolled" framework, like the guy I was quoting.

Edited by ThatJakeGuy

So if you're trying to code all of those cases, what if the defender also has a reroll? :P Like in the Han example above, you want to reroll the double green damage but only assuming that the defender doesn't reroll the evade, which he very likely would... depending on the results of your reroll. And depending on the health of the figure. And depending on whether he has a card to burn for Zillo. And depending on..............

I still think that the only way to make a really useful calculator with a reroll would be to give the option to the attack a "desired damage" threshold representing the health of the figure - the algorithm would have the attacker re-roll trying to reach that damage (or otherwise get as high as possible?), while the defender would try and reroll until they are under that damage. The user would have to set that damage based on whatever situation they expect to encounter.

3 hours ago, ThatJakeGuy said:

Actually, you want to reroll the green with 2 damage. No matter what you either break even (single surge or back into 2 damage) or you go up (one of the 1 damage, 1 surge faces).

even then, it's pretty subjective. if you need that extra damage to finish a figure, you'll be better off re-rolling the green with a surge. Yeah, you have a 1/6 chance to lose a damage, but 3/6 to gain a damage. for better odds of killing a figure, i'll risk a small chance of leaving it with 2 health. 1-2 health left probably means sinking another attack into that figure anyway.

5 hours ago, Fightwookies said:

even then, it's pretty subjective. if you need that extra damage to finish a figure, you'll be better off re-rolling the green with a surge. Yeah, you have a 1/6 chance to lose a damage, but 3/6 to gain a damage. for better odds of killing a figure, i'll risk a small chance of leaving it with 2 health. 1-2 health left probably means sinking another attack into that figure anyway.

Now we're adding another layer. If I just needed the one more damage, I'd agree with you. If you aren't going to get a kill either way, though, I'd default to the 2D reroll because that way I'm not ever going down.

19 hours ago, ManateeX said:

I still think that the only way to make a really useful calculator with a reroll would be to give the option to the attack a "desired damage" threshold representing the health of the figure - the algorithm would have the attacker re-roll trying to reach that damage (or otherwise get as high as possible?), while the defender would try and reroll until they are under that damage. The user would have to set that damage based on whatever situation they expect to encounter.

I agree with this, we should aim to something that can give us hints of what is the right way to go to achieve our target. In example one question I may have is: what's the impact of a reroll on chewie? Is that really worth having a droid with Trusted Ally around? Can I consistently (>85% cases) one shot 5 HP figures? To do that I would take, let's say chewie's pool, then plot (for black and white defense) the regular case, then plot the 1 red die reroll case, then plot the yellow die reroll case and then blue case. I would look at results and say "I get more or less +1 damage where it really matters for me" or "this isn't enough".

Edited by Golan Trevize