Difference between revisions of "Dice notation"

From DoomRL Wiki

Jump to: navigation, search
(Created page with "Dice notation is what Doom RL 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 ...")
 
m
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Dice notation is what Doom RL 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.
+
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==
 
==Basic Meaning==
  
If a weapon does XdY damage, then whenever that weapon attacks, the game rolls X Y-sided dice and adds the results together to get the damage.
+
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 weapons 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.
+
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==
 
==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 matter whether matter whether there is actually such a thing as a Y-sided die (in Doom RL 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.
+
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.
  
Doom RL 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].
  
 
==Analysis==
 
==Analysis==
Line 17: Line 17:
 
The range of XdY is from X to X×Y.
 
The range of XdY is from X to X×Y.
  
The average of XdY is X×(Y+1)/2.
+
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&times;(Y<sup>2</sup>-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).
 
The variance of XdY is X&times;(Y<sup>2</sup>-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 [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 to 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.

Latest revision as of 22:18, 11 February 2013

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 to 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.

Personal tools