PDA

View Full Version : Anydice.com and D6's Wild Die



The Troubadour
2013-08-24, 03:48 PM
Hey there, guys!
So, I'd like to use the Anydice site (http://anydice.com/) to calculate the averages for various d6 dice pools, but I don't know how to apply a concept similar to the D6 System's Wild Die. Can anyone help me?

For those who don't know it, here's how the Wild Die works:
- Out of your dice pool (always composed of d6s), one die is always considered a Wild Die - even if you only have that one die.
- When the Wild Die rolls a natural "6", you roll it again and add it up. If you keep rolling 6s, you keep on rolling it and adding everything.
- When the Wild Die rolls a natural "1", however, you remove both the Wild Die and the highest other die from the sum of the dice pool. For instance, if you roll 5d6 and you get 2, 3, 5, 3 and a 1 on the Wild Die, you'd remove both the "1" and the "5" and add only the 2 and the 3s (for a total of 8).

AttilaTheGeek
2013-08-24, 05:24 PM
You'd need some code. I've been working on it for a while, but I don't think it's possible because conditionals don't accept variable arguments unless those variables are constant. It throws a syntax error at
if WILDDIE = 6 (checking if the die is six),
if [email protected] = 6 (checking if the first die in a sequence containing only the wild die is six),
if [WILDDIE contains 6] (checking if a 6 was rolled anywhere in the set of dice called wild dice (which contains only one die)), and at
if [email protected] = 6 (checking if the first (and only) die in a set of dice called wild dice was a 6). So, I don't think it's possible. :smallsigh:

TuggyNE
2013-08-24, 07:03 PM
You'd need some code. I've been working on it for a while, but I don't think it's possible because conditionals don't accept variable arguments unless those variables are constant.

Generally, the approach I've taken is to lift the conditional wholesale into a function with a :n parameter. The tricky bit is getting the function to return the right information. And, of course, if you need to examine individual dice in a roll, that may not be possible at all.

Of course, AnyDice already has an explode function, so you could try using that for the Wild Die, and then work out some way to remove the highest die (or not roll it) when appropriate.

AttilaTheGeek
2013-08-24, 09:40 PM
Generally, the approach I've taken is to lift the conditional wholesale into a function with a :n parameter. The tricky bit is getting the function to return the right information. And, of course, if you need to examine individual dice in a roll, that may not be possible at all.

Of course, AnyDice already has an explode function, so you could try using that for the Wild Die, and then work out some way to remove the highest die (or not roll it) when appropriate.

I was trying not to bother with a function, since I was learning the language as I went and I wasn't sure what functionality a parameter would add. The approach I was working with (and forgive any syntax errors, I'm writing this from memory) was the following:


POOLSIZE: 3 /For example only
WILDDIE: 1d6
if WILDDIE = 6 {
output 6 + POOLSIZEd6 + explode 1d6
}
else {
if WILDDIE = 1
output 1 + [lowest POOLSIZE-1 of POOLSIZEd6]
}
else {
output WILDDIE + POOLSIZEd6
}
}

Or something along those lines. It threw errors at all the conditionals.

TuggyNE
2013-08-25, 01:04 AM
I was trying not to bother with a function, since I was learning the language as I went and I wasn't sure what functionality a parameter would add.

Yeah, the thing is that the :n bit reifies whatever you pass in; the function is evaluated for all cases and probabilities, and the sum of results for each such case is what you get out of it.

Put another way, it's basically the only way to evaluate a conditional with dice, since normally a die specification is actually a whole superposition of possibilities; it has no one value.