News:

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

Main Menu

Probabilities Please

Started by masqueradeball, November 11, 2008, 04:11:06 AM

Previous topic - Next topic

masqueradeball

I'm working on a fantasy game to replace the often frustrating experience that is D&D (in any edition). My "core mechanic" functions like so:

Characters roll 2d if untrained or  3d if trained, in addition, they may gain bonus dice for special abilities or skills, but they only keep and total 2d if untrained and 3d if trained. The character cannot roll dice than twice the base (so 4d if untrained, 6d if trained). These are then compared to a DC... so far, so good. It gets a little more complicated when you add in Edge. A character's total dice pool size is increased by his Edge and in addition he may keep and add any dice in his pool that come up below his Edge without having them count against his total dice kept.

Can anyone out there help me determine the probabilities of various results as the dice pool sizes and Edges increase... or  perhaps they could tell me how to figure these things out myself.
Nolan Callender

Eero Tuovinen

Blogging at Game Design is about Structure.
Publishing Zombie Cinema and Solar System at Arkenstone Publishing.

masqueradeball

Nolan Callender

Daniel B

Some simple rules for probability.. obvious, but having them spelled out may be instructive.

Notation:
        P(A) = probability of event A
        P(B|A) = probability of event B given that event A has already happened

Statistical Laws:

        P(A) = number of outcomes where A happens / number of possible outcomes
                For example, P(drawing an ace from a full 52 card deck) =   4 / 52,   from having four aces in fifty-two cards

        P(B|A) = P(B) * P(A) if and only if the events are independent.
                For example, P(rolling another 6 on a d6 | rolled a 6 on your first roll) = 1/6 * 1/6
                This is not true for a deck of cards, because the possible outcomes of drawing a 2nd card depend on what
                you drew for the first. If you drew an Ace, your chances of drawing another ace are only 3/51.

         n! = factorial, which is mathspeak for n*(n-1)*(n-2)*..*1 .. for example 3! = 3*2*1 = 6. It is taken by convention
                that 0! = 1, though 0*anything is meaningless. Factorials are useful in dealing with probabilities in a fixed-
                sized set, like playing cards.

         (n choose x) another math term. It means n! divided by the product x! * (n-x)!  What it MEANS means, is when
                you have a certain number n of items, like tokens, how many ways can you choose an x size subset of
                those items.
                For example, from a handsize of five Magic Cards, how many ways can I choose three of those cards?
                     (5 choose 3) = 5! / (3! * 2!) = 120 / (6 * 2) = 120/12 = 10

Your game:
        In the case where you're rolling some and dropping the lowest dies to keep only a certain max number of dice, the probabilities are no longer independent so you can break the problem down to easier-to-calculate probabilities. You'd have to do it in one go.
EG For an Untrained character (ie 2d), the total number of possible results is 11 (2..12). If the PC has four dice to roll but drops the two lowest, you'd have to figure out the number of ways each total from 2..12 can be rolled with four drop two dice.

Calculating for 12 is easiest: given that 6 is the best you can roll, if you roll two sixes, the other two dice are irrelevent.
Therefore, the first question is how many ways can you roll at LEAST two sixes? Answer: (4 choose 2) = 4! / (2!*2!) = 24/4 = 6
Next: how many ways are there to roll the remaining two dice, given that their results don't matter? 6*6 = 36

Therefore, the probability of rolling a 12 in a situation where you roll four d6's and drop the two lowest is:
         P(A) = (6 * 36) / (36*36*36*36)
                = 6 / (36*36*36)
                = 1 /  (6*36*36)

Calculating the other results just gets trickier from there. Good luck! :-D

P.S. if the "Edge" dice are simply added on top of the original rolls, their probabilities don't really matter because the Edge dice are independent. By the statistical law for independent probabilities I mentioned above, the probabilities can be broken down into simpler terms, ie you calculate the probabilities for the Edge dice separately and just multiply. You'll get a table, one axis is the original set of results (eg 2..12 in my example), the other axis is Edge dice result.
Arthur: "It's times like these that make me wish I'd listened to what my mother told me when I was little."
Ford: "Why? What did she tell you?"
Arthur: "I don't know. I didn't listen."

Daniel B

Whoops, n! and (n choose x) shoulda been under Notation
Arthur: "It's times like these that make me wish I'd listened to what my mother told me when I was little."
Ford: "Why? What did she tell you?"
Arthur: "I don't know. I didn't listen."

NN

This system is very difficult to calculate probabilities.

If you want player calculation of odds to be part of the game, you are going to have to think of another way.


Eero Tuovinen

It's probably not that Masquerade wants players to calculate probabilities; more likely he'll want to do it himself during design.

This is a very complex dicing set-up, however, and I don't have the time myself to calculate this right now. I suggest using the Monte Carlo method: write a computer program to roll the dice for you a couple thousand times and see what sort of results come up on average.
Blogging at Game Design is about Structure.
Publishing Zombie Cinema and Solar System at Arkenstone Publishing.

Rafu

You could learn and use TROLL - a scripting language explicitly designed for simulating the intricate dice-rolling procedures of RPGs and calculating probabilities for the chosen method.
I don't have a bookmark handy on the PC I'm writing from right now, but I do remember there was a thread on story-games.com no more than 2 months ago.

Raffaele Manzo, "Rafu" for short
(...And yes, I know my English sorta sucks, so please be easy on me...)

Ben Lehman

Give me clarification on what an Edge does:

An Edge gives you extra dice (which can blow past your cap of twice the number of dice you keep) equal to its value. In addition, you keep all dice equal or lower than the value of the edge. Is this correct?

What is the range of Edge values, practically? 1-3?

How likely is someone to be "at cap" before applying an Edge?

yrs--
--Ben

chance.thirteen

I also recommend Torben Morgensen's dice probability calculator Troll.

http://www.diku.dk/~torbenm/Troll/

There is a simple Windows XP set up package, as for Moscow ML, as well as for Troll.

It can't do dice where you have mixed numbers of sides, but it can do most everythign else having to do with dice.


Guy Srinivasan

Quote from: chance.thirteen on November 11, 2008, 07:00:34 PM
I also recommend Torben Morgensen's dice probability calculator Troll.

http://www.diku.dk/~torbenm/Troll/

There is a simple Windows XP set up package, as for Moscow ML, as well as for Troll.

It can't do dice where you have mixed numbers of sides, but it can do most everythign else having to do with dice.
Holy wtf Batman, that thing's amazing. Your answer, masqueradeball, is:
x := (R+E)d6; sum ((E < largest K x) @ (E >= x))

Is there a better way to do it? I didn't see a way to get the result without assigning the roll to a variable.

big dummy

By a rather amazing coincidence, I have a PDF out (for about two months now) which also uses a "roll many / keep one" system for DnD, mine uses 20 sided dice though, could you show some stats on that?

I'm particularly interested in whether a one die at a time strategy would work better or worse than a multi die (roll many / keep one) strategy since our system allows both.

G.

NN

The chance of rolling a target number x on a d20 with n rolling attempts is

1 - ((x-1)/20) n

chance.thirteen

I have a long standing respect for Troll. Sadly, I can get it up and running on a Windows machine, but I am a Mac user, and have had no luck getting it to work there. I end up using in on other peoples computers.

big dummy

Quote from: Eero Tuovinen on November 11, 2008, 03:50:43 PM
It's probably not that Masquerade wants players to calculate probabilities; more likely he'll want to do it himself during design.

This is a very complex dicing set-up, however, and I don't have the time myself to calculate this right now. I suggest using the Monte Carlo method: write a computer program to roll the dice for you a couple thousand times and see what sort of results come up on average.

Doh!  I should have thought of that, as I'm a computer programmer by profession :P 

Per your suggestion I'm working on one now which can test various combinations of dice for various numbers of iterations, though unfortunately it's not a compilable language that I usually work in (requires run-times) but after i get it working maybe I'll make a simple one in Flex I could put out on a website somewhere for the community to use.

G.