News:

Forum changes: Editing of posts has been turned off until further notice.

Main Menu

I need help with a dice math problem

Started by Tyler.Tinsley, June 06, 2009, 09:04:46 AM

Previous topic - Next topic

Tyler.Tinsley

hi, I'm new here and also fairly new to developing RPGs, I hear good things about this community so I will try to contribute as much as I ask from it.

I'm working on my new game and I have dice mechanic I want to use. It gives me the 0-infinity result potential I'm looking for but seems to have satisfyingly stable return.

The problem is I don't know how to calculate the odds for this mechanic, so I'm seeing if some of you can help me out.

The dice mechanic works like this

based on the situation a varying number of D6 are rolled

results of 1 & 2 count for nothing
results of 3-6 count as success
for each 6 rolled a new dice is added to the roll and its result is applied in the same way, with the potential for rolling infinite sixes.

So based on this what is the average success for each dice rolled, or phrased differently what percentage of the dice rolled will result in success?

The best I was able to come up with was a very rough average of 80%  but I'm not sure if that's accurate or if the average changes based on how many dice are rolled to start with.

I'm also interested in the math behind including results of 1-3 as counting for nothing. My attempt puts the success ratio at 60%

chance.thirteen

http://catlikecoding.com/dice/ probably has the answer, but it's a complex one.

The basic die is 1d{0,0,1,1,1,1} however, getting the application to recognize the final 1 as a reroll chance is beyond my ability.

Fortunately the author posts here!


Tyler.Tinsley

I saw the calculator but was not quite smart enough to figure it out as well as you have.

The mechanic is basically plagiarized from spending a fate point in mouse guard I wonder if Luke has the numbers laying around?

man I wish I had a math wiz in my play test group.

Jasper Flick

:) Don't worry chance.thirteen, It's beyond the calculator's ability as well. It can only recognize sets of distinct values, not individual positions on the dice.

Here we want to give the six a distinct value, but still also count it as just 1 succes. We can get there, but it's dirty. Here's the steps:

Basically, we start with 1d6, but weigh it like this: 1d6c{1..2 = 0, 3..6 = 1}. That's another way to write 1d{0,0,1,1,1,1}. Can't explode this the right way though.

Let's make the 6 stand out, by increasing its order of magnitude by two: 1d6c{1..2 = 0, 3..5 = 1, 6 = 100} or 1d{0,0,1,1,1,100}. Now we can explode just the six: 1d{0,0,1,1,1,100}e3h. We explode at most 3 times, not infinite. That's a limitation, but rerolling more that three times is extremely rare anyway. You can increase the number to get higher precision.

But now the numbers are all weird, both 101 and 200 represent 2 successes! We can fix that, by treating the result as a die and weighing it again: 1d(1d{0,0,1,1,1,100}e3h)c{0=0,1=1,100=1,101=2,200=2,201=3,300=3,301=4,400=4}. If you explode higher than 3, you have to add weights for 401, 500, and so on.

Now finally we have the proper result for rolling one die, rerolling it at most 3 times. Just increase the first number to roll more of them, for example six: 6d(1d{0,0,1,1,1,100}e3h)c{0=0,1=1,100=1,101=2,200=2,201=3,300=3,301=3,400=4}.

If you want to count 1..3 as 0, just chance the initial weights: 1d{0,0,0,1,1,100}. So rolling that six times is 6d(1d{0,0,0,1,1,100}e3h)c{0=0,1=1,100=1,101=2,200=2,201=3,300=3,301=4,400=4}.

Hope it helps!
Trouble with dice mechanics? Check out AnyDice, my online dice distribution calculator!

Tyler.Tinsley

wow thanks!

the explanation went far over my head but it managed to drop enough knowledge on me that I can understand what my odds look like. This dice mechanic results in some funny curves and proportions. the average return seems very linked to the amount of dice rolled.

this has helped a whole bunch!

Ron Edwards

Hi Tyler,

In one part of your post you said 1-2 is a failure (or "failed die"), and in another, you said 1-3. Which is it?

Best, Ron

Tyler.Tinsley

I was thinking about using success or fail raito as a way to model conditions so 1&2 = fail is a healthy person. 1-3 = fail is likely an injured person and so on, for each new condition you have the ratio would get worse. I'm probably going to scrap this idea for something little more cinematic. I would love to have just one method for rolling dice for the whole game.

Right now I'm worried the formula actually produces a little too stable a return with around %50 off the results tied up in just a few values , like when you roll 6 dice roughly 50% of the time you are going to get 4 or 5. granted in this game the difference between 4 or 5 could be very critical. so maybe it will be fine.

I will likely start play testing sections of the game with the current 1&2 =fail


chance.thirteen

The word ratio reminded me of something. You could just say that hurt characters lose 1/5th their successes, wounded lose 2/5ths, badly wounded lose 3/5ths and so on. Decide if you round up or down, and you have a consistance loss that doesn't rely on dice whackiness to tell you it is happening. You also avoid the trouble White Wolf ran into with their increasing targent numbers to the point where a very high pool and a very low pool essentially performed the same because it was very rare to get a success on any die (example: a 10 difficulty. 3 d10s have a worse chance of getting results of 10 compared to a 9 d10 pool, but its still much more happenstance than anything at all reliable.)

Tyler.Tinsley

My goal is to have conflicts play out like they do in a movie. So I'm likely going to use more temporary shocking moments to model injuries. Like how Inigo Montoya is wounded a few times but still manages to come back and avenge his fathers death. It's a little fantastic but your still able to suspend disbelief.

If I were going for more of a simulation or a less Hollywood kind of story then the sliding ratio would work fine (I would only expand the fail ratio to cover 3&4  3 being lost to physical dysfunction and 4 being lost to mental imbalance). The game already has a strong mechanic for tracking each character's relative advantage in the fight so injury will likely be folded into this.

wincz

I think what your looking for is called the binomial distribution.

It is given as P(K=k) = n!/((n-k)!k!) * p^k * (1-p)^(n-k)

this is the probability of getting exactly k success on n dices. p is the probability of getting a success,
for you with 1-3 as failure gives p = 1/2, and 1-2 as failure gives you p = 2/3.

Now, the thing I don't now about your system is how many dices and how many successes you need.

So just an example in case of,

if I roll n = 5 dices with p = 1/2 and k = 2 (I ask for at least 2 successes),
then you have to sum P(K=2)+P(K=3)+P(K=4)+P(K=5)

Oh, also the ! sign is for factorial, meaning for example 5! = 5*4*3*2*1
With a calculator It quite easy to compute from here.

Now, for the 6 = reroll, this complicate the situation quite a bit, as there is 1/6 chance that the number of dice increases.
Doing it exactly would get very messy, but there is a simple way to approximate, neglecting six giving a second six.
A six increase the number of dice, this means that instead of

P(K=2)+P(K=3)+P(K=4)+P(K=5) you should do  (1+1/6)*( P(K=2)+P(K=3)+P(K=4)+P(K=5) )

Hope it helps..

In my game I use 1-3 fail, 4-6 ok, no reroll


wincz

Hm, sorry, the reroll 6's trick is not correct

... It is more complicated than that.

I'll post the solution to this latter on.

Tyler.Tinsley

I ran through a little combat today and I think I'm going to stick with 1&2=fail with an exploding 6 mechanic.

In the system it's often the players that actually determine how many dice are rolled so the only thing that is needed math wise is a an easy to understand explanation so players can make an informed choice.

something like this "On average 80% of the dice you roll will be successful"

Jasper Flick

Just for fun, here's another variable to consider: the die size.

For example, you succeed on 1..2 and reroll on a 1.
If you're dominating, roll d4s.
If you're OK, roll d6s.
If you're shocked, roll d8s.
If you're injured, roll d10s.
If you're seriously screwed, roll d12s.
If you're basically dead, roll d20s.

The advantage is that the numbers to look for and the amount of dice to roll stay the same. Also, having to roll bigger dice reall feels different. The downside is that you need to have all those dice.
Trouble with dice mechanics? Check out AnyDice, my online dice distribution calculator!

wincz

How many successes do you require for a throw to be considered successful ?
one or more ? Because this has a strong impact on the odds.

Concerning the 6's reroll, if the roll is successful anyway, there is no point of
knowing if there is 6's or not. They're important only for throw with less success
than required, but having 6's may push them up past the threshold.

So, what has to be done is (for the previous example)

P(K=2)+P(K=3)+P(K=4)+P(K=5) + P(K = 1, with one 6)

this gives (with 1-2 as failures) 0.9544 + 0.0076 = 0.962 or 96.2% of succeeding at least to successes with 5 dices.

this might come handy : http://www.stat.tamu.edu/~west/applets/binomialdemo.html




Jasper Flick

By the way, here's the distribution calculator input for my fun example.

5d(1d(1d6c{1=100,2=1})e3h)c{1=1,100=1,2=2,101=2,3=3,201=3,4=4,301=4,400=4}

The red number is the amount of dice rolled.
The green number is the die size.
The blue number is the max number of rerolls (supports max of 3 with this input string).

Or use wincz's thing, if that's easier.
Trouble with dice mechanics? Check out AnyDice, my online dice distribution calculator!