Fandom

Wikihack

Random number generator

Redirected from Rng

2,034pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

NetHack uses a random number generator (RNG) to determine the outcome of in-game events. Probabilities are expressed in d notation, an homage to Dungeons and Dragons.

AnthropomorphisationEdit

The RNG is sometimes referred to as the Random Number God. The RNG plays a pivotal role in determining the fate of all characters, and is sometimes considered the deadliest enemy in the game, despite the fact that expert players such as marvin have demonstrated that nearly every game is ascendable.

Technical detailsEdit

Although NetHack relies on the C rand() function, random number generation is not as straightforward as picking a number between 0 and n. Rnd.c holds all of the game's RNG functions, which can return results that depend on your Luck or experience level. Source divers might profit from examining these functions.

MisuseEdit

It was found recently by a player named Adeon that a sufficiently determined player can find the seed of RNG after starting the game and then use it to his or her advantage - for example, to gain an unlimited number of wishes from a fountain. For demonstration, see his ttyrecs on NAO from 2008-02-28 (starting with http://alt.org/nethack/ttyrecscreen.php?fname=http://alt.org/nethack/userdata/Adeon/ttyrec/2009-02-28.10:31:15.ttyrec). See also Sartak's blog entry Predicting and controlling NetHack's randomness.

Also on Fandom

Random Wiki