I finally figured out the math on Stealth Device! (x-posting from reddit)

By EdgeOfDreams, in X-Wing



I don't think I'd seen this math done on either site before, so here it is:


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------


I realized the trick to evaluating Stealth Device is to treat it like a series of coin flips, where you want to see how many heads (evades) you can get in a row. It only makes sense if you think of the extra die from Stealth Device as separate from your other defense dice, in which case there are three possibilities each time you get attacked:


  1. You roll well enough on your other defense dice that you don't need the extra one from Stealth Device. (We can effectively ignore these attacks for our math, because Stealth Device might as well not exist for these).
  2. You roll exactly enough on your other defense dice to leave 1 damage left over, and Stealth Device may or may not save you.
  3. There's 2 or more damage remaining after you roll your other defense dice, so Stealth Device might negate one more damage, but it's gone after that either way.

So, if Case 1 happens all the time, you're just ungodly lucky. We can ignore that one.


If Case 3 is happening every time, then your Stealth Device will NEVER be worth more than 1 negated damage, equivalent to a Hull or Shield Upgrade. This is why Stealth Device is only worth using on ships with 3 Agility.


Case 2 is the interesting part. This is where if Stealth Device succeeds, you get to keep using it.


Imagine a game where Case 2 is all that ever happens. You always roll exactly 1 less evade than you need on your main dice. This is where Stealth Device has maximum potential. How many times will Stealth Device save your ass? (Ignore Focus, for the moment).


The answer is (5/8) (the chance that it just fails) times [(3/8) (the chance that it works 1 time) + (3/8 \* 3/8) * 2 (chance to work 2 times in a row) +....]


In other words, we need an infinite series to represent this. [To Wolfram Alpha!] (http://www.wolframalpha.com/input/?i=5%2F8+*+sum+from+1+to+infinity+of+n+*+%283%2F8%29%5En)


The answer is 0.6. On average, in the *best case* scenario, Stealth Device will negate 6/10ths of a point of damage. Since X-Wing doesn't deal in fractional damage, that means Stealth Device is failing to even live up to the value of Hull Upgrade. 5/8ths of the time, it will fail you and accomplish nothing, and the rest of the time, it will probably only negate 1 damage, maybe 2 or 3 on a really lucky day.


But! What about with focus?


That changes the formula quite a bit. Now we're looking at 3/8ths chance of failure and 5/8ths chance of success. [To the math-chamber!](http://www.wolframalpha.com/input/?i=3%2F8+*+sum+from+1+to+infinity+of+n+*+%285%2F8%29%5En)


Now we're talking! 1.66... damage negated on average. In this scenario, Stealth Device pays for itself compared to Hull Upgrade in a good bit more than half of your games, and you can expect it to negate 2 or 3 damage often enough that it definitely is better than a Hull Upgrade, or even a Shield Upgrade.


But! You don't get Case 2 all the time.


Unfortunately, there are going to be those games where you get hit with a Case 3 attack early on and can't prevent the loss of your Stealth Device. The real question is, how often does that happen?


I sadly have no concrete answer. Still, we can make some guesses and do some math to get a vague idea.


For example, if we assume that a Case 3 attack is the first one you come up against in every game, then Stealth Device will consistently negate 3/8ths or 5/8ths of a damage, then get lost. Under those conditions, it's not worth the money at all.


If a Case 3 attack happens right away in about half of your games, but happens never in the other half of your games, and you always focus for defense, you're looking at a weighted average of .5 (5/8) + .5 (1.66...) = roughly 1.15 damage negated per game. Slightly better than Hull Upgrade, but possibly not worth relying on.


What can we conclude from all this? The more you can do to reduce Case 3 situations (stay at Range 3 for an extra die, deny your opponent actions and tokens, have evade tokens, etc.), the more likely it is that you'll get full value out of your Stealth Device. On the flip side, the best way to kill a Stealth Device user is to attack multiple times in the same round to strip away the tokens, or bump to prevent actions, while boosting your own attack dice as much as possible, thus tilting the odds of a Case 3 event in your favor.


TL;DR

  • The average expected value of Stealth Device on an Agility 3 ship with no defensive tokens is AT BEST .6 damage negated per game. NOT WORTH IT
  • The average expected value on an Agility 3 ship that always has a Focus token to spend on defense is AT BEST 1.66... damage negated per game. WORTH IT, if you're willing to play the odds.
  • The value of a Stealth Device goes up massively if you can ensure as many near-misses as possible.
  • This is why Soontir Fel with a Focus Token, an Evade Token, and Stealth Device is so **** hard to kill.
  • Autothrusters triggering + Stealth Device + Focus Token = a guaranteed evade result, just like C3P0 guessing zero on a 1-agility ship.
  • To kill a Stealth Device target, take away its tokens however you can.

So, in the current meta. If I take Soontir Chiraneau what are the best options for the two choice of upgrades below?

Soontir: PTL Auto

Stealth or Auto?

Vader is pretty nasty for Stealth device. Hull seems like a better choice, and stay R3 or out of arc of turrets and hope to last through 4 hp, which is better.

Chiraneau: VI EU Gunner

Isard or Rebel Captive or Vader??

So far, I'm feeling that not enough other match ups have a 3 pt Soontir to worry about, and taking 2 damage on Vader hurts. I'd rather have Isard and Rebel Captive. Your choice?

Autothrusters is better than Stealth Device. Both together is amazing. Thay said, if you're worried about Vader, Autothrusters + Shield Upgrade is as good as it gets.

I don't fly decimators often enough to advise you on that question.

Personally, if I'm going Decimator and interceptor I fly R.A.C. Isaard, Vader, Rebel Captive, Expose and Experimental Interface. Soontir Fel usually rocks PTL, thrusters and a targeting computer, because if I'm putting that many points into a 3 hp ship, it needs to be able to do reliable damage and with Soontir, I should be able to work my way into 1 or less defending rolls a round, meaning my TL+Focus+Evade should be enough to weather it and punch hard.

If green dice > red dice then it is a fair chance that the attack will be canceled. If red dice tie or beat green dice then unless the roll is all blanks you could say that damage is imminent.

But there is always the chance that green will roll all blanks!

My stealth devices always cancel no hits at all, and go away on the first attack.

/fickle green dice

Adding the math for autothrusters and stealth device should see its efficiency slightly improve.

Can the math account for Stealth Device negating a critical? Hull Upgrade allows you to absorb one more damage before being destroyed while Stealth Device allows you to potentially avoid that damage altogether and, as you have shown, with focus perhaps more than once.

I don't know how you can make conclusions without treating the whole problem, just cherry-picking some instances. If I take 4 balls out of a bag with 100, and two are red, two are black, does that mean I have a 50% chance of getting a red ball in the rest of the bag? NO.

I mean, what you did is cute, but not complete enough to make any conclusions.

I also think your case 2 is inherently flawed. I'm no statistical math expert, but I think you can't designate one dice to be the Stealth Device dice. You have to take into consideration the whole roll. So immediately you have to think "but who's attacking me?"

Let's assume you have focused HLCs coming your way. The damage distribution with or without Stealth Device is the following (you don't have focus):

0dmg 1dmg 2dmg 3dmg 4dmg

without SD: 0.13 0.23 0.32 0.24 0.08

/w SD: 0.22 0.27 0.29 0.18 0.05

You also have a 22% chance of retaining your Stealth Device and average damage taken is reduced by 0.33 NOW we can do your infinite series. Let's assume you are attacked by HLCs ad infinitum. You have 78% chance of getting 0 bonus from Stealth Device. If the first attack hits, you saved 0.33 damage on average.If the second attack hits, then you saved 0.33 from the first and 0.33 from the second. The sum is (0.78 * 0.22^k * (k+1) * 0.33), for k from 0 to infinity, yielding 0.42. Clearly worse than Hull upgrade.

But what if you're attacked by Ties?

0dmg 1dmg 2dmg

without SD: 0.5 0.3 0.1

/w Sd: 0.65 0.26 0.09

You escape 0.18 damage by using Stealth Device, with a 65% of keeping it. The sum is now (0.35 * 0.65^k * (k+1) * 0.18 ---- k 0 to infinity), which is 0.51. Still not good!

But what if you had focus, and only 1 Tie attacked you per round? Then you would have 91% chance of keeping your Stealth Device, with an extra 0.12damage evaded per attack. This finally gets to 1.33 damage, better than Hull.

And I do not claim this is complete! This is still very far from what actually happens, since Soontir has 2 focus tokens, 1 evade and potentially Autothrusters triggering! There are many things which help him survive in the long run, one of those is the fact that he's not facing everything in one round, so he can benefit from tokens again.

I have a script that calculates the whole tree of possibilities for several attacks on a single target with a number of focus tokens and evades. The defender chooses to spend focus or not depending on which sub-tree has the least average damage. I could include Stealth Device in there, currently it isn't. That would be complete. You would know how Soontir fares in a round against say 3 B-wings with HLCs for several consecutive rounds. That would be complete in the sense that you would calculate how much Stealth Device is worth on Soontir for *that* matchup.



OP - I think your calculations are off. If it even works once it is worth a shield upgrade at the very least which costs 1 point more.

The only time this doesn't work at all is when you roll all blanks on the first attack against you.

I use SD on Rexler Brath all the time and in 20 games it only got stripped the first attack twice but I only took 1 damage 1 time and 3 the other. Neither of those were full blank rolls.

Look at it this way, if you roll 4 green dice instead of 3 and get 1 evade, that could have been the extra die that SD gave you. This makes it like a free extra shield.

Any upgrade like this is a gamble(Predator,Lone Wolf,etc). I'll take SD over hull or shield any day, even on a 2 agility ship.

Edited by Ynot

...your case 2 is inherently flawed. I'm no statistical math expert, but I think you can't designate one dice to be the Stealth Device dice. You have to take into consideration the whole roll. So immediately you have to think "but who's attacking me?"

Right. The problem with Stealth Device isn't that it's ineffective, but that it's inconsistent; its effectiveness depends on the game state during each attack, and there are a lot of relevant variables there that EdgeofDreams isn't taking into account.

I'm no statistical math expert, but I think you can't designate one dice to be the Stealth Device dice. You have to take into consideration the whole roll.

Rolling a different looking die or rolling one separately would allow you to track how often Stealth Device was effective, I don't see why you shouldn't be able to do something similar with math.

I'm not going to pretend that I understand the math needed to do it but it seems that you should be able to designate a single die to be the stealth die, calculate the odds of normal defense dice letting one or more hits through, and then calculate the odds of the stealth die negating one or more point of damage, and then use that to derive the expected number of attacks that the Stealth Device would survive and the amount of damage it would stop.

I'm no statistical math expert, but I think you can't designate one dice to be the Stealth Device dice. You have to take into consideration the whole roll.

Rolling a different looking die or rolling one separately would allow you to track how often Stealth Device was effective, I don't see why you shouldn't be able to do something similar with math.

I'm not going to pretend that I understand the math needed to do it but it seems that you should be able to designate a single die to be the stealth die, calculate the odds of normal defense dice letting one or more hits through, and then calculate the odds of the stealth die negating one or more point of damage, and then use that to derive the expected number of attacks that the Stealth Device would survive and the amount of damage it would stop.

I take that back. What I meant is that you can't look at a single dice and say that 3/8 times this helps you, 5/8 times it doesn't. If you know the statistics of a roll, you can calculate the added advantage of the Stealth Device. For instance, in my example you had 23% chance to do 1 damage with a focused HLC on a 3-dice ship without Stealth Device. The probability of not taking damage with Stealth Device is equal to the probability of not taking damage before + 3/8 * Probability of 1 damage without Stealth Device. This sanity check works out for the example I've provided.

Also, the effectiveness of Stealth Device relies on having some sort of dice modifier like focus or evade. If you have both it is very effective like you would on a PTL'd Interceptor.

If you have no modifiers, then it is purely statistical luck of the draw.

I've had great success with it on both the interceptors and the tie defender.

I'm no statistical math expert, but I think you can't designate one dice to be the Stealth Device dice. You have to take into consideration the whole roll.

Rolling a different looking die or rolling one separately would allow you to track how often Stealth Device was effective, I don't see why you shouldn't be able to do something similar with math.

But the overall result doesn't care which die an evade result came from. To give a real-world equivalent of the reasoning, here, suppose you're playing an Alpha Squadron Pilot with Stealth Device. You mark one of the dice with a small (dry-erasable, of course) dot at each point, so you know that's the Stealth die.

You roll several times, recording the result of the stealth die and whether it made a difference. But in the middle of a defense roll, you realize you just barely dodged an attack--but the mat has rubbed off the marks! Which die was it that saved you: the Stealth die, or one of the regular ones?

***

Given a particular game state, you can compare the distribution of attack results (meaning the number of uncanceled [boom] and [kaboom] results) for a ship with (say) a Hull Upgrade to the results if that ship had an extra defense die instead. The problem with Stealth Device is that unlike most game elements in X-wing, it has "memory"; in order to figure out whether it's operating, you have to know the outcome of every previous attack.

So in order to figure out the "average" value of a Stealth Device, you have to make a lot of assumptions about the range of possible game states, and then carry those game states out for multiple attacks--until you're hit, in any case, at which point Stealth has no effect.

It's a solvable problem, but there's a lot of steps involved in solving it, and as far as I know no one has done so.

I'm no statistical math expert, but I think you can't designate one dice to be the Stealth Device dice. You have to take into consideration the whole roll.

Rolling a different looking die or rolling one separately would allow you to track how often Stealth Device was effective, I don't see why you shouldn't be able to do something similar with math.

But the overall result doesn't care which die an evade result came from. To give a real-world equivalent of the reasoning, here, suppose you're playing an Alpha Squadron Pilot with Stealth Device. You mark one of the dice with a small (dry-erasable, of course) dot at each point, so you know that's the Stealth die.

You roll several times, recording the result of the stealth die and whether it made a difference. But in the middle of a defense roll, you realize you just barely dodged an attack--but the mat has rubbed off the marks! Which die was it that saved you: the Stealth die, or one of the regular ones?

Precisely what you said. You can't look after the roll and say that you escaped because of the Stealth Dice. What you *can* say, however, is the following:

I had 13% chance to evade without any Stealth Device and I had 21% chance of not taking damage with Stealth Device. Knowing now that I evaded the attack, the probability that it was the Stealth Device dice's fault is (21-13)/21 => 38.09% chance (unfortunately this is close to 3/8, so don't confuse it with that one).

I think the most useful way to look at it is you look at the scenarios it's strong against, look at the scenarios you want to increase your strength against, and see if they overlap. Broadly, if you're weak against HLCs, go with Hull Upgrade. If you're weak against massed attacks, go with Stealth.

Can the math account for Stealth Device negating a critical? Hull Upgrade allows you to absorb one more damage before being destroyed while Stealth Device allows you to potentially avoid that damage altogether and, as you have shown, with focus perhaps more than once.

I haven't tried to deal with the differences between hits and crits yet. The approach might be, IF Stealth Device negates a point of damage, what are the odds that particular point of damage was from a <crit> die result rather than a <hit> result? You could do the math assuming your opponent is rolling standard dice, but the math would change if you face a Mangler Cannon or an HLC, each of which affects the chances that there will be a <crit> result.

  • Autothrusters triggering + Stealth Device + Focus Token = a guaranteed evade result, just like C3P0 guessing zero on a 1-agility ship.

Worth pointing out that this is true whether you have Stealth Device or not. A non-zero number of dice with (triggered) Authothrusters plus a focus is a guaranteed evade result.

I'm no statistical math expert, but I think you can't designate one dice to be the Stealth Device dice. You have to take into consideration the whole roll.

Rolling a different looking die or rolling one separately would allow you to track how often Stealth Device was effective, I don't see why you shouldn't be able to do something similar with math.
But the overall result doesn't care which die an evade result came from. To give a real-world equivalent of the reasoning, here, suppose you're playing an Alpha Squadron Pilot with Stealth Device. You mark one of the dice with a small (dry-erasable, of course) dot at each point, so you know that's the Stealth die.You roll several times, recording the result of the stealth die and whether it made a difference. But in the middle of a defense roll, you realize you just barely dodged an attack--but the mat has rubbed off the marks! Which die was it that saved you: the Stealth die, or one of the regular ones?***Given a particular game state, you can compare the distribution of attack results (meaning the number of uncanceled [boom] and [kaboom] results) for a ship with (say) a Hull Upgrade to the results if that ship had an extra defense die instead. The problem with Stealth Device is that unlike most game elements in X-wing, it has "memory"; in order to figure out whether it's operating, you have to know the outcome of every previous attack.So in order to figure out the "average" value of a Stealth Device, you have to make a lot of assumptions about the range of possible game states, and then carry those game states out for multiple attacks--until you're hit, in any case, at which point Stealth has no effect.It's a solvable problem, but there's a lot of steps involved in solving it, and as far as I know no one has done so.

(Look under "can anyone suggest a change to this leebo/corran build")

Also, note there is a arithmetic error in the calc comparing f2 to the focus that skews the results.

Edited by Stoneface

I'm no statistical math expert, but I think you can't designate one dice to be the Stealth Device dice. You have to take into consideration the whole roll.

Rolling a different looking die or rolling one separately would allow you to track how often Stealth Device was effective, I don't see why you shouldn't be able to do something similar with math.
But the overall result doesn't care which die an evade result came from. To give a real-world equivalent of the reasoning, here, suppose you're playing an Alpha Squadron Pilot with Stealth Device. You mark one of the dice with a small (dry-erasable, of course) dot at each point, so you know that's the Stealth die.You roll several times, recording the result of the stealth die and whether it made a difference. But in the middle of a defense roll, you realize you just barely dodged an attack--but the mat has rubbed off the marks! Which die was it that saved you: the Stealth die, or one of the regular ones?***Given a particular game state, you can compare the distribution of attack results (meaning the number of uncanceled [boom] and [kaboom] results) for a ship with (say) a Hull Upgrade to the results if that ship had an extra defense die instead. The problem with Stealth Device is that unlike most game elements in X-wing, it has "memory"; in order to figure out whether it's operating, you have to know the outcome of every previous attack.So in order to figure out the "average" value of a Stealth Device, you have to make a lot of assumptions about the range of possible game states, and then carry those game states out for multiple attacks--until you're hit, in any case, at which point Stealth has no effect.It's a solvable problem, but there's a lot of steps involved in solving it, and as far as I know no one has done so.
Dracon Pryothayan did a very good analysis of focus, evade and R2-F2 in a thread in squad building. If you treat R2-F2 as the SD you can get an idea of it's effectiveness. In the case looked at F2 was as effective as a focus token during the second attack and more effective than an evade token during the third attack.

(Look under "can anyone suggest a change to this leebo/corran build")

Also, note there is a arithmetic error in the calc comparing f2 to the focus that skews the results.

Not necessarily. Stealth Device works much like R2-F2 *until* you get hit. Which can very well happen on the first attack or on the second etc. That's why it's much harder to calculate in scripts, because you have to traverse each tree of possibilities (did I get hit? I still have 4 dice on the 2nd attack vs. I have only 3 dice from now on). I also had a calculation on invulnerable Biggs for Epic purposes (he had R2-F2 + evade + 5-6 focus tokens), can't remember the results by heart though.

SD is hard to quantify precisely because it's effectiveness varies wildly based on context. Going to 4 AGI against 2 ATK ships? Could last the whole game if you avoid collisions and maintain tokens. Against 4-dice attacks, likely gone on first round of attacks, even with tokens, if you fail to arc dodge successfully.

There is no definitive answer on SD vs Shield vs Hull. It's how you fly, what you anticipate facing, what you actually face, and how you respond in the game as it plays out. Great arc dodge players can stay at R3 with SD and tokens and be unbelievably hard to hit. That's the exception, not the rule. For most, you'll get pegged by a single attack when vulnerable (R1, tokenless, etc.) and be annihilated. Or you'll face lists with passive damage potential and the SD will be utterly pointless, but the Hull/Shield are gold.

It's just too hard to quantify in a meaningful way.

What if C A T spelled dog?...*blinkblink*

SD is hard to quantify precisely because it's effectiveness varies wildly based on context. Going to 4 AGI against 2 ATK ships? Could last the whole game if you avoid collisions and maintain tokens. Against 4-dice attacks, likely gone on first round of attacks, even with tokens, if you fail to arc dodge successfully.

There is no definitive answer on SD vs Shield vs Hull. It's how you fly, what you anticipate facing, what you actually face, and how you respond in the game as it plays out. Great arc dodge players can stay at R3 with SD and tokens and be unbelievably hard to hit. That's the exception, not the rule. For most, you'll get pegged by a single attack when vulnerable (R1, tokenless, etc.) and be annihilated. Or you'll face lists with passive damage potential and the SD will be utterly pointless, but the Hull/Shield are gold.

It's just too hard to quantify in a meaningful way.

This is true but it is comapring SD to hull or shield and as far as I'm concerned it gives you similar functionality to shield upgrade(possibly blocking a crit too) for the cost of a hull upgrade which is only a single use.

If SD gets to the second round of attack against you it has been worth it leaving the only question that if it goes out the first round, was it still worth it.

Lets say with modifiers you get 3 evades out of 4 dice against a 4 hit HLC. The chances of getting 3 out of 4 with modifiers is more likely than 3 out of 3 without even bothering to do any kind of compicated math. Just like attack, the more dice you roll, the better your chances for success. Even with this first shot hlc attack that strips SD, you probably faired much better than trying to get 3 out 3 which would have meant you were taking at least 1 regardless. I'd rather have the chance at evading them all then not. As they say in golf, 100% of the shots that don't reach the hole won't go in. If you are only rolling 3 grean aginst 4 hits you are taking damage for sure.

I am sold on Stealth Device and swear by it as I have used it very successfully in many games. I don't have any builds that I play right now that don't include stealth device on at least 1 ship. I save my focus for defence when I have SD and know I'm getting shot at.

SD is hard to quantify precisely because it's effectiveness varies wildly based on context. Going to 4 AGI against 2 ATK ships? Could last the whole game if you avoid collisions and maintain tokens. Against 4-dice attacks, likely gone on first round of attacks, even with tokens, if you fail to arc dodge successfully.

There is no definitive answer on SD vs Shield vs Hull. It's how you fly, what you anticipate facing, what you actually face, and how you respond in the game as it plays out. Great arc dodge players can stay at R3 with SD and tokens and be unbelievably hard to hit. That's the exception, not the rule. For most, you'll get pegged by a single attack when vulnerable (R1, tokenless, etc.) and be annihilated. Or you'll face lists with passive damage potential and the SD will be utterly pointless, but the Hull/Shield are gold.

It's just too hard to quantify in a meaningful way.

On the one hand, everything you said is correct. On the other hand, I don't like just throwing up my hands and saying, "Oh well, it can't be analyzed." The math I did shows the performance you can expect from an ideal situation (always having focus, only getting attacked once per round, always having Focus, never having an attack where you're guaranteed to lose SD, no non-attack sources of incoming damage), and the result is that AT BEST, Stealth Device is 66.67% better than a Hull/Shield Upgrade. It's an upper bound, not a realistic game.

The important thing is that the upper bound still tells us a few things about how you should build your squad. It tells us that unless you expect to have other sources of defensive modifiers, Stealth Device is simply not mathematically worth using. It also tells us that when you DO have sources of defensive modifiers, Stealth Device is probably worth its point cost, on average across many games. Obviously, if you have prior knowledge about the meta and squads you expect to fly against, that's going to influence your decision to take SD or not. My math just gives us a little more detail to base that decision on.