Difference between revisions of "Random number generator"

From NetHackWiki
Jump to navigation Jump to search
(Added mention about Adeon's "misuse".)
(Misuse: [http://taeb-nethack.blogspot.com/2009/03/predicting-and-controlling-nethacks.html Predicting and controlling NetHack's randomness])
Line 10: Line 10:
  
 
==Misuse==
 
==Misuse==
It was found recently by player named Adeon, that 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 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). However, this technique takes a lot of time for any useful results.
+
It was found recently by player named Adeon, that 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 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 ''[http://taeb-nethack.blogspot.com/2009/03/predicting-and-controlling-nethacks.html Predicting and controlling NetHack's randomness]''.
 +
 
 +
 
 
[[Category:Game mechanics]]
 
[[Category:Game mechanics]]

Revision as of 13:41, 3 March 2009

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

Anthropomorphisation

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 details

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, but ultimately the only way a player can influence the odds is by maintaining a high Luck value.

Misuse

It was found recently by player named Adeon, that 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 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.