11
\$\begingroup\$

Rolling an individual (N)PC stat of 4d6, rerolling 1s and 2s, and dropping the lowest gives a modal average of 15 with a range of 9-18. The AnyDice code to produce the graph for that is simple enough (and there are multiple ways to code this):

output [highest 3 of 4d{3..6}]

What I'd like to do is roll 7 sets of these and drop the lowest sum (thus obtaining a standard 6 D&D stat scores, but specifically the highest 6 sums out of 7).

How might I tell AnyDice to show me how this affects the scores in contrast to a standard 6 rolls of 3d6?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Haha, sorry about that! It seems RPG.SE thinks you're a new contributor since you haven't asked or answered any questions here, though you've had an account for 3.5 years... :) \$\endgroup\$
    – V2Blast
    Dec 20, 2019 at 9:07
  • \$\begingroup\$ No problem -- it makes sense. Interesting edits. \$\endgroup\$ Dec 20, 2019 at 9:08

1 Answer 1

19
+400
\$\begingroup\$

Here's a simple program which tells us what the distribution of each individual stat (from highest to lowest) in your array is:

ARRAY: 7d[highest 3 of 4d{3..6}]
output 1@ARRAY
output 2@ARRAY
output 3@ARRAY
output 4@ARRAY
output 5@ARRAY
output 6@ARRAY

In order to generate a sequence of 7 rolled ability scores, we can simply use the function which generates one ability score and roll it as a die 7 times - hence 7d[highest 3 of 4d{3..6}]. Then, we can inspect the first six elements of that sequence to get the six ability scores you will keep, since sequences are by default sorted in descending order. The 7th score (7@ARRAY) is the lowest score and so we ignore (discard) it.

Here's a program which compares results from simply rolling 6 times 3d6 to your method of determining stats. As given it only shows the comparison of the highest score from each distribution, but I trust altering it to compare the other results is obvious enough (I have left them out to avoid clutter):

ORIGINAL: 6d(3d6)
NEW: 7d[highest 3 of 4d{3..6}]

loop N over {1} {
  output N@ORIGINAL named "[N]@3d6"
  output N@NEW named "[N]@7d(4d6r1,2)"
}

a graph comparing ability score distributions

That gives us a graph outlining the expected distribution for each ability score, but the distributions are separate. If you want to aggregate those into a single distribution giving you the expected distribution of any one randomly selected score from your kept array, we need to get a bit funky with a function, as in this program:

function: select INDEX:n DISTRIBUTION:d {
  result: INDEX@DISTRIBUTION
}

ARRAY: 7d[highest 3 of 4d{3..6}]

output [select 1d6 ARRAY]

In this case we use a function in order to randomly select an index from the array. We have to do it this way because anydice expects an index to a sequence to be a number or another sequence (where it would sum the selected elements), so it balks if we try to directly index the sequence with a die by doing something like (1d6)@ARRAY. However, if we use a function which casts a die roll input to a number (INDEX:n), we can work around this limitation. The output in this case gives us the probability distribution of results we'd see if we randomly selected one of the first six ability scores in the sequence we generated.

Using this program, here's a graph which compares that to other methods of generating ability scores:

a graph of ability score distributions

So we can see, for instance, that adding the extra step of rolling an array of seven scores and dropping the lowest bumps your average result up from 14.62 to 15.06.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Wow! That final program is what I sought (and the middle two help illustrate the differences' causes well), but those intermediate steps walk me through exactly what I'd need to know and understand in order to reach it (and I must admit: I didn't know). This will likely end up as the accepted answer, but to be fair to any other contenders, I'll have to allow at least another day or two to pass before deciding. Thanks! :-) \$\endgroup\$ Dec 21, 2019 at 11:08
  • 2
    \$\begingroup\$ Honestly, all of your anydice answers are incredibly thorough and helpful, with great explanations and they've helped me understand the program much better. I will add a bounty here when I can \$\endgroup\$ Dec 21, 2019 at 13:41
  • 1
    \$\begingroup\$ @charlesRockafellor My bounty is gonna go straight to Carcer, just so you know \$\endgroup\$ Dec 24, 2019 at 2:27
  • \$\begingroup\$ @Medix2 I quite agree (I'm not sure that anyone else is liable to offer alternative answers, but it would certainly take some serious work to outdo this one). \$\endgroup\$ Dec 24, 2019 at 3:04
  • \$\begingroup\$ Answer accepted. I also ran a modified version of the final program to get a finer-tuned feel of the different variables' effects. Hopefully it's helpful to anyone reading these comments: anydice.com/program/19205 \$\endgroup\$ Dec 26, 2019 at 3:16

You must log in to answer this question.

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