Dice Probability Generator

By Litheon, in Star Wars: Edge of the Empire RPG

A series of ruby scripts for dice shenanigans. The first one is a dice probability calculator, which allows you to find the probability of getting any symbol, including the probability of reaching a specific target number of symbols. Ever wondered what the probability of success on your most rolled dice set was? Or how easy it was to get multiple advantages? You can use this tool to find out! .. Barring any bugs that you may find, since I was using it to learn Ruby. Please let me know if you find any!

The second one is just another Die Roller Script. Boring, no? Well, yeah, but since I made the probability generator, it seems almost callous to NOT make a roller. :P

You can find both of these, and how to use them, at:

https://github.com/Neolitheon/EotE-Dice-Probability

Change Log:

- Changed the script so you can see the probability of reaching a certain target success and advantage.

- Despair and Triumph probabilities are added, but not to the specific probability view. Too sparse.

- Added Failure and Threat to target functionality.

- Added a Dice Roller Script to the GitHub.

- Changed Algorithm: Now runs much faster.

- Target functionality now includes Triumph and Despair. You can now check dice pools against Triumph targets! Rejoice for your crits!
- Group Target Functionality added: create a set of Success/Advantage/Triumph targets, and it will output the probability of it hitting at least one of those. Now you can figure out your crit probability based off both triumphs and advantages!


(Original Text of original post.)
Hey! Did you ever wonder what the probability of a specific dice pool was? ... Okay, maybe that's an odd thing to wonder. Regardless, I made a Ruby Script for doing so, giving the probabilities for each specific set of Success, Advantage, Failure and Threat.

https://github.com/Neolitheon/EotE-Dice-Probability
Also made a spreadsheet of all the Ability/Proficiency Dice pools success and advantage rates, up to 6 dice, which... is kind of useful? What's the point of knowing the percentages if they aren't connected to any other, more negative dice?

https://docs.google.com/spreadsheets/d/1Ccgqox0BPFrFX7_uBzv0_dinzfJJbvsVlnJ3in_MzNw/edit?usp=sharing

If neither of those interest you, here are a couple probabilities for a few average dice pools.

PAADD: 65.08% Success Rate

PPADDS: 61.83% Success Rate
PPACD: 65.82% Success Rate
PPADD: 70.04% Success Rate

PPPDD: 74.55% Success Rate

PPADDB: 75.86% Success Rate

Edited: Changed these %'s since my logic was wrong in the script. Thanks Knowles and Zach!

Edited by Litheon

Can we get this topic pinned?

PPPDD: 72.94% Success Rate

PPADDB: 87.14% Success Rate

You sure those are correct?

That seems like a massive increase for downgrading proficiency to ability and adding a boost.

Is an Ability and a Boost die that much better than a single proficiency?

Yeah, there's something wrong here:

$ ruby dicecalculator_commandline.rb AAAPPSS
Max Success: 10, Max Advantage: 10
Max Failure: 2, Max Threat: 2

++++RESULTS++++
------------
0 Success & 0 Advantage: 0.05%
0 Success & 1 Advantage: 0.21%
0 Success & 2 Advantage: 0.56%
0 Success & 3 Advantage: 1.04%
0 Success & 4 Advantage: 1.36%
0 Success & 5 Advantage: 1.27%
0 Success & 6 Advantage: 0.83%
0 Success & 7 Advantage: 0.36%
0 Success & 8 Advantage: 0.09%
0 Success & 9 Advantage: 0.01%
0 Success & 10 Advantage: 0.0%
0 Success & 1 Threat: 0.01%
0 Success & 2 Threat: 0.0%
------------
1 Success & 0 Advantage: 0.25%
1 Success & 1 Advantage: 0.9%
1 Success & 2 Advantage: 2.03%
1 Success & 3 Advantage: 3.12%
1 Success & 4 Advantage: 3.31%
1 Success & 5 Advantage: 2.42%
1 Success & 6 Advantage: 1.17%
1 Success & 7 Advantage: 0.35%
1 Success & 8 Advantage: 0.06%
1 Success & 9 Advantage: 0.0%
1 Success & 1 Threat: 0.04%
1 Success & 2 Threat: 0.0%
------------
2 Success & 0 Advantage: 0.79%
2 Success & 1 Advantage: 2.35%
2 Success & 2 Advantage: 4.41%
2 Success & 3 Advantage: 5.47%
2 Success & 4 Advantage: 4.54%
2 Success & 5 Advantage: 2.47%
2 Success & 6 Advantage: 0.83%
2 Success & 7 Advantage: 0.15%
2 Success & 8 Advantage: 0.01%
2 Success & 1 Threat: 0.14%
2 Success & 2 Threat: 0.01%
------------
3 Success & 0 Advantage: 1.6%
3 Success & 1 Advantage: 3.94%
3 Success & 2 Advantage: 5.97%
3 Success & 3 Advantage: 5.81%
3 Success & 4 Advantage: 3.62%
3 Success & 5 Advantage: 1.37%
3 Success & 6 Advantage: 0.29%
3 Success & 7 Advantage: 0.02%
3 Success & 1 Threat: 0.35%
3 Success & 2 Threat: 0.03%
------------
4 Success & 0 Advantage: 2.16%
4 Success & 1 Advantage: 4.32%
4 Success & 2 Advantage: 5.15%
4 Success & 3 Advantage: 3.77%
4 Success & 4 Advantage: 1.64%
4 Success & 5 Advantage: 0.39%
4 Success & 6 Advantage: 0.04%
4 Success & 1 Threat: 0.58%
4 Success & 2 Threat: 0.06%
------------
5 Success & 0 Advantage: 1.98%
5 Success & 1 Advantage: 3.11%
5 Success & 2 Advantage: 2.8%
5 Success & 3 Advantage: 1.44%
5 Success & 4 Advantage: 0.39%
5 Success & 5 Advantage: 0.04%
5 Success & 1 Threat: 0.65%
5 Success & 2 Threat: 0.08%
------------
6 Success & 0 Advantage: 1.21%
6 Success & 1 Advantage: 1.44%
6 Success & 2 Advantage: 0.92%
6 Success & 3 Advantage: 0.3%
6 Success & 4 Advantage: 0.04%
6 Success & 1 Threat: 0.5%
6 Success & 2 Threat: 0.08%
------------
7 Success & 0 Advantage: 0.48%
7 Success & 1 Advantage: 0.4%
7 Success & 2 Advantage: 0.16%
7 Success & 3 Advantage: 0.02%
7 Success & 1 Threat: 0.26%
7 Success & 2 Threat: 0.05%
------------
8 Success & 0 Advantage: 0.11%
8 Success & 1 Advantage: 0.06%
8 Success & 2 Advantage: 0.01%
8 Success & 1 Threat: 0.08%
8 Success & 2 Threat: 0.02%
------------
9 Success & 0 Advantage: 0.01%
9 Success & 1 Advantage: 0.0%
9 Success & 1 Threat: 0.02%
9 Success & 2 Threat: 0.01%
------------
10 Success & 0 Advantage: 0.0%
10 Success & 1 Threat: 0.0%
10 Success & 2 Threat: 0.0%
------------
1 Failure & 0 Advantage: 0.0%
1 Failure & 1 Advantage: 0.03%
1 Failure & 2 Advantage: 0.08%
1 Failure & 3 Advantage: 0.18%
1 Failure & 4 Advantage: 0.29%
1 Failure & 5 Advantage: 0.33%
1 Failure & 6 Advantage: 0.28%
1 Failure & 7 Advantage: 0.16%
1 Failure & 8 Advantage: 0.06%
1 Failure & 9 Advantage: 0.01%
1 Failure & 10 Advantage: 0.0%
1 Failure & 1 Threat: 0.0%
------------
2 Failure & 0 Advantage: 0.0%
2 Failure & 1 Advantage: 0.0%
2 Failure & 2 Advantage: 0.0%
2 Failure & 3 Advantage: 0.01%
2 Failure & 4 Advantage: 0.02%
2 Failure & 5 Advantage: 0.03%
2 Failure & 6 Advantage: 0.03%
2 Failure & 7 Advantage: 0.03%
2 Failure & 8 Advantage: 0.01%
2 Failure & 9 Advantage: 0.0%
2 Failure & 10 Advantage: 0.0%
------------
Total Chance of Success: 109.66606987847223
Total Chance of Advantage: 88.38011188271606
Total Chance of Threat: 2.980324074074074
+++++++++++++++

109% chance of success? I don't think so.... Let me see if I can figure out where the error(s) is/are and I'll send you a PR.

Edit: Disregard the percentages in this post entirely. They're from when the script was wrong! Sorry about that! 8D (Turns out adding 1 to something isn't the same as adding a % to it.)

I found that odd as well. I don't THINK it's a problem with my script, but if you find any bugs, let me know. I kind of made the script so I wouldn't have to calculate the probabilities out entirely myself. That's 12^5 & 6*12^5 results to calculate through.

At lower levels, though, you only have to contend with 12^2 (144! wooooo~)

AD = 16.5%

PD = 23.8%

ADB = 39.6%

I still don't want to calculate this by hand, but I've noticed that adding a die to the pool is always better than upgrading. In the case of pools with no difficulty dice, adding AB gives the same success boost as adding P does, but AB has the upper hand in advantage.

I must admit, it seems a bit odd that throwing a PD only gives you 24% chance of success. If someone wants to calculate this by hand, here's a list of all the 144 combinations.

""

"S"

"S"

"SS"

"SS"

"A"

"SA"

"SA"

"SA"

"AA"

"AA"

"SR"

"F"

"FS"

"FS"

"FSS"

"FSS"

"FA"

"FSA"

"FSA"

"FSA"

"FAA"

"FAA"

"FSR"

"FF"

"FFS"

"FFS"

"FFSS"

"FFSS"

"FFA"

"FFSA"

"FFSA"

"FFSA"

"FFAA"

"FFAA"

"FFSR"

"T"

"TS"

"TS"

"TSS"

"TSS"

"TA"

"TSA"

"TSA"

"TSA"

"TAA"

"TAA"

"TSR"

"T"

"TS"

"TS"

"TSS"

"TSS"

"TA"

"TSA"

"TSA"

"TSA"

"TAA"

"TAA"

"TSR"

"T"

"TS"

"TS"

"TSS"

"TSS"

"TA"

"TSA"

"TSA"

"TSA"

"TAA"

"TAA"

"TSR"

"TT"

"TTS"

"TTS"

"TTSS"

"TTSS"

"TTA"

"TTSA"

"TTSA"

"TTSA"

"TTAA"

"TTAA"

"TTSR"

"FT"

"FTS"

"FTS"

"FTSS"

"FTSS"

"FTA"

"FTSA"

"FTSA"

"FTSA"

"FTAA"

"FTAA"

"FTSR"

What follows are the specific percentages for EACH success/failure & threat/advantage pair for both PPPDD and PPADDB. Be warned.

++++RESULTS for Dice Pool: PPPDD++++

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

0 Success & 0 Advantage: 2.67%

0 Success & 1 Advantage: 4.11%

0 Success & 2 Advantage: 4.02%

0 Success & 3 Advantage: 2.37%

0 Success & 4 Advantage: 0.76%

0 Success & 5 Advantage: 0.12%

0 Success & 6 Advantage: 0.01%

0 Success & 1 Threat: 1.08%

0 Success & 2 Threat: 0.24%

0 Success & 3 Threat: 0.02%

0 Success & 4 Threat: 0.0%

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

1 Success & 0 Advantage: 5.66%

1 Success & 1 Advantage: 6.69%

1 Success & 2 Advantage: 4.79%

1 Success & 3 Advantage: 1.94%

1 Success & 4 Advantage: 0.4%

1 Success & 5 Advantage: 0.03%

1 Success & 1 Threat: 2.93%

1 Success & 2 Threat: 0.87%

1 Success & 3 Threat: 0.13%

1 Success & 4 Threat: 0.01%

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

2 Success & 0 Advantage: 7.27%

2 Success & 1 Advantage: 6.3%

2 Success & 2 Advantage: 3.06%

2 Success & 3 Advantage: 0.75%

2 Success & 4 Advantage: 0.07%

2 Success & 1 Threat: 4.92%

2 Success & 2 Threat: 1.89%

2 Success & 3 Threat: 0.38%

2 Success & 4 Threat: 0.03%

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

3 Success & 0 Advantage: 5.23%

3 Success & 1 Advantage: 3.03%

3 Success & 2 Advantage: 0.85%

3 Success & 3 Advantage: 0.09%

3 Success & 1 Threat: 4.84%

3 Success & 2 Threat: 2.42%

3 Success & 3 Threat: 0.6%

3 Success & 4 Threat: 0.06%

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

4 Success & 0 Advantage: 1.83%

4 Success & 1 Advantage: 0.6%

4 Success & 2 Advantage: 0.07%

4 Success & 1 Threat: 2.55%

4 Success & 2 Threat: 1.73%

4 Success & 3 Threat: 0.53%

4 Success & 4 Threat: 0.06%

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

5 Success & 0 Advantage: 0.24%

5 Success & 1 Advantage: 0.03%

5 Success & 1 Threat: 0.61%

5 Success & 2 Threat: 0.61%

5 Success & 3 Threat: 0.24%

5 Success & 4 Threat: 0.03%

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

6 Success & 0 Advantage: 0.01%

6 Success & 1 Threat: 0.04%

6 Success & 2 Threat: 0.08%

6 Success & 3 Threat: 0.04%

6 Success & 4 Threat: 0.01%

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

1 Failure & 0 Advantage: 0.79%

1 Failure & 1 Advantage: 1.55%

1 Failure & 2 Advantage: 1.97%

1 Failure & 3 Advantage: 1.61%

1 Failure & 4 Advantage: 0.77%

1 Failure & 5 Advantage: 0.18%

1 Failure & 6 Advantage: 0.01%

1 Failure & 1 Threat: 0.24%

1 Failure & 2 Threat: 0.04%

1 Failure & 3 Threat: 0.0%

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

2 Failure & 0 Advantage: 0.14%

2 Failure & 1 Advantage: 0.36%

2 Failure & 2 Advantage: 0.58%

2 Failure & 3 Advantage: 0.62%

2 Failure & 4 Advantage: 0.42%

2 Failure & 5 Advantage: 0.16%

2 Failure & 6 Advantage: 0.02%

2 Failure & 1 Threat: 0.03%

2 Failure & 2 Threat: 0.0%

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

3 Failure & 0 Advantage: 0.02%

3 Failure & 1 Advantage: 0.05%

3 Failure & 2 Advantage: 0.1%

3 Failure & 3 Advantage: 0.13%

3 Failure & 4 Advantage: 0.12%

3 Failure & 5 Advantage: 0.07%

3 Failure & 6 Advantage: 0.01%

3 Failure & 1 Threat: 0.0%

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

4 Failure & 0 Advantage: 0.0%

4 Failure & 1 Advantage: 0.0%

4 Failure & 2 Advantage: 0.01%

4 Failure & 3 Advantage: 0.01%

4 Failure & 4 Advantage: 0.02%

4 Failure & 5 Advantage: 0.01%

4 Failure & 6 Advantage: 0.01%

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

Total Chance of Success: 72.93663194444443

Total Chance of Advantage: 48.87152777777778

Total Chance of Threat: 27.271412037037038

+++++++++++++++

++++RESULTS for Dice Pool: PPADDB++++

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

0 Success & 0 Advantage: 1.71%

0 Success & 1 Advantage: 3.01%

0 Success & 2 Advantage: 3.59%

0 Success & 3 Advantage: 2.97%

0 Success & 4 Advantage: 1.7%

0 Success & 5 Advantage: 0.65%

0 Success & 6 Advantage: 0.15%

0 Success & 7 Advantage: 0.02%

0 Success & 8 Advantage: 0.0%

0 Success & 1 Threat: 0.62%

0 Success & 2 Threat: 0.13%

0 Success & 3 Threat: 0.01%

0 Success & 4 Threat: 0.0%

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

1 Success & 0 Advantage: 3.77%

1 Success & 1 Advantage: 5.4%

1 Success & 2 Advantage: 5.25%

1 Success & 3 Advantage: 3.5%

1 Success & 4 Advantage: 1.57%

1 Success & 5 Advantage: 0.44%

1 Success & 6 Advantage: 0.07%

1 Success & 7 Advantage: 0.0%

1 Success & 1 Threat: 1.71%

1 Success & 2 Threat: 0.46%

1 Success & 3 Threat: 0.07%

1 Success & 4 Threat: 0.0%

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

2 Success & 0 Advantage: 5.29%

2 Success & 1 Advantage: 6.15%

2 Success & 2 Advantage: 4.79%

2 Success & 3 Advantage: 2.49%

2 Success & 4 Advantage: 0.81%

2 Success & 5 Advantage: 0.15%

2 Success & 6 Advantage: 0.01%

2 Success & 1 Threat: 2.97%

2 Success & 2 Threat: 1.01%

2 Success & 3 Threat: 0.18%

2 Success & 4 Threat: 0.01%

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

3 Success & 0 Advantage: 4.64%

3 Success & 1 Advantage: 4.32%

3 Success & 2 Advantage: 2.61%

3 Success & 3 Advantage: 0.97%

3 Success & 4 Advantage: 0.2%

3 Success & 5 Advantage: 0.02%

3 Success & 1 Threat: 3.2%

3 Success & 2 Threat: 1.33%

3 Success & 3 Threat: 0.29%

3 Success & 4 Threat: 0.03%

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

4 Success & 0 Advantage: 2.48%

4 Success & 1 Advantage: 1.79%

4 Success & 2 Advantage: 0.77%

4 Success & 3 Advantage: 0.18%

4 Success & 4 Advantage: 0.02%

4 Success & 1 Threat: 2.13%

4 Success & 2 Threat: 1.08%

4 Success & 3 Threat: 0.28%

4 Success & 4 Threat: 0.03%

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

5 Success & 0 Advantage: 0.77%

5 Success & 1 Advantage: 0.4%

5 Success & 2 Advantage: 0.11%

5 Success & 3 Advantage: 0.01%

5 Success & 1 Threat: 0.84%

5 Success & 2 Threat: 0.52%

5 Success & 3 Threat: 0.16%

5 Success & 4 Threat: 0.02%

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

6 Success & 0 Advantage: 0.12%

6 Success & 1 Advantage: 0.04%

6 Success & 2 Advantage: 0.0%

6 Success & 1 Threat: 0.18%

6 Success & 2 Threat: 0.14%

6 Success & 3 Threat: 0.05%

6 Success & 4 Threat: 0.01%

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

7 Success & 0 Advantage: 0.01%

7 Success & 1 Advantage: 0.0%

7 Success & 1 Threat: 0.02%

7 Success & 2 Threat: 0.02%

7 Success & 3 Threat: 0.01%

7 Success & 4 Threat: 0.0%

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

1 Failure & 0 Advantage: 0.49%

1 Failure & 1 Advantage: 1.08%

1 Failure & 2 Advantage: 1.58%

1 Failure & 3 Advantage: 1.6%

1 Failure & 4 Advantage: 1.14%

1 Failure & 5 Advantage: 0.55%

1 Failure & 6 Advantage: 0.17%

1 Failure & 7 Advantage: 0.03%

1 Failure & 8 Advantage: 0.0%

1 Failure & 1 Threat: 0.14%

1 Failure & 2 Threat: 0.02%

1 Failure & 3 Threat: 0.0%

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

2 Failure & 0 Advantage: 0.09%

2 Failure & 1 Advantage: 0.24%

2 Failure & 2 Advantage: 0.44%

2 Failure & 3 Advantage: 0.54%

2 Failure & 4 Advantage: 0.47%

2 Failure & 5 Advantage: 0.29%

2 Failure & 6 Advantage: 0.12%

2 Failure & 7 Advantage: 0.03%

2 Failure & 8 Advantage: 0.0%

2 Failure & 1 Threat: 0.02%

2 Failure & 2 Threat: 0.0%

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

3 Failure & 0 Advantage: 0.01%

3 Failure & 1 Advantage: 0.03%

3 Failure & 2 Advantage: 0.07%

3 Failure & 3 Advantage: 0.11%

3 Failure & 4 Advantage: 0.11%

3 Failure & 5 Advantage: 0.08%

3 Failure & 6 Advantage: 0.04%

3 Failure & 7 Advantage: 0.01%

3 Failure & 8 Advantage: 0.0%

3 Failure & 1 Threat: 0.0%

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

4 Failure & 0 Advantage: 0.0%

4 Failure & 1 Advantage: 0.0%

4 Failure & 2 Advantage: 0.01%

4 Failure & 3 Advantage: 0.01%

4 Failure & 4 Advantage: 0.01%

4 Failure & 5 Advantage: 0.01%

4 Failure & 6 Advantage: 0.01%

4 Failure & 7 Advantage: 0.0%

4 Failure & 8 Advantage: 0.0%

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

Total Chance of Success: 87.1392234519676

Total Chance of Advantage: 62.95572916666668

Total Chance of Threat: 17.66402633101852

+++++++++++++++

Edited by Litheon

First off, t®iumph doesn't count as two Successes, it counts as one Success and one Triumph. Same with Despair. So, that will throw the odds off a bit.

Yeah, there's something wrong here:

109% chance of success? I don't think so.... Let me see if I can figure out where the error(s) is/are and I'll send you a PR.

Yeah, somethings wonky... I can only get that with set back. thanks for letting me know. it's probably my fence posting of the grid when I'm reading the results. I was trying to be cheeky and use negative indices for setback and failure, but I think I'll use 3 different arrays instead.

First off, t®iumph doesn't count as two Successes, it counts as one Success and one Triumph. Same with Despair. So, that will throw the odds off a bit.

It isn't counted as two.. I never even use the ® portion in my code. XP It's just there for when I want to add in the functionality.

Edited by Litheon

Triumphs should probably be treated as a seperate probability and only count as a single success for the purpose of the calcualtions.

The probability of a Triump is fairly easy, its just 1 times the # of proficiency dice divided by 12 times the number of proficiency dice.

What I would like to see here is the ability to select a target value (say, at least one net success and two net advantages), and see how often you meet or exceed that value.

That would give you a way to see how often your auto-fire might activate, or how often you get a critical hit with a particular attack.

Hmm. I also notice that we're being told the total probability of success, advantage, and threat, but if you've got any D or C dice in there, then there's always the chance of failure, too.

Chance of Failure = 100% - Success %
I thought it too easy to calculate, since unlike Advantage and Threat, you can fail if there is a "Null Roll" (no success or failure have been rolled). It is simple enough to add in, however, if you'd like it.

I can also add in the functionality for the target value. should be simple enough. just have to make a "-T:SSAA" sort of argument.

The script has changed a bit, also.
You can use -S to simplify the results and only see the Success, Advantage and Threat. Without that, you'll get every single % for every combination of the three.
You can use -C to look at all the combinations of dice you rolled, but be warned... it's a lot of data.

.. Right, maybe I should make a readme. :P

Failure does not equal No success. Failure is negative, and is indicated by the Failure symbols. There are empty die faces which are not Failure, Success, Threat, Advantage, Despair, or Triumph. If you have all empty die faces, that simply means you didn't succeed. But the number of net Failure symbols you have could make a difference as to what the outcome is.

So, we do actually need to know the probability of Failure separate from the probability of Success, and both are separate from the probabilty of "No Failure, but no Success".

And the README.md was going to be one of my first PRs. So, you're a step ahead of me there.

:D

Oh, and have you run the code through Rubocop? Would you be interested in a PR that doesn't make any fuctional changes, just makes the code more compliant with the community Ruby standards?

The other thought that occurs to me is that we might want to calculate D, C, and S separately from A, P, and B. That way, we could play around with dice probabilities for failures and look at what happens if we don't change any of the positive dice, but we do change D to C versus adding S to D.

It would be nice to be able to do both halves of that calculation separately.

Oh, and you now have my first PR, which incorporates some changes recommended by Rubocop for Ruby code style.

Failure does not equal No success. Failure is negative, and is indicated by the Failure symbols. There are empty die faces which are not Failure, Success, Threat, Advantage, Despair, or Triumph. If you have all empty die faces, that simply means you didn't succeed. But the number of net Failure symbols you have could make a difference as to what the outcome is.

So, we do actually need to know the probability of Failure separate from the probability of Success, and both are separate from the probabilty of "No Failure, but no Success".

Oh, see, I read that the amount of failure doesn't impact the roll, just that you failed (Core: pg 13).

The other thought that occurs to me is that we might want to calculate D, C, and S separately from A, P, and B. That way, we could play around with dice probabilities for failures and look at what happens if we don't change any of the positive dice, but we do change D to C versus adding S to D.

It would be nice to be able to do both halves of that calculation separately.

Oh, and you now have my first PR, which incorporates some changes recommended by Rubocop for Ruby code style.

Sorry bout all that pull request stuff.. I was kind of working on the target functionality while you were doing that. I haven't actually heard of Rubocop.. mainly because I just started coding Ruby about... 3 days ago?

Speaking of which, Target Functionality has been added to the script. Now you can see the percentage chance of a specific amount of Success/Advantage. I have not added Failure or Threat, but if there is want for calculating the probability of how badly you failed, I can add that in too.

I am unsure what you mean by calculating them separately, Brad. So far functionality is only for calculating only one pool. Did you mean we have an input for both bad & good dice, and then make it so you can have multiple pools in one run of the script so you can compare them easier?

Oh, see, I read that the amount of failure doesn't impact the roll, just that you failed (Core: pg 13).

So, as you have calculated, %Threat + %Advantage != 100%

Likewise, %Fail + %Success != 100%

Sometimes, you don't fail, but you don't succeed, either. Sometimes, a lack of success is a failure. But we do need to be able to distinguish between those two outcomes.

Sorry bout all that pull request stuff.. I was kind of working on the target functionality while you were doing that. I haven't actually heard of Rubocop.. mainly because I just started coding Ruby about... 3 days ago?

No problem. I'm not a real Ruby Developer myself, but I do get paid to sometimes pretend that I am. And I am smart enough to know some people who are good Ruby Developers, and so I latch on pretty quickly to any tools they tell me are good.

As it turns out, Rubocop is a Ruby style checker that is written by the guy who is the official maintainer of the Ruby style guide, so it is pretty authoritative. And pretty useful.

Once you get used to reading code written in the Ruby Way, seeing ruby code written in any other style is ... painful.

Speaking of which, Target Functionality has been added to the script. Now you can see the percentage chance of a specific amount of Success/Advantage.

Awesome!

I have not added Failure or Threat, but if there is want for calculating the probability of how badly you failed, I can add that in too.

Speaking only for myself, I would like to see that.

I am unsure what you mean by calculating them separately, Brad. So far functionality is only for calculating only one pool. Did you mean we have an input for both bad & good dice, and then make it so you can have multiple pools in one run of the script so you can compare them easier?

I'm not sure what is the best way to clarify what I meant.

I guess what I want to make sure of is that I can see all the same statistical information for the "negative" dice as we can see for the "positive" dice. This would allow GMs to make a more informed decision about whether or not they want to force someone to upgrade the difficulty on some check instead of adding setback dice, or vice-versa.

You've made it this far, you might as well thrown in a cli dice roller. Oh the humanity!

Right, so, the code is now up to scratch with RuboCop Style Guides (except for some long lines and some "next" issues, but I'm not too concerned about that).

I also added the probability of a failure symbol showing up. Sorry, Brad, but I can't in right conscience call a failure symbol showing up a "Failure" of a die roll, since a failure of a die roll includes the No Success/No Failure clause. xP

"Failure Target" has not been added yet, but will be done so.. as soon as I figure out how to do it with my system. XP

and Mensch, that's pretty easy. all I'd need to do is "Random number between 1-#Possibilities", then print whatever that one is. No worries! Maybe I should make that script too...

and Mensch, that's pretty easy. all I'd need to do is "Random number between 1-#Possibilities", then print whatever that one is. No worries! Maybe I should make that script too...

I was going to do it in bash, but it was easier to reach for the bowl of dice whenever I needed them, haha.

Well, there's now a dice roller, as well as a way to look at failure targets. You can make targets any number of successes, advantages, failures and threats. Note that there is no way to find the probability of 2 successes and 2 failures "Target: FFSS", or similar because successes and failures cancel out before the numbers are calculated. :P
.. Man, if I have to do that with despair and triumph, that's really going to mess with my structure. I'll have to think up another way to store all the data before I can create a target with despair and triumph.

For the new diceroller.rb, so long as you stick to positive dice, it seems to do fine. When you start adding some negative dice, it goes seriously off the rails. Like, sucking up 16GB of virtual memory and over 3.5GB of active memory, and almost unkillable -- I had to do a "kill -9" on the pid several times, before I could get it to recognize the signal.

Also posted on github at < https://github.com/Neolitheon/EotE-Dice-Probability/issues/3 > :P

[Edit -- update with github link ]

Edited by bradknowles

I think that's more dice bloat than negative dice. it is making an array of size approx 12^x, where x is the number of dice, after all. but you're right. using the same "calculate all different combinations, then pick one" that the calculator uses is a waste of space. I shall change the implementation soon.

(you'll notice if you calculate anything over 8 or so dice it chugs immensely. 12^8 = 429,981,696, after all. so 500 million strings in an array... not good. :P )

I think that's more dice bloat than negative dice. it is making an array of size approx 12^x, where x is the number of dice, after all. but you're right. using the same "calculate all different combinations, then pick one" that the calculator uses is a waste of space. I shall change the implementation soon.

(you'll notice if you calculate anything over 8 or so dice it chugs immensely. 12^8 = 429,981,696, after all. so 500 million strings in an array... not good. :P )

Yes, it is needing a huge amount of memory because of all the possible combinations that come with these dice. Since they aren't simply numeric and results of one counteract another to get the final result it can churn. I tried something similar using my own dice roller app (see signature) and found that outside of 3 or 4 total dice, the combinatorix were just huge. I wasn't using a matrix, instead was iterating through the possibilities.