Como posso criar uma função AnyDice onde posso rolar 3d20 e depois diminuir os resultados dos rolos de matriz individuais?

6

In Neuroshima system you throw 3D20, ignore the highest result and use your skill to lower the results on 2 remaining dice, to get them equal or below your characteristic value, such as agility. Each point in skill can be used to lower any die roll by one; it is a pool of points that can be used to subtract from individual rolls. For example, skill on level 5 could be used to lower one die roll by 5, or one roll by 3 and the other by 2.

The test is passed when at least 2 out of 3 dice are equal or lower than the characteristic.

Exemplo:

{12, 11, 17} skill 3, characteristic 11 - ignore 17, lower the other two to 10 and 10, so it's a pass

{2, 18, 19} skill 5, characteristic 12 - ignore 19, lower 18 to 13, still a failure though, as one would need at most 12 on that die.

I tried to create a function of my own, with skill level fixed to 1 to make a baby step, but failed nonetheless.

function: neuro {

DICE:3D20

MID: [email protected] 

LOW: [email protected]

MID:MID-1

ROLL: [sort {LOW, MID}] 

result: [email protected] 

} 

Result of this is 20 100% and I don't know why. It's probably, because LOW e MID are "d" (dice) and sorting them is sort of wrong, I think?

Has anyone did anything similar? How can I use AnyDice to model this function?

por Irrehaare 19.04.2019 / 13:45

2 respostas

So you want to pick the two lowest dice, and see if there is any 'deficit' above a certain target number. The target number is one less than your attribute. Rolling less than the target number gives no benefit, but rolling higher produces a deficit equal to the difference. Finally you need to make sure the deficit is small enough that it can be compensated for with your skill. In code form, it looks like esta:

SKILL: 0
ATTRIBUTE: 11

function:  deficit DICE:s against TARGET:n
{
 DEF : 0
 if ([email protected]>TARGET)
 { 
  DEF : DEF + ([email protected])
 }
 if ([email protected]>TARGET)
 { 
  DEF : DEF + ([email protected])
 }
 result: DEF
}

output [deficit 3d20 against ATTRIBUTE-1]<=SKILL
19.04.2019 / 14:14

Here's a somewhat simpler solution, in two steps:

  1. First, make a custom d20 whose sides show the number of points needed to bring it under the target characteristic value:

    DIE: [highest of 0 and d20 - CHARACTERISTIC + 1]
    
  2. Then roll three of these dice, take the sum of the two lowest (i.e. the number of points needed to bring both of them under the target) and see if it's less than the number of skill points available:

    output [lowest 2 of 3dDIE] <= SKILL
    

Actually, we don't even need the <= SKILL part, if we just plot the cumulative probability of needing no máximo a given number of skill points to succeed. From this output, we can directly read that the success rate for characteristic 11 is 50% with skill 0, 57.13% with skill 1, 63.85% with skill 2, 70.11% with skill 3, etc.

If we wanted, we could even automatically run the same code for a range of characteristics and plot the results as a nice graph:

Plot of success rate vs. skill for various characteristics in Neuroshima, generated using AnyDice

This is what the entire code to generate the graph above looks like:

loop CHARACTERISTIC over {1..20} {
  DIE: [highest of 0 and d20 - CHARACTERISTIC + 1]
  output [lowest 2 of 3dDIE] named "characteristic [CHARACTERISTIC]"
}

Ps. One thing we can observe from the results is that one extra skill level is almost, but not quite as good as one extra point in the relevant characteristic. But dois skill levels is still maneira melhor than one point in the characteristic.

That might seem a bit surprising, given that raising the characteristic effectively reduces todos of your dice rolls by one, whereas an extra skill point only lets you reduce one of them. However, if one of your three dice is less than your current characteristic, then there's no need to lower it any further, and in that case one extra skill level is indeed just as good as one extra point in the characteristic. And it turns out that this is a pretty common case — for example, the probability of rolling naturally under 11 (i.e. at most 10) on at least one out of 3d20 is 87.5%.

Also, it's worth noting that the values of the lowest and the middle roll on 3d20 are correlacionados: the larger the lowest roll is, the larger the middle roll must also be. Thus, at least for relatively low skill levels, the situations where an extra point in the characteristic would be more helpful than an extra skill point (i.e. where none of your natural rolls are under the characteristic) are usually also those where you've rolled so badly that nem will actually help.

For an illustrative example, este script AnyDice (usando o empty die trick for calculating conditional probabilities) shows the skill level needed to succeed (with characteristic 11, although you can easily change that) when the lowest roll is either < 11 or ≥ 11. Notably, in the former case you have 57% chance of success even at skill 0, and a further 8% chance on top of that with skill 1, whereas in the latter case you need at least skill 2 to have any chance of success at all (since you need to lower both rolls by at least one)!

20.04.2019 / 00:00