Difference between revisions of "Dice notation"
From DoomRL Wiki
Game Hunter (Talk | contribs) m (double double text text) |
GinDiamond (Talk | contribs) |
||
Line 22: | Line 22: | ||
As the number of dice becomes large, the distribution approaches a [http://en.wikipedia.org/wiki/Normal_distribution normal distribution]. | As the number of dice becomes large, the distribution approaches a [http://en.wikipedia.org/wiki/Normal_distribution normal distribution]. | ||
+ | |||
+ | ===In a Nutshell=== | ||
+ | |||
+ | Damage is calculated by XdYxZ. | ||
+ | |||
+ | X is how many dice there are in a weapon's damage calculator. Y is the number of sides (in fact, you can imagine that these sides are literally numbered 1-Y). Z is the number of rolls the attack takes in order to do damage. For instance, the chaingun shoots four bullets, so there are four separate attacks (x4). A double shotgun has two barrels, so it has two separate attacks (x2). If an attack is single, such as a single bullet, the x1 is not shown. |
Revision as of 17:23, 20 July 2012
Dice notation is what DoomRL uses to describe how it calculates random values. In the game this is used exclusively for weapon damage. On this wiki, dice notation is often used to describe other random events that happen behind the scenes.
Contents |
Basic Meaning
If a weapon does XdY damage, then whenever that weapon attacks, the game rolls X number of Y-sided dice and adds the results together to get the damage.
Sometimes a weapon's damage will be listed as (XdY)×Z. This means that the weapon makes Z separate attacks whenever it is fired, and each attack does XdY damage.
Technical Aspects
Dice notation is actually a way of writing probability distributions. XdY to suggests the distribution of rolling X Y-sided dice and adding together the results of all the dice. It doesn't matter whether there is actually such a thing as a Y-sided die (in DoomRL you might see strange die sizes like 1d7). The rolling of a die is used as a mnemonic for sampling from a uniform distribution. Thus XdY is technically the distribution of adding together X independent samples from the uniform distribution on the numbers from 1 to Y.
DoomRL is a computer program, so it can't easily access any truly random events. Thus, all random values in the game ultimately come from a pseudorandom number generator.
Analysis
The range of XdY is from X to X×Y.
The average of XdY is X×(Y+1)/2. (Note that, while this is a decent approximation for weapon damage, it is not exact. There are other factors that change how much a given attack will deal, usually decreasing the average damage slightly.)
The variance of XdY is X×(Y2-1)/12. In particular, this means that if the average is (more or less) fixed, then a greater number of dice decreases the standard deviation. For example, 1d5 and 3d1 have the same average (3), but 3d1 has more dice, so it has a lower standard deviation (in this case, 0).
As the number of dice becomes large, the distribution approaches a normal distribution.
In a Nutshell
Damage is calculated by XdYxZ.
X is how many dice there are in a weapon's damage calculator. Y is the number of sides (in fact, you can imagine that these sides are literally numbered 1-Y). Z is the number of rolls the attack takes in order to do damage. For instance, the chaingun shoots four bullets, so there are four separate attacks (x4). A double shotgun has two barrels, so it has two separate attacks (x2). If an attack is single, such as a single bullet, the x1 is not shown.