The Forge Reference Project

 

Topic: [Speed & Spirit] Dice Mechanic
Started by: FzGhouL
Started on: 8/4/2005
Board: Indie Game Design


On 8/4/2005 at 3:48am, FzGhouL wrote:
[Speed & Spirit] Dice Mechanic

Hey, I read a lot of the posts here, trying to get a sense of how to present my game and problems, so hopefully I learned something. Here goes.

Alright, so I am using dice and this is a certainty. I want my system to be uniform, so dice will stay in this aspect too.

I need a random way of determing a result. Not a Yes-No, Succeed-Fail, result.
I need to determine a result that checks five aspects, and determines the dominant aspect.

My old method:
Roll 1d20.
Option A= 2 sides.
Option B = 4 Sides
Option C = 4 Sides
Option D = 6 Sides
Option E = 4 Sides.

I split the dice and rolled. Which ever domain it landed in was the area of influence. Unfortunantly, no one could memorize (not even myself) the positions. On top of that, many attacks modify the scale, and it caused lots of confusion, because the domains size and areas would change. But the plus side was the statistics were easy to fiddle with.

My new Mechanic is much more fluid. But the problem is with Statistics (so it is exact opposite of the old system).
5 Dice are Rolled.
Option A = 1d4
Option B = 1d6
Option C = 1d6
Option D = 1d8
Option E = 1d4 +1

Then, the area of influence was the highest valued dice. The problem of two high dice was solved, by creating a duel-influence system. It works very fluidly for simple rolls.

The problem is I have no idea the exact percentage of which one will earn the highest roll. So, that is my first question. On an unmodified roll, what are the chance that each option gets for having the highest roll, and what are the chances for duel-highs, triple highs, quadruple highs, and all five being the same number? I'm afraid that is above my limits in the statistical field because you'll be dealing with competiting results.

The second question is like the first, except I want to apply modifiers. Lets assume I add +1 to a roll. How much would that change each statistic? +2? +3? -1? -2? -3? I want to get a feel for how things shift when rolls are changed. These is even more indepth than the last question because it has to be iterated on all the dice seperately.

Also, if the set Mods of +1 etc do not work out neatly and imbalance the scale tremendously, then what other ways could I apply modifiers on influence? A statistically pleasing, balanced, and fluid method would be appreciated.

Thank you very much, all help will be greatly appreciated.

Message 16249#173011

Previous & subsequent topics...
...started by FzGhouL
...in which FzGhouL participated
...in Indie Game Design
...including keyword:

 (leave blank for none)
...from around 8/4/2005




On 8/5/2005 at 3:47am, Walt Freitag wrote:
Re: [Speed & Spirit] Dice Mechanic

Here are a few quick calculations by hand. We can proceed with the more detailed questions if the basic results here are acceptable to you.

Chance of a clear win:
A  1.3%
B  14.2%
C  14.2%
D  39.2%
E  8.0%

Overall chance of a clear win (no tie): 77%

- Walt

Message 16249#173167

Previous & subsequent topics...
...started by Walt Freitag
...in which Walt Freitag participated
...in Indie Game Design
...including keyword:

 (leave blank for none)
...from around 8/5/2005




On 8/5/2005 at 5:14am, FzGhouL wrote:
RE: Re: [Speed & Spirit] Dice Mechanic

1%? Holy cow thats low. I didn't expect it to be that low.
So, how did you do that calculation? If you showed me the steps that would make my task easier since I wouldn't have to ask for more help.

Those results are good enough for me to proceed. Surprising, but acceptable. Thank you very much so far.

Message 16249#173169

Previous & subsequent topics...
...started by FzGhouL
...in which FzGhouL participated
...in Indie Game Design
...including keyword:

 (leave blank for none)
...from around 8/5/2005




On 8/5/2005 at 5:39pm, Walt Freitag wrote:
RE: Re: [Speed & Spirit] Dice Mechanic

Learning to do it yourself is a great idea, but take it slow. Though the arithmetic is simple, these kinds of probability calculations can tricky to set up correctly.

The key is to state clearly and in excruciating detail what must happen in order for the outcome whose probability you want to determine to occur. For instance, what must happen for die A to win clear? We can say, "die A must roll a higher number than any other die." But that's not specific enough. We can say, "die A must roll at least a 3 (because if it rolls a 2 it can at best tie with die E) and all the other dice must roll lower than A." That's getting closer, but it's still not specific enough. We want to state it in specific numbers, and to do that we have to split the possibilities up into individual cases. So we say: "either die A rolls a 4 AND all the other dice roll lower than 4, OR die A rolls a 3 AND all the other dice roll lower than 3." To be even clearer what we mean by "all the other dice roll lower than..." we can get even more explicit. That gives us:

die A has a clear win if: [die A rolls a 4 AND die B rolls less than 4 AND die C rolls less than 4 AND die D rolls less than 4 AND die E comes out less than 4] OR [die A rolls a 3 AND die B rolls less than 3 AND die C rolls less than 3 AND die D rolls less than 3 AND die E comes out less than 3]

Now, we can easily determine the probability of each of the individual events included in the conditions. For instance, the probability of die A (d4) rolling a 4 is 1/4, the probability of die B (d6) rolling less than 4 is 3/6, the probability of die D (d8) rolling less than 4 is 3/8. and the probability of a d4+1 coming out less than 4 (a natural 1 or 2 must be rolled, before the +1 is added) is 2/4. Note that I haven't bothered to simplify the fractions, for a reason I'll show later.

When I replace the individual events such as "die B rolls less than 4" with the probability of each event happening, I can also replace all the ANDs with multiplication signs and the OR with a plus sign. However, I can only do this because certain conditions are met.

I can only replace an OR with a + sign if the two possibilities connected by the OR are mutually exclusive -- that is to say, there is NO chance of both happening at once.

And I can only replace an AND with a * sign if the two possibilities connected by the AND are independent -- that is to say, whether or not one happens has no effect on the chance of the other one happening.

These are critically important conditions. Consider the following examples:

The probability of rolling a 5 or less on a d20 (numbered 1-20) is 5/20.
The probability of rolling an even number on a d20 is 10/20.
The probability of rolling a 13 or higher on a d20 is 8/20.

What's the probability of rolling a 5 or less OR a 13 or higher on a d20? It's 5/20 + 8/20, or 13/20. That's because rolling a 5 or less is mutually exclusive with rolling a 13 or higher. It's impossible for both to happen on the same roll.

What's the probability of rolling a 5 or less OR an even number on a d20? It's NOT 5/20 + 10/20, or 15/20. That's because it's possible for a roll to be both even and 5 or less. They're not mutually exclusive. So the probability of one or the other happening is not the sum of the probabilities of each one happening. (The actual answer is 13/20.)

What's the probability of rolling two d20s and getting 5 or less on both of them -- that is, rolling 5 or less on one of them AND rolling 5 or less on the other? It's 5/20 * 5/20, or 25/400. That's because whether or not one of them rolls 5 or less has no effect on the chance of the other one rolling 5 or less.

What's the probability of rolling a d20 and getting a number that's 5 or less AND 13 or higher? It's certainly NOT 5/20 * 8/20, or 40/400 (=1/10). In fact, the probability is obviously zero, since no number rolled can be less than 6 and higher than 12 at the same time. Whether or not the number is 5 or less affects the chance of whether or not it's 13 or higher, in a big way! They're not independent, so you can't get any meaningful result by multiplying the probabilities of the two cases together.

What's the probability of rolling a d20 and getting a number that's 5 or less AND even? It's NOT 5/20 * 10/20, or 50/400 (=1/8). That's because whether or not the number rolled is 5 or less affects the chance that it's even. There are more odd numbers than even numbers in the "5 or less" range. They're not independent. So the probability of both happening is not the product of the probabilities of each one happening. (The actual answer is 1/10.)

So, getting back to our problem of figuring the probability of a clear win by die A. We had:

die A has a clear win if [die A rolls a 4 AND die B rolls less than 4 AND die C rolls less than 4 AND die D rolls less than 4 AND die E comes out less than 4] OR [die A rolls a 3 AND die B rolls less than 3 AND die C rolls less than 3 AND die D rolls less than 3 AND die E comes out less than 3]

There are always four questions you have to answer about a statement like that, before turning it into arithemetic.

1. Are all the conditions separated by ANDs really independent?
2. Are all the conditions separated by ORs really mutually exclusive?
3. Do the conditions cover all ways to get the outcome? That is, can you be certain there's no way the outcome whose probability you're trying to figure could be obtained without meeting the conditions you've worked out?
4. Do the conditions guarantee the outcome? That is, can you be certain there's no way to meet the conditions you've worked out without producing the outcome whose probability you're trying to figure?

In our current case the answers are all yes. The cases separated by ANDs are independent because they're results of separate simultaneous die rolls. The cases separated by OR are mutually exclusive because one of them requires A to roll exactly 4 and the other requires A to roll exactly 3; clearly both cannot happen in the same roll. You'll have to satisfy yourself that questions 3 and 4 are affirmative. Die A cannot have a clear win if it rolls a 1 or a 2, or if any other die rolls greater than or equal to its roll. If none of those things happen, then die A cannot fail to have a clear win.

So, we can turn

die A has a clear win if [die A rolls a 4 AND die B rolls less than 4 AND die C rolls less than 4 AND die D rolls less than 4 AND die E comes out less than 4] OR [die A rolls a 3 AND die B rolls less than 3 AND die C rolls less than 3 AND die D rolls less than 3 AND die E comes out less than 3]

into

the probability of a clear win for die A = [1/4 * 3/6 * 3/6 * 3/8 * 2/4] + [1/4 * 2/6 * 2/6 * 2/8 * 1/4]
and it's all over but the arithmetic.

When doing the arithmetic, by not simplifying the fractions for the individual probabilities I make the denominator of both terms come out the same once they're multiplied out (4 * 6 * 6 * 8 * 4 = 4608, which is also the total number of different rolls possible with these dice). That means I can do all the multiplying and adding with the numerators alone, and then divide by 4608 for the final result. Like this:

the probability of a clear win for die A = ((1 * 3 * 3 * 3 * 2) + (1 * 2 * 2 * 2 * 1)) / 4608
= (54 + 8) / 4608
= 62 / 4608
= .01345

This shortcut makes more of a difference when there are more terms (more of those OR cases), such as when figuring the probability of a clear win by die D:

= (4*6*6*2*4 + 4*5*5*1*4 + 4*4*4*1*3 + 3*3*3*1*2 + 2*2*2*1*1) / 4608

Figuring the probabilities of various specific ties is a bit trickier. Of course, we've already figured the probability of a clear win by each die. Summing those together (which we can do because they're mutually exclusive) gives us the overall probability of a clear win. Since each result not a clear win must be a tie, one minus the overall probability of a clear win is what gave me the overall probability of a tie.

But if you want to know, say, the probability that die A will be involved in a (winning) tie, we need to get down to cases again. You might think you could set it up this way:

die A ties if [die A rolls 4 AND [die B rolls a 4 OR die C rolls a 4 OR die D rolls a 4 OR die E results in a 4]] OR [die A rolls 3 AND...

However, this fails question 2. The "die B rolls a 4 OR die C rolls a 4 OR die D rolls a 4..." part won't work because those are cases separated by ORs that are not mutually exclusive. And it also fails on question 4, becuase if A ties with some other die, but another die rolls higher, that's not the kind of tie you're interested in. You only want to know about ties for highest roll, aka winning ties.

We can fix both problems by getting more explicit and more complex with the cases:

die A is in a winning tie if [die A rolls a 4 AND [[die B rolls a 4 AND all other dice roll lower] OR [die C rolls a 4 AND all other dice roll lower] OR [die D rolls a 4 AND all other dice roll lower] OR [die E results in a 4 AND all other dice roll lower]]] OR [die A rolls a 3 AND [[die B rolls a 3 AND all other dice roll lower] OR [die C rolls a 3 AND all other dice roll lower] OR [die D rolls a 3 AND all other dice roll lower] OR [die E results in a 3 AND all other dice roll lower]]] OR [die A rolls a 2 AND die E results in a 2 AND all other dice roll ones]

Now all the OR conditions are mutually exclusive, and the conditions are restricted to winning ties with A. But even this has a bit of a problem with question 3: it covers all the cases where A is in a _two-way_ winning tie with some other die, but doesn't account for three-way, four-way, or five-way winning ties. (However, if the probability of a two-way winning tie with A is specifically what you want to know, then this is the correct way to work that out.)

Fortunately there's a different approach available to figure out "all winning ties involving A." We've already figured out the probability of a clear win by A. We can use a very similar calculation to figure out the probability of A being _unbeaten_ by any other die -- that is, the probability that no other die rolls _higher_ than A. Like this:

A is unbeaten if [A rolls a 2 AND B rolls 2 or less AND C rolls 2 or less AND D rolls 2 or less AND E rolls a natural 1] OR [A rolls a 3 AND B rolls 3 or less AND C rolls 3 or less AND D rolls 3 or less AND E rolls natural 2 or less] OR [A rolls a 4 AND B rolls 4 or less AND C rolls 4 or less AND D rolls 4 or less AND E rolls natural 3 or less]

I'll let you plug in the individual probabilities and do the arithmetic.

Now, when A is unbeaten, either A has a clear win OR A is involved in a winning tie with one or more of the other dice. Furthermore, those two possibilities are mutually exclusive, which means that in theory you could add the probability of a clear win for A to the probability of a winning tie involving A to get the probability thtat A is unbeaten. This means you can also subtract the probability of a clear win for A (which we knew from before) from the probability that A is unbeaten (which you've just calculated) to get the probability of a winning tie involving A.

It might or might not suprise you to find that the probability of A being part of a winning tie is just over four times greater than the probability of a clear win by A.

I hope this webose treatment has given you a sense of how to think about and perform these calculations. And I'm sure it also goes a long way toward explaining why many designers solve them in a completely different way: by writing computer programs that iterate through all the possible die rolls and count how many of them meet the conditions in question. :-)

- Walt

Message 16249#173233

Previous & subsequent topics...
...started by Walt Freitag
...in which Walt Freitag participated
...in Indie Game Design
...including keyword:

 (leave blank for none)
...from around 8/5/2005




On 8/6/2005 at 6:49am, FzGhouL wrote:
RE: Re: [Speed & Spirit] Dice Mechanic

Thank you VERY much. That helps a lot.
Mostly, the way you set up the problem helped me. I understood all the basics, but I never thought of where to start. But of course, that is the most important aspect.

It is very tedious, so that does make apparent why a computer would be assigned the task. If I get bored one of these days, I'll program a module in excel to do it for me. Thanks again, your hard statistics and your explination both went a long way in helping me.

Message 16249#173285

Previous & subsequent topics...
...started by FzGhouL
...in which FzGhouL participated
...in Indie Game Design
...including keyword:

 (leave blank for none)
...from around 8/6/2005