modding:xml:dice_range

A **dice range** is a number generated through the use of dice notation. In Transcendence, dice ranges are used primarily to simulate damage variation on weapons. However, dice ranges also have other uses, such as generating a single item in varying quantities across different stations of the same type.

A simple dice range is expressed in typeface as **x**d*y*, where **x** is the number of times the dice is thrown, and *y* is the number of sides the dice being thrown has.

For reference, **1** throw of a *6*-sided die in real life would be expressed as **1**d*6*.

To demonstrate how a dice range is used in Transcendence, take a look at the damage value of the DM1500 Disposable Missile Rack (minus damage modifiers), shown below:

"blast:4d6"

Each missile fired from the DM1500 will do **4**d*6* blast damage upon impact. This means that, whenever a missile from a DM1500 strikes a target, the game simulates **4** separate rolls of a *6*-sided die. It will then add up the result of each roll; the sum of the result of all the four rolls is the amount of damage the missile will do. This entire process is repeated for every missile fired from the DM1500.

Consider this scenario:

- Two missiles were fired from the DM1500, one after another. Assume that both missiles strike the same target.
- The first missile hits and does 4d6 damage. The game simulates 4 rolls of a 6-sided die.
- 4 on the first roll.
- 5 on the second roll.
- 2 on the third roll.
- 6 on the last roll.
- The game adds 4 + 5 + 2 + 6 and gets a sum of 17.

- The first missile does 17 damage to the target.
- The second missile hits and also does 4d6 damage. The game simulates another 4 rolls of a 6-sided die.
- 2 on the first roll.
- 6 on the second roll.
- 1 on the third roll.
- 2 on the last roll.
- The game adds 2 + 6 + 1 + 2 and gets a sum of 11.

- The second missile does 11 damage to the target.

Hence, the damage done by each individual missile is never constant, but is within a certain range.

Likewise, some items that are sold on stations have a “numberAppearing” value that causes them to appear within a quantity range for all stations that sell them. The numberAppearing value is often expressed as a dice range.

For this next example, refer to the numberAppearing value of the XM300 Reaper Missile, shown below:

"2d4"

Whenever a station that sells this item is docked with by the player for the first time, the game will generate 2d4 XM300 Reaper Missiles in the station's Commodity Exchange.

Now, consider the following scenario:

- A player docks at a Commonwealth Station for the first time and visits the Commodity Exchange.
- 2d4 XM300 Reaper Missiles are generated for sale. The game simulates 2 rolls of a 4-sided die.
- 2 on the first roll.
- 3 on the second roll.
- The game adds 2 + 3 and gets a sum of 5.

- That Commonwealth Station is selling 5 XM300 Reaper Missiles.
- The player leaves the Commonwealth Station, enters a neighboring system and docks with another Commonwealth Station in that system for the first time and visits the Commodity Exchange of that station.
- 2d4 XM300 Reaper Missiles are generated for sale. The game simulates another 2 rolls of a 4-sided die.
- 4 on the first roll.
- 3 on the second roll.
- The game adds 4 + 3 and gets a sum of 7.

- The second Commonwealth Station is selling 7 XM300 Reaper Missiles.

Naturally, the dice range is not restricted to single-digit rolls of a single-digit die; dice ranges that consist of hundreds of rolls of a die with hundreds of sides (e.g. 107d238, 231d53, 991d126, etc., etc.) are possible.

Dice ranges can also accept modifiers, such as addition, subtraction, multiplication and division.

Consider the following dice range:

"1d6+10"

In the above dice range, the game will simulate 1 roll of a 6-sided die, then add 10 to the result for the final sum, so if the game rolls a 4, it will add 10, and the final sum of the above dice range will be 14.

modding/xml/dice_range.txt · Last modified: 2014/12/27 04:40 (external edit)