Difference between revisions of "Room"

From NetHackWiki
Jump to navigation Jump to search
(Added probability for room a room to be lit.)
(Resolve todo by adding Generation section, which folds in the recently added Lit rooms section, and fix math of when a room is lit or unlit; update reference)
Line 1: Line 1:
{{todo|what is the probability distribution how many rooms will appear on a given level? Also, how likely are dark rooms?}}
 
 
'''Rooms''' are a feature ubiquitous in [[NetHack]] - their purpose is analogous to those of real life: eg "An area separated by walls or partitions from other similar parts of the structure or building in which it is located".
 
'''Rooms''' are a feature ubiquitous in [[NetHack]] - their purpose is analogous to those of real life: eg "An area separated by walls or partitions from other similar parts of the structure or building in which it is located".
  
Line 27: Line 26:
  
  
 +
 +
== Generation ==
 +
This section covers only typical non-special, room-and-corridor levels in the [[Dungeons of Doom]]. Rooms also appear in special levels and certain [[Quest]] filler levels, but those typically do not have the random generation described below.
 +
 +
On each level, a number of rooms will be generated, and then they will be connected up by [[corridor]]s and [[door]]s. The algorithm for placing rooms makes it difficult to predict how many rooms a level will contain, but most levels contain between 5 and 10 rooms, with occasional appearances of levels with as few as 4 or as many as 12. On these levels, one room may be selected to become a [[special room]].
 +
 +
{{upcoming|NetHack 3.7.0|Each level will also generate up to two [[themed room]]s, which can be irregularly shaped or contain interesting contents and terrain.}}
 +
 +
There tends to be a fixed rather than area-based chance of generating [[dungeon features]], [[monster]]s, [[objects]], and [[traps]] in each non-special room. Therefore, a level with more rooms will contain more of these things.
 +
 +
=== Lit rooms ===
 +
<!-- Math:
 +
"Lit check 1": rnd(1 + depth) < 11. Always true above level 10. On level 10, there is a 10/11 chance of passing this check; on level 11 there is a 10/12 chance, etc.
 +
"Lit check 2": rn2(77). Fixed 76/77 chance.
 +
Both lit checks must pass in order for a room to be lit.
 +
-->
 +
Rooms generate either as lit or unlit, meaning that every square in a room will be lit up or dark. The chance of a room being lit depends solely on the [[level difficulty]], with fewer lit rooms deeper into the dungeon:{{refsrc|src/sp_lev.c|1154|nethack=3.6.6}}
 +
 +
Level 9 or above: <math>\frac{76}{77}</math>
 +
 +
Level 10 or below: <math>\frac{76}{77}\cdot\frac{10}{\text{difficulty} + 1}</math>
  
 
== Strategy ==
 
== Strategy ==
Finding rooms is not always straight-forward. The key is to be persistent in [[search]]ing, and be aware that rooms can be as small as 2x3 and hence tucked into places you would not expect them. Knowing the extent of the Dungeon on your screen helps. A [[Vault]] is never accessible by corridor or stairs, and must be reached by some other way.
+
Finding rooms is not always straightforward. The key is to be persistent in [[search]]ing, and be aware that rooms can be as small as 2x3 and hence tucked into places you would not expect them. Knowing the extent of the Dungeon on your screen helps. A [[Vault]] is never accessible by corridor or stairs, and must be reached by some other way.
  
 
Once in a room you could find any of the [[monsters]] or [[items]] in the game, but there are basic features in every room.
 
Once in a room you could find any of the [[monsters]] or [[items]] in the game, but there are basic features in every room.
Line 49: Line 69:
 
Due to the position altering effects of gravity, you tend to have little to do with the ceiling and it is not visible on the map. Sometimes rocks from the ceiling drop on you by traps or other player actions. A [[levitation|levitating]] character can sometimes hit the ceiling. Other features include stairs and certain other [[trap]]s.
 
Due to the position altering effects of gravity, you tend to have little to do with the ceiling and it is not visible on the map. Sometimes rocks from the ceiling drop on you by traps or other player actions. A [[levitation|levitating]] character can sometimes hit the ceiling. Other features include stairs and certain other [[trap]]s.
  
== Lit room ==
+
== References ==
A room is considered as lit when all of it's tiles are visible to the player as long as they are in the line of view.
+
<references />
 
 
The probabilities of a room being lit heavily depend on the dungeon level, the chances of a room '''not''' being lit is : {{refsrc|src/sp_lev.c|1142|version=NetHack 3.6.0|comment=How lit rooms are made?}}
 
 
If the level is above dungeon level 11 :
 
<math>\frac{1}{77}</math>
 
 
 
If the level is below dungeon level 11 :
 
:<math>\frac{\text{dungeon level} - 10}{\text{dungeon level} + 1} + \frac{1}{77}</math>
 
 
 
  
== Special Rooms and other Dungeon Features ==
 
Be sure to make yourself familiar with the various [[special room]]s and [[dungeon features]] found among the levels of NetHack which can make or break your game.
 
 
[[Category:Dungeon features]]
 
[[Category:Dungeon features]]
{{nethack-343}}
+
{{nethack-366}}

Revision as of 21:25, 26 July 2020

Rooms are a feature ubiquitous in NetHack - their purpose is analogous to those of real life: eg "An area separated by walls or partitions from other similar parts of the structure or building in which it is located".

In the Dungeons of Doom, your first room of each level is reached by stairs. Exploring Dungeon of Doom levels, you will encounter a number of rooms by way of corridors.


      ------       --------        -------
     #....$.#######|.......########+....!|                ------    -------
     #|....|      #|.....<|        |>....|              ##..?.(|    |.....|
     #|.....#     #|......|        |....[|                |...!|   #+..$..|
     #|....|#     #|....`.|        ---.-.-               #+....|   #|...@.|
     #------#     #|......|           # #              ###----|-   #|.....|
     # #    #     #---.----           # ###            #    ####   #-------
     #      #     #########           ### #          ###     # #   ####
     #      #           #               # #####      #     ### ###    #
     #      #           #              -.-----+----###     #     #    #
     #      ###         #              |...[......|#       ########   #
     #        #         #              |...........#      ------.-.---#
-----#        ###    #  #              |..........|       |...........#
|....#          # ------.----          ------------       |..........|
|...|           ##+.........|                             |..........|
|$..|             |..........################             ------------
-----             |.).......|                               #
 #                |.%.......|
                  -----------


Generation

This section covers only typical non-special, room-and-corridor levels in the Dungeons of Doom. Rooms also appear in special levels and certain Quest filler levels, but those typically do not have the random generation described below.

On each level, a number of rooms will be generated, and then they will be connected up by corridors and doors. The algorithm for placing rooms makes it difficult to predict how many rooms a level will contain, but most levels contain between 5 and 10 rooms, with occasional appearances of levels with as few as 4 or as many as 12. On these levels, one room may be selected to become a special room.

The following information pertains to an upcoming version (NetHack 3.7.0). If this version is now released, please verify that it is still accurate, then update the page to incorporate this information.

Each level will also generate up to two themed rooms, which can be irregularly shaped or contain interesting contents and terrain.

There tends to be a fixed rather than area-based chance of generating dungeon features, monsters, objects, and traps in each non-special room. Therefore, a level with more rooms will contain more of these things.

Lit rooms

Rooms generate either as lit or unlit, meaning that every square in a room will be lit up or dark. The chance of a room being lit depends solely on the level difficulty, with fewer lit rooms deeper into the dungeon:[1]

Level 9 or above: \frac{76}{77}

Level 10 or below: \frac{76}{77}\cdot\frac{10}{\text{difficulty} + 1}

Strategy

Finding rooms is not always straightforward. The key is to be persistent in searching, and be aware that rooms can be as small as 2x3 and hence tucked into places you would not expect them. Knowing the extent of the Dungeon on your screen helps. A Vault is never accessible by corridor or stairs, and must be reached by some other way.

Once in a room you could find any of the monsters or items in the game, but there are basic features in every room.

The Way In

The non-magical entrances to a room can be by open passageway, door, locked door, stairs or hole. Press o to open a door, c to close it. Apply an unlocking tool to open a locked door (or zap via a spellbook of knock or wand of opening). Without an unlocking method a door needs to be destroyed to gain entry. Options are to kick the door down or to apply an axe or pick axe. (or zap via a spellbook of force bolt or wand of striking)

Caution: destroying a shop door will anger the shopkeeper and probably result in YASD if you don't pay 400 zorkmids for it. A closed shop will have the words "closed for inventory" written in the dust next to it's entrance.

The Floor

The floor in the parts of a room you can see are marked with a . . Dark areas are blank. It is possible for a room to be a swamp, where pools } alternate with . . Although the floor can have a vast variety of things on it, the only feature of the floor itself are stairs, certain traps and any engravings on the ground.


The Walls

The walls are marked by vertical and horizontal lines. Often these can be ASCII characters (eg | and -). At other times these will be drawn lines, complete with corners. Walls have no features, except for doors and secret doors.


The Ceiling

Due to the position altering effects of gravity, you tend to have little to do with the ceiling and it is not visible on the map. Sometimes rocks from the ceiling drop on you by traps or other player actions. A levitating character can sometimes hit the ceiling. Other features include stairs and certain other traps.

References