Difference between revisions of "Dice notation"
From DoomRL Wiki
Game Hunter (Talk | contribs) m (typos, added note about weapon damage (section describing DPS will be written sometime later)) |
Game Hunter (Talk | contribs) m (double double text text) |
||
Line 9: | Line 9: | ||
==Technical Aspects== | ==Technical Aspects== | ||
− | Dice notation is actually a way of writing [http://en.wikipedia.org/wiki/Probability_distribution 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 | + | Dice notation is actually a way of writing [http://en.wikipedia.org/wiki/Probability_distribution 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 [[plasma rifle|1d7]]). The rolling of a die is used as a mnemonic for sampling from a [http://en.wikipedia.org/wiki/Uniform_distribution_%28discrete%29 uniform distribution]. Thus XdY is technically the distribution of adding together X [http://en.wikipedia.org/wiki/Independence_%28probability_theory%29 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 [http://en.wikipedia.org/wiki/Pseudorandom_number_generator pseudorandom number generator]. | 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 [http://en.wikipedia.org/wiki/Pseudorandom_number_generator pseudorandom number generator]. |
Revision as of 01:56, 5 September 2011
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.
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.