3
\$\begingroup\$

I am building a dice pool system using three polyhedral dice. Possible dice types are d4, d6, d8, d10 and d12. You roll three dice - which may be any dice combination of the types mentioned above - and use the highest two to determine success against a base DC (12). Achieving a higher DC (18/24/30) represents higher grades of success (i.e. „raises“).

The dice explode, on their respective highest number (4 on a d4, 6 on a d6, etc.) they are rerolled. There is no limit for dice explosions.

The reroll is additive. This way a single exploding die can surpass it's numerical value. An exploding d6, rerolled for a 4 would be a result of 10 [6+4] for that single die.

I am looking for the probability for such a roll hitting the DC's (12/18/24/30).


I have used anydice in the past to look into this, but sadly this only works for pools of the same dice.

function: highest N:n of A:s B:s C:s D:s E:s{
    result: {1..N}@[sort {A, B, C}]
}
output [highest 2 of 3d[explode d4]]
output [highest 2 of 3d[explode d6]]
output [highest 2 of 3d[explode d8]]
output [highest 2 of 3d[explode d10]]
output [highest 2 of 3d[explode d12]]

It does, however not work for mixed pools of exploding dice. Making this work would in essence answer the question, since not only specefied DCs, but probabilities for every result would be modeled.

Help would be greatly appreciated, thank you in advance!

\$\endgroup\$
0

1 Answer 1

4
\$\begingroup\$

Calling your function correctly

There are a few issues with your provided code.

  • You're actually calling the built-in [highest NUMBER of DICE] function, not the function you defined. If you wanted to call your function, you would need to put placeholders for the missing arguments, something like
output [highest 2 of 2d[explode d4] 1d[explode d6] 0 0 0]
  • D and E are missing from the function body. Though if you use all five die types with the default explosion limit, AnyDice times out. But then again, you stated you are (only?) interested in pools of three dice, so three parameters may be enough.
  • The d operator can be a bit finicky with function parameters that aren't separated by function name tokens. For example, if you wanted to call your function with a non-exploding d12 and d10, you couldn't use d12 d10 because it would parse them as a single argument of d12d10. You would have to phrase it as 1d12 1d10. If you always use exploding dice this is ok since no argument has a leading d.

Icepool

If, similar to your previous question, you do indeed want to roll up to five dice, my Icepool Python probability package has a more efficient algorithm in this case as well.

from icepool import d, highest

output(highest(d(4).explode(),
               d(6).explode(),
               d(8).explode(),
               d(10).explode(),
               d(12).explode(),
               keep=2))

You can try this in your browser here.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you very, very much for your answer and explanation! \$\endgroup\$
    – Em Harung
    Commented Nov 18 at 19:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .