Probability Calculator

By Qark, in Star Wars: Legion

Hi everyone. I have written a probability calculator for legion using C#

You put in the attacking and defending unit info, then the program simulates the attack steps thousands of times to determine the probability of each outcome. It will output the probability of each number of hits, the probability of getting at least a number of hits, the average, the median, the mode, and the standard deviation.

The code is available on GitHub:

https://github.com/andrew-s-hart/SW-Legion-Probability-Calculator

or if you don't care about the code and just want to run the exe you can get that here:

https://github.com/andrew-s-hart/SW-Legion-Probability-Calculator/raw/main/SW-Legion-Probability-Calculator-master/LegionCalculator/LegionCalculator.exe

I am using 64bit windows 10 and haven't tested the program on anything else. I am not a professional programmer and haven't used GitHub before so any suggestions are welcome.

Calc.jpg.f9b7ef95eec5dd67da5a84ad769633ce.jpg

Edited by Qark
Updated software

Sweet! thanks for this..

Insane!!

Is simulating easier than calculating?

37 minutes ago, Rumar said:

Is simulating easier than calculating?

To program, yes. Computationally, probably not. It was the simplest way I could think of to cover every possible combination of dice and abilities.

Looks great. Units can have more than one Dodge or Aim token, right? Would that need to be accounted for?

2 hours ago, KalEl814 said:

Looks great. Units can have more than one Dodge or Aim token, right? Would that need to be accounted for?

You are correct! Ill make an update.

I think that is all working now. Links above are now for the new version.

this calc is amazing. makes me rethink everything!

On 4/10/2018 at 6:37 PM, Qark said:

Hi everyone. I have written a probability calculator for legion using C#

You put in the attacking and defending unit info, then the program simulates the attack steps thousands of times to determine the probability of each outcome. It will output the probability of each number of hits, the probability of getting at least a number of hits, the average, the median, the mode, and the standard deviation.

The code is available on GitHub:

https://github.com/andrew-s-hart/SW-Legion-Probability-Calculator

or if you don't care about the code and just want to run the exe you can get that here:

https://github.com/andrew-s-hart/SW-Legion-Probability-Calculator/raw/master/LegionCalculator.exe

I am using 64bit windows 10 and haven't tested the program on anything else. I am not a professional programmer and haven't used GitHub before so any suggestions are welcome.

Untitled.png

Any chance of an update for danger sense? Love the tool (so does discord!)

Dang this is awesome. Certainly bests me asking my mathematician sister to explain dice probabilities to me 🤣

Nice, great job.

4 hours ago, DwightE1 said:

Any chance of an update for danger sense? Love the tool (so does discord!)

Yeah I can do that. Should also put in Armour X. Any thing else I have missed? It'll take a few days. I had no idea anyone was actually still using this thing.

Edited by Qark
1 hour ago, Qark said:

Yeah I can do that. Should also put in Armour X. Any thing else I have missed? It'll take a few days. I had no idea anyone was actually still using this thing.

Phht! At least once after every game to see if my stupid decision was the right move! Someone did a huge breakdown on the discord today with pathfinders vs everything.

14 hours ago, Qark said:

Yeah I can do that. Should also put in Armour X. Any thing else I have missed? It'll take a few days. I had no idea anyone was actually still using this thing.

uncanny luck i think is the only other thing [for han]

Edited by Matt3412
17 hours ago, OccasionallyCorrect said:

Phht! At least once after every game to see if my stupid decision was the right move! Someone did a huge breakdown on the discord today with pathfinders vs everything.

That was me. Suuuuper useful.

On 2/19/2019 at 6:05 AM, DwightE1 said:

Any chance of an update for danger sense? Love the tool (so does discord!)

I think all the new things are working. Didn't get much of a chance to test so if you notice something wrong let me know. Links above should still work.

Id love to see this as an android app. Great app thanks for what youve done.

never-tell-me-the-odds.jpg

Above links updated with a few changes.

  • Max damage now at 25 to account for Fire Support
  • Surge tokens included
  • Critical keyword included
  • Shield tokens included
  • Changed layout slightly

If I have missed any new keywords or you find a bug let me know!

Edited by Qark
On 2/20/2019 at 11:41 PM, The captn said:

Id love to see this as an android app. Great app thanks for what youve done.

Me too :)

Great work though, I'd not seen this before so will try it out on my computer.

Updated for RAM because @sigidi 's calculator had more features than mine and we couldn't let that happen. Check their calculator out in the other thread (https://community.fantasyflightgames.com/topic/303327-dice-simulator/). It runs in browser so it might work on a phone!

A reset button would be nice for yours :P

doesn't this sap all the excitement from the game if you know what is going to happen most if not all the time?

7 hours ago, XR8rGREAT said:

doesn't this sap all the excitement from the game if you know what is going to happen most if not all the time?

No, because dice will be random. Red dice will fail. However this does give you good stats to base a strategy or a tactic on. I started mine because i wanted to know if mathematically 1 red and 3 white attack dice is better or worse than 2 red. Now I know in practice the white dice will fail me every time. At least that's what i think. But as it turns out they are actually better. So now I can base my choice on math instead of gut feeling. However in practice they will indeed fail me every time

Edited by sigidi