Difference between revisions of "Monster frequency"
(starting) |
(rework algorithm description) |
||
Line 2: | Line 2: | ||
When a monster is randomly being selected, the game will tally all of the monsters with a [[difficulty]] from one-sixth that of the current level's difficulty to the average of the level's difficulty of the player level<ref>[[makemon.c#line1226]]</ref>, sum their frequencies<ref>[[makemon.c#1240]]</ref>, generate a random number, and subtract the frequencies of successive monsters from this random number until zero is reached - the current monster is then selected<ref>[[makemon.c#line1274]]</ref>. | When a monster is randomly being selected, the game will tally all of the monsters with a [[difficulty]] from one-sixth that of the current level's difficulty to the average of the level's difficulty of the player level<ref>[[makemon.c#line1226]]</ref>, sum their frequencies<ref>[[makemon.c#1240]]</ref>, generate a random number, and subtract the frequencies of successive monsters from this random number until zero is reached - the current monster is then selected<ref>[[makemon.c#line1274]]</ref>. | ||
+ | |||
+ | When a monster is randomly being selected, the game picks a random monster subject to the following list of conditions with relative probabilities equal to the ratios of numberic monster frequencies (thus a monster with a 4 is twice as common as a monster with a 2). | ||
+ | |||
+ | Randomly generated monsters must be: | ||
+ | |||
+ | * No greater in [[difficulty]] than the average of the level's difficulty and the player level <ref>[[makemon.c#line1226]]</ref> | ||
+ | * No lower in difficulty than one-sixth that of the current level's difficulty | ||
+ | * Represented by an upper case letter, if you are on the [[rogue level]] <ref>[[makemon.c#line1246]]</ref> | ||
+ | * Neither [[unique]] or marked as '''not randomly generated''' (G_NOGEN) <ref>[[makemon.c#line1152]]</ref> | ||
+ | * Not [[genocide]]d or [[extinct]] | ||
+ | * Not [[Lawful]], if you are in [[Gehennom]] | ||
+ | * Not marked as '''only generated in Gehennom''' (G_HELL) (e.g. [[hell hound]]) while you are not in [[Gehennom]] | ||
+ | * Not marked as '''not generated in Gehennom''' (G_NOHELL) (e.g. [[winter wolf]]) while you are in [[Gehennom]] | ||
+ | |||
+ | Before monster frequencies are used for generation, a number is added to them depending on the relationship between the monster's [[alignment]] and the [[dungeon]] or [[special level]]'s alignment. <ref>[[makemon.c#align_shift]]</ref> | ||
==References== | ==References== |
Revision as of 04:06, 29 September 2006
The term monster frequency refers to a number which can technically range 0-7 (though 6 and 7 are not used) used internally to determine how frequently a monster is generated; it can be thought of as a relative probability that a particular monster will be selected.
When a monster is randomly being selected, the game will tally all of the monsters with a difficulty from one-sixth that of the current level's difficulty to the average of the level's difficulty of the player level[1], sum their frequencies[2], generate a random number, and subtract the frequencies of successive monsters from this random number until zero is reached - the current monster is then selected[3].
When a monster is randomly being selected, the game picks a random monster subject to the following list of conditions with relative probabilities equal to the ratios of numberic monster frequencies (thus a monster with a 4 is twice as common as a monster with a 2).
Randomly generated monsters must be:
- No greater in difficulty than the average of the level's difficulty and the player level [4]
- No lower in difficulty than one-sixth that of the current level's difficulty
- Represented by an upper case letter, if you are on the rogue level [5]
- Neither unique or marked as not randomly generated (G_NOGEN) [6]
- Not genocided or extinct
- Not Lawful, if you are in Gehennom
- Not marked as only generated in Gehennom (G_HELL) (e.g. hell hound) while you are not in Gehennom
- Not marked as not generated in Gehennom (G_NOHELL) (e.g. winter wolf) while you are in Gehennom
Before monster frequencies are used for generation, a number is added to them depending on the relationship between the monster's alignment and the dungeon or special level's alignment. [7]
References
- This page is a stub. Should you wish to do so, you can contribute by expanding this page.
A user has suggested improving this page or section as follows:
"Terms for the probability numbers need to be defined!"