Random number generation: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
(General overview of RNG and different seeded RNG channels)
 
m (typo)
Line 1: Line 1:
{{Cleanup|Needs more info on main channel RNG, world generation, and Irritable Genome. Probably needs some rephrasing for clarity as well.}}
{{Cleanup|Needs more info on main channel RNG, world generation, and Irritable Genome. Probably needs some rephrasing for clarity as well.}}
Random number generation (RNG) is used in most mechanics in Caves of Qud. There are two kinds of RNG in Qud - the main channel, which is used for most and specially seeded channels which are used for particular things that should not be rerolled.
Random number generation (RNG) is used in most mechanics in Caves of Qud. There are two kinds of RNG in Qud - the main channel, which is used for most random effects, and specially seeded channels, which are used for particular effects that cannot be rerolled.


== Main channel ==
== Main channel ==

Revision as of 18:10, 28 January 2022

This article may need cleanup to meet quality standards.
Please help improve this page by editing it.

Reason: "Needs more info on main channel RNG, world generation, and Irritable Genome. Probably needs some rephrasing for clarity as well."

This article may need cleanup to meet quality standards.
Please help improve this page by editing it.

Reason: "Needs more info on main channel RNG, world generation, and Irritable Genome. Probably needs some rephrasing for clarity as well."

Random number generation (RNG) is used in most mechanics in Caves of Qud. There are two kinds of RNG in Qud - the main channel, which is used for most random effects, and specially seeded channels, which are used for particular effects that cannot be rerolled.

Main channel

The main channel is used by almost anything that needs random values. Anything dependent on the main channel can be rerolled with Precognition. Notably, the random result for mutants of Eaters' nectar injectors uses the main RNG channel rather than a seeded channel, unlike drops of nectar.[1]

Seeded RNG

A few rolls use RNG channels with a stored seed. A roll on one of these channels is uniquely determined by the seed, and generates a new seed which is then saved for the next roll.[2] This means that they cannot be rerolled with Precognition effects, as returning to the beginning of the vision will restore the original seed. The seeded effects are:

  • Obtaining Mutations - this applies mainly to the set of options when buying a new mutation.[3] The mutation RNG channel can be rerolled by applying an Eaters' nectar injector or cooking with a drop of nectar. Additionally, the mutating effect (from the mutating gaze of a gamma moth) repeatedly rerolls this channel when it gives the message "You feel increasingly unstable.".[4]
  • Cooking with drops of nectar - this is a separate channel from the mutation seeded RNG, but the cooking effect specifically rerolls the mutation RNG in order to reset the mutation buy options.[5]
  • Drinking brain brine - While the effect type is determined by the seed, the specific result is not always. For instance, if drinking brain brine gives secrets, it will continue to give the same number of secrets even when rerolled with Precognition, but it may give different secrets. However, if it gives a mutation, it uses its own seeded RNG channel rather than the mutation RNG channel.[6]

References

  1. XRL.World.Parts.Nectar_Tonic_Applicator
  2. XRL.World.GameObject, method GetSeededRandom
  3. XRL.UI.StatusScreen, method BuyRandomMutation
  4. XRL.World.Effects.Mutating
  5. XRL.World.Effects.CookingDomainAttributes_UnitPermanentAllStats_25Percent
  6. XRL.World.Effects.BrainBrineCurse