This is a tool for calculating dice probabilities and outcomes for X-Wing Second Edition by Fantasy Flight Games. The goal of the tool is to aid players in list building, target selection and token spending by helping to develop intuition about the probabilities of various outcomes.
Computing simple dice probabilities by hand is straightforward, but more complex scenarios involving many tokens and multiple attacks become tedious and error-prone even when using a spreadsheet.
Rather than rely on random simulation, this tool calculates probabilities directly via an exhaustive search of all possible outcomes. This runs extremely fast (a couple milliseconds for most realistic cases) and produces accurate and repeatable results.
Source code for the tool is available on Github under the MIT license. Please feel free to browse the code, fork and/or submit issues and pull requests!
Frequently Asked Questions
-
How can I link or bookmark a specific result?
When you press "Simulate" the address bar will be updated with a link that can be bookmarked or shared to get right back to a given result. This is also a convenient way of comparing results between tabs or windows.
-
How can I see the numbers?
One a result is simulated, simply hover over (or tap) any bar in the charts to see the probabilities.
Alternatively, some of the forms additionally output a data table which makes it easy to copy the results into an external spreadsheet.
-
Which effects and triggers are active?
In general, any effect that you enable is considered to be "active". Any conditions outside of tokens (such as being in arc or at a given range) are assumed to be satisfied if you enable the effect.
Since tokens can change over the course of an attack (particularly in multi-attack situations), effects do respect conditions related to tokens. For instance, Juke will only be active if the owner has an evade token.
If a weapon or effect requires spending tokens to enable the attack (for instance, many munitions require the attacker to discard a target lock to fire) do not include those tokens in the simulation. The simulation effectively begins right before the attacker's initial dice roll, so that is the point in which you should set the token state.
-
What strategies do the attacker and defender employ?
The attacker tries to maximize the number of hits/crits. It will opportunistically prefer crits, but will not greedily "crit chase" by trying to reroll hits into crits.
The defender tries to minimize or entirely avoid taking hits. In cases where there are token spending choices, the defender will prefer to keep tokens that are more useful on defense in case there is a second attack. For instance, if a defender can spend either a focus or evade to fully evade an attack, it will normally prefer to spend the focus and hang onto the evade. While the "optimal" choice depends on additional factors (dice, mods and tokens available to each player), this heuristic works well for the typical situations encountered in X-Wing.
-
What is the Ship Durability calculator for?
The regular calculator answers the question "what is the expected hits after these specific attacks take place in a turn". In contrast, the ship durability calculator answers the question "how many shots can a ship take before being destroyed". These are actually slightly different questions with different answers.
While the ship durability calculator also uses the same underlying branching simulation, it differs in that it terminates states when the defender is destroyed (based on their hit points). This produces a more accurate solution in cases where once per game effects - such as Stealth Device, Iden Versio and so on - are present.
For context, the calculator also shows a comparison of the relative durability of your chosen ship compared to a variety of ships from the game. Note that these comparisons are based on the basic statline of the relevant ship, so they should not be over-generalized as in a real game many other factors are present (tokens, ranges, focus fire, etc).
Note that ship durability can vary a lot depending on the nature of the attack. Try comparing naked 2 dice attacks to 4 dice with focus and lock to see how various ships fare under a variety of attacker conditions.
-
Why can't I set defender tokens on the Ship Durability calculator?
Most tokens are not allowed because they introduce questions of how many of these shots are happening in the same round, in what order and so on. i.e. is the defender going to always have a focus token every time it gets attacked (1v1) or is it going to suffer 6 attacks with only a single token to spend?
The Ship Durability calculator is designed to give a rough idea of the relative durability of various ships. For modeling specific cases with detailed tokens the regular calculator is more appropriate.
Note that reinforce is an exception to this rule since it is persistent between attacks and doesn't get spent. Similarly some pilot and ship abilities are present because they work on every attack. Finally, once per game effects like Stealth Device are also included as they do not refresh after being lost.
-
Can you add [some upgrade] to the calculator?
Anything can be added given the proper time and resources. Generally things that aren't yet implemented fall into a couple of categories.
- Things with too many UI complexities or too much context (example: health/shields of the ships involved).
- Things with unclear rules interactions. This includes cases where card combinations aren't possible in X-Wing today (due to lacking specific upgrade slot combinations or faction limitations), or cases that are possible but rarely used and thus have never received needed clarification in the FAQ.
- Rarely used upgrades, particularly in combination with another one of the downsides.
If you want a specific upgrade prioritized, please feel free to upvote or file an issue on Github
Upgrade Questions
-
When is Predictive Shot used?
Predictive Shot will always be used by the attacker when enabled and if a force is available to spend.
This may differ slightly from the "optimal" use of the ability in every situation but the edge cases are too subtle and involve too much context to reason about dynamically. Thus we chose the predictable behavior that allows you to compare by toggling the upgrade on/off to help determine in what cases it is likely to be a good use of the force point.