Difference between revisions of "Monster frequency"

From NetHackWiki
Jump to navigation Jump to search
 
(12 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The term '''monster frequency''' applies to randomly generated monsters, as opposed to polymorph results and more specific ways of monster generation, and 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.
+
In ''[[NetHack]]'', '''monster frequency''' is a number defined for each [[monster]] in the range 0–7, which determines how frequently a monster is generated, relatively to the other monsters. It is used in random [[monster creation]], but not in deliberate polymorph results and more specific ways of monster generation.
 
 
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); this can be thought of as generating a list of monsters with each monster appearing a number of times equal to its monster frequency and choosing purely randomly off of this list.
 
 
 
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<ref>[[makemon.c#line1246]]</ref>
 
* Neither [[unique monster|unique]] nor marked as '''not randomly generated''' (G_NOGEN) <ref>[[makemon.c#line1152]]</ref>
 
* Not [[genocide]]d or [[extinct]]
 
* If you are on the [[rogue level]]:
 
** Represented by an upper case letter
 
* If you are in [[Gehennom]]:
 
** Not [[Lawful]]
 
** Not marked as '''not generated in Gehennom''' (G_NOHELL) (e.g. [[winter wolf]])
 
* If you are not in Gehennom:
 
** Not marked as '''only generated in Gehennom''' (G_HELL) (e.g. [[hell hound]])
 
 
 
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>
 
  
 
The following terms are used to describe the frequency of a monster in the infobox on monsters' pages:
 
The following terms are used to describe the frequency of a monster in the infobox on monsters' pages:
Line 37: Line 19:
 
| 5 || Common
 
| 5 || Common
 
|-
 
|-
| 6 || (unused)
+
| 6 || Very common (unused in vanilla NetHack)
 +
|-
 +
| 7 || Prolific (unused in vanilla NetHack)
 +
|}
 +
 
 +
==Adjustment for aligned levels and branches==
 +
If a [[special level]] or [[branch]] has an [[alignment]], the frequency values of all monsters are adjusted by adding a number depending on the alignment of the monster and that of the branch or level.<ref>{{function|makemon.c|align_shift}}</ref> The numbers that are added to the frequencies are:
 +
 
 +
{|class=prettytable
 +
|-
 +
! Monster's alignment !! Lawful level/branch !! Neutral level/branch !! Chaotic level/branch
 +
|-
 +
| -20 || 0 || 0 || 5
 +
|-
 +
| -19 to -17 || 0 || 0 || 4
 +
|-
 +
| -16 to -13 || 0 || 1 || 4
 +
|-
 +
| -12 || 1 || 2 || 4
 +
|-
 +
| -11 to -9 || 1 || 2 || 3
 +
|-
 +
| -8 to -5 || 1 || 3 || 3
 +
|-
 +
| -4 || 2 || 4 || 3
 +
|-
 +
| -3 to -1 || 2 || 4 || 2
 +
|-
 +
| 0 || 2 || 5 || 2
 +
|-
 +
| 1 to 3 || 2 || 4 || 2
 +
|-
 +
| 4 || 3 || 4 || 2
 +
|-
 +
| 5 to 8 || 3 || 3 || 1
 +
|-
 +
| 9 to 11 || 3 || 2 || 1
 +
|-
 +
| 12 || 4 || 2 || 1
 +
|-
 +
| 13 to 16 || 4 || 1 || 0
 +
|-
 +
| 17 to 19 || 4 || 0 || 0
 +
|-
 +
| 20 || 5 || 0 || 0
 +
|}
 +
 
 +
For example, consider the Oracle level, which is neutral. On that level, a kitten, which is neutral (alignment 0) and whose normal frequency is "1", will have its frequency increased to 6. A black unicorn, which is chaotic (alignment -7) and whose normal frequency is also "1", will have its frequency increased to 4.
 +
 
 +
That does not mean that the kitten is six times more common on the Oracle level than on an unaligned level. Indeed, the numbers are ''relative'' frequencies, and since almost every monster has its frequency increased on aligned levels, the kitten will actually be less than six times more common than on an unaligned level. 
 +
 
 +
This explains why monsters with a frequency of "0", but without the <code>[[G_NOGEN]]</code> flag, are not randomly generated on unaligned levels but randomly generated on aligned levels and branches. In vanilla ''NetHack'', "baby" monsters (dragons, naga, worms, crocodiles) are the only ones with this property.
 +
 
 +
The aligned levels are:<ref>[[Source:NetHack_3.4.3/dat/dungeon.def|dat/dungeon.def]]</ref>
 +
 
 +
{|class=prettytable
 +
|-
 +
! Lawful !! Neutral !! Chaotic
 +
|-
 +
|
 +
* The [[Gnomish Mines]]
 +
|
 +
* [[The Oracle#Level|The Oracle Level]]
 +
* [[Sokoban]]
 +
|
 +
* [[Medusa's Island]]
 +
* [[Vlad's Tower]]
 +
|}
 +
 
 +
==SLASH'EM==
 +
 
 +
In SLASH'EM, many monsters that are present in Vanilla NetHack have a higher frequency than they do in Vanilla. The most extreme examples are kittens, little dogs and their grown-up forms, all of which have a frequency of "1" in Vanilla and "7" in SLASH'EM. These are the only six SLASH'EM monsters with a "7" frequency. Floating eyes and cockatrices have a "6" frequency. This means that SLASH'EM, unlike Vanilla, uses the entire range of possible frequencies (0&ndash;7).
 +
 
 +
Also, the frequency adjustment for aligned levels and branches is not as large as in vanilla, as shown in the following table:
 +
 
 +
{|class=prettytable
 +
|-
 +
! Monster's alignment !! Lawful level/branch !! Neutral level/branch !! Chaotic level/branch
 +
|-
 +
| -20 || 0 || 0 || 2
 +
|-
 +
| -19 to -11 || 0 || 0 || 1
 +
|-
 +
| -10 to -1 || 0 || 1 || 1
 +
|-
 +
| 0 || 1 || 2 || 1
 +
|-
 +
| 1 to 10 || 1 || 1 || 0
 +
|-
 +
| 11 to 19 || 1 || 0 || 0
 
|-
 
|-
| 7 || Prolific (unused)
+
| 20 || 2 || 0 || 0
 
|}
 
|}
  
Line 45: Line 116:
 
<references />
 
<references />
  
{{stub|Terms for the probability numbers need to be defined!}}
 
 
{{nethack-343}}
 
{{nethack-343}}
 
[[Category:Monster attributes]]
 
[[Category:Monster attributes]]

Latest revision as of 00:52, 18 January 2021

In NetHack, monster frequency is a number defined for each monster in the range 0–7, which determines how frequently a monster is generated, relatively to the other monsters. It is used in random monster creation, but not in deliberate polymorph results and more specific ways of monster generation.

The following terms are used to describe the frequency of a monster in the infobox on monsters' pages:

Frequency Description
0 Not randomly generated
1 Very rare
2 Quite rare
3 Rare
4 Uncommon
5 Common
6 Very common (unused in vanilla NetHack)
7 Prolific (unused in vanilla NetHack)

Adjustment for aligned levels and branches

If a special level or branch has an alignment, the frequency values of all monsters are adjusted by adding a number depending on the alignment of the monster and that of the branch or level.[1] The numbers that are added to the frequencies are:

Monster's alignment Lawful level/branch Neutral level/branch Chaotic level/branch
-20 0 0 5
-19 to -17 0 0 4
-16 to -13 0 1 4
-12 1 2 4
-11 to -9 1 2 3
-8 to -5 1 3 3
-4 2 4 3
-3 to -1 2 4 2
0 2 5 2
1 to 3 2 4 2
4 3 4 2
5 to 8 3 3 1
9 to 11 3 2 1
12 4 2 1
13 to 16 4 1 0
17 to 19 4 0 0
20 5 0 0

For example, consider the Oracle level, which is neutral. On that level, a kitten, which is neutral (alignment 0) and whose normal frequency is "1", will have its frequency increased to 6. A black unicorn, which is chaotic (alignment -7) and whose normal frequency is also "1", will have its frequency increased to 4.

That does not mean that the kitten is six times more common on the Oracle level than on an unaligned level. Indeed, the numbers are relative frequencies, and since almost every monster has its frequency increased on aligned levels, the kitten will actually be less than six times more common than on an unaligned level.

This explains why monsters with a frequency of "0", but without the G_NOGEN flag, are not randomly generated on unaligned levels but randomly generated on aligned levels and branches. In vanilla NetHack, "baby" monsters (dragons, naga, worms, crocodiles) are the only ones with this property.

The aligned levels are:[2]

Lawful Neutral Chaotic

SLASH'EM

In SLASH'EM, many monsters that are present in Vanilla NetHack have a higher frequency than they do in Vanilla. The most extreme examples are kittens, little dogs and their grown-up forms, all of which have a frequency of "1" in Vanilla and "7" in SLASH'EM. These are the only six SLASH'EM monsters with a "7" frequency. Floating eyes and cockatrices have a "6" frequency. This means that SLASH'EM, unlike Vanilla, uses the entire range of possible frequencies (0–7).

Also, the frequency adjustment for aligned levels and branches is not as large as in vanilla, as shown in the following table:

Monster's alignment Lawful level/branch Neutral level/branch Chaotic level/branch
-20 0 0 2
-19 to -11 0 0 1
-10 to -1 0 1 1
0 1 2 1
1 to 10 1 1 0
11 to 19 1 0 0
20 2 0 0

References


This page may need to be updated for the current version of NetHack.

It may contain text specific to NetHack 3.4.3. Information on this page may be out of date.

Editors: After reviewing this page and making necessary edits, please change the {{nethack-343}} tag to the current version's tag or {{noversion}} as appropriate.