Teleport region

From NetHackWiki
Jump to navigation Jump to search

A teleport region is a region on a level that controls the possible locations of teleports, and random placement when arriving to a level via hole, trap door, levelport, and branchport. Teleport regions are defined in level definition files using the TELEPORT_REGION directive.

Each teleport region may define two rectangular areas:[1]

  • An destination area, defining the possible locations when arriving to the level by means other than staircase.
  • An exclusion area, defining an area that is invalid for level arrival. Not all teleport regions define an exclusion area.

It is not possible to teleport from inside to outside, or from outside to inside, a teleport region's exclusion area.[2][3][4]

Teleport regions may specify whether they are possible arrival destinations for a particular direction of arrival (upwards, downwards, or both). When arriving at a level via hole, trap door, levelport, or branchport, the hero is randomly placed, and will be subject to the teleport region of their arrival direction.[5][6] Monsters and objects are also subject to the teleport region when arriving.[7][8]

The following special levels contain teleport regions:

A user has suggested improving this page or section as follows:

"Add the missing boundary descriptions"

  • The Castle has two teleport regions, one each for upward and downward arrival. The maze containing the upstair is for downward arrival, while the opposite-side maze is for upward arrival.
  • Medusa's Island, all four versions, in order to place arrival locations near the appropriate stairs. The third version only has a teleport region for downward arrival, while the others have both upward and downward regions.
  • Big Room #10, preventing downwards arrival into the fog maze.
  • Endgame levels, controlling arrival location.
  • Wizard's Tower levels
  • Fake Wizard's Tower levels, excluding the central towers as arrival locations.
  • Valley of the Dead
  • Juiblex's Swamp
  • Orcus-town
  • Asmodeus' Lair
  • Baalzebub's Lair
  • Moloch's Sanctum
  • Fort Ludios: although it is not possible to arrive here by falling or levelport, it is possible to arrive by branchport, and the teleport region will ensure placement in the small room containing the portal.
  • Orctown, to prevent arriving inside the town when being randomly placed on the level.

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

As of commit c4c31ae6, the wine cellar version of Mines' End has a teleport region to force arrival in the room containing the stairs.

References

  1. Jump up include/dungeon.h in NetHack 3.6.7, line 49
  2. Jump up src/teleport.c in NetHack 3.6.7, line 222: tele_jump_ok() prevents teleporting across a dndest or updest exclusion region boundary
  3. Jump up util/lev_comp.y in NetHack 3.6.7, line 1820-L1833: The DES file parser converts the TELEPORT_REGION directive into a LR_TELE, LR_UPTELE, or LR_DOWNTELE value
  4. Jump up src/mkmaze.c in NetHack 3.6.7, line 505-L530: fixup_special() converts the LR_*TELE into updest and dndest regions
  5. Jump up src/dungeon.c in NetHack 3.6.7, line 1214: u_on_rndspot() is called when hero is randomly placed while entering a level
  6. Jump up src/do.c in NetHack 3.6.7, line 1540: u_on_rndspot() call from goto_level()
  7. Jump up src/teleport.c in NetHack 3.6.7, line 1132: monster arrival
  8. Jump up src/teleport.c in NetHack 3.6.7, line 1446: object arrival