Room

From NetHackWiki
Revision as of 21:25, 26 July 2020 by Phol ende wodan (talk | contribs) (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)
Jump to navigation Jump to search

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