Game Development Reference
In-Depth Information
FIGURE 11.7
The result of adding the results of tossing three six-sided dice generates a
normal distribution.
In the above list, the first entry is a simple flat probability. Each of the 20
possibilities is equally probable. We can say the same for number 6. It yields a flat
probability from 1 to 100. Numbers 2 to 5, however, all create some variant of a
normal distribution. We can ascertain characteristics of the resulting curves by
looking for some key features of the die-roll equation. By isolating those features, we
can learn how to utilize them in constructing our own probability distributions.
Generating a Simple Curve
For purposes of example, we will standardize on curves that produce a range of
[0...30]. Additionally, we are not going to limit ourselves to the Pythagorean solids
(and the 10-sided die) that make up the holy relics of D&D dice. We will allow random
numbers to be generated in the spirit of dice of any number of faces. For example,
0-15 will be a perfectly legitimate die roll for our purposes, although making a fair
16-sided die would be an interesting feat of engineering.
Given all of those options, there are plenty of ways that we can generate ran-
dom numbers from between 0 and 30. The simplest, of course, is by simply rolling
a d31. (Note that a d30 would only generate either [0...29] or [1...30].) This would
give us a uniform probability distribution. The probabilities would be even across
the entire range.
Search WWH ::




Custom Search