Difference between revisions of "Dungeon.def format"

From NetHackWiki
Jump to navigation Jump to search
m (RNDLEVEL: - see also LEVEL, not just MAZE)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
'''dungeon.def''' is the file that describes how the dungeon branches and what [[special level]]s are used and where. It is compiled into a binary file by [[dgn_comp]]
+
{{DISPLAYTITLE:dungeon.def format}}
 +
'''[[dungeon.def]]''' is the file that describes how the dungeon branches and what [[special level]]s are used and where. It is compiled into a binary file by [[dgn_comp]]
 +
 
 +
{{Float right|__TOC__}}
  
 
===Comments===
 
===Comments===
Line 16: Line 19:
  
 
*<tt>"name"</tt> is the name of the dungeon
 
*<tt>"name"</tt> is the name of the dungeon
*<tt>"bonetag"</tt> is the character used in file names when a bones file is created in this dungeon.
+
*<tt>"bonetag"</tt> is the character used in file names when a [[bones]] file is created in this dungeon, or <tt>"none"</tt>, in which case no bones will be created in the dungeon.
 
*<tt>base</tt> and <tt>range</tt> define the dungeon depth.
 
*<tt>base</tt> and <tt>range</tt> define the dungeon depth.
  
Line 52: Line 55:
 
  ALIGNMENT: flag
 
  ALIGNMENT: flag
  
Sets the alignment for the previously defined DUNGEON. Only one of these per dungeon allowed.
+
Sets the alignment for the previously defined {{sa|DUNGEON}}. Only one of these per dungeon allowed.
  
 
flag is one of the following flags:
 
flag is one of the following flags:
*<tt>unaligned</tt> (or it's synonym <tt>noalign</tt>)
+
*<tt>unaligned</tt> (or its synonym <tt>noalign</tt>)
 
*<tt>lawful</tt>
 
*<tt>lawful</tt>
 
*<tt>neutral</tt>
 
*<tt>neutral</tt>
Line 76: Line 79:
 
  BRANCH: "name" @ (base, range) type dir
 
  BRANCH: "name" @ (base, range) type dir
  
Adds a branch to the previously defined DUNGEON.
+
Adds a branch to the previously defined {{sa|DUNGEON}}.
  
 
*<tt>"name"</tt> is the name of the branch. You must later define a DUNGEON with the same name.
 
*<tt>"name"</tt> is the name of the branch. You must later define a DUNGEON with the same name.
Line 96: Line 99:
 
  CHAINBRANCH: "name" "chain" + (base, range) type dir
 
  CHAINBRANCH: "name" "chain" + (base, range) type dir
  
Adds a branch to the previously defined DUNGEON. This is similar to BRANCH, except the depth depends where a LEVEL occurs in the previously defined DUNGEON.
+
Adds a branch to the previously defined {{sa|DUNGEON}}. This is similar to {{sa|BRANCH}}, except the depth depends where a {{sa|LEVEL}} occurs in the previously defined DUNGEON.
  
 
*<tt>name</tt> is the name of the branch. You must later define a DUNGEON with the same name.
 
*<tt>name</tt> is the name of the branch. You must later define a DUNGEON with the same name.
 
*<tt>chain</tt> is a name of a previously defined LEVEL in this DUNGEON.
 
*<tt>chain</tt> is a name of a previously defined LEVEL in this DUNGEON.
 
*<tt>base</tt> and <tt>range</tt> define the branch depth, relative to <tt>chain</tt>.
 
*<tt>base</tt> and <tt>range</tt> define the branch depth, relative to <tt>chain</tt>.
*<tt>type</tt> and <tt>dir</tt> as in [[#BRANCH|BRANCH]]
+
*<tt>type</tt> and <tt>dir</tt> as in {{sa|BRANCH}}
  
 
Example:
 
Example:
Line 110: Line 113:
 
  LEVEL: "name" "bonetag" @ (base, range) chance
 
  LEVEL: "name" "bonetag" @ (base, range) chance
  
Adds a special level to the previously defined DUNGEON. See also RNDLEVEL.
+
Adds a special level to the previously defined {{sa|DUNGEON}}. See also {{sa|RNDLEVEL}}.
  
*<tt>name</tt> is the name of this special level, and is used for loading the special levels from disk. You must define a special des-level with the same name.
+
*<tt>name</tt> is the name of this special level, and is used for loading the special levels from disk. You must define a special [[Des-file format|des-level]] with the same name.
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a bones. This should be unique among all special levels.
+
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a [[bones]], or <tt>"none"</tt>, in which case no bones will be created in the level. This should be unique among all special levels in this dungeon.
 
*<tt>base</tt> and <tt>range</tt> define the branch depth
 
*<tt>base</tt> and <tt>range</tt> define the branch depth
 
*<tt>chance</tt> is optional, gives the % chance of this level existing in any given game.
 
*<tt>chance</tt> is optional, gives the % chance of this level existing in any given game.
Line 124: Line 127:
 
  RNDLEVEL: "name" "bonetag" @ (base, range) chance nlevels
 
  RNDLEVEL: "name" "bonetag" @ (base, range) chance nlevels
  
Adds a special level to the previously defined DUNGEON, with several variants for the des-level. See also LEVEL.
+
Adds a special level to the previously defined {{sa|DUNGEON}}, with several variants for the des-level. See also {{sa|LEVEL}}.
  
*<tt>name</tt> is the name of this special level. used for loading the special levels from disk. The name format will be <tt>name-num</tt>, where <tt>num</tt> is the variant of the level to be loaded. For example, <tt>bigrm-3</tt>. See also [[Des-file format#MAZE|MAZE]] or [[Des-file format#LEVEL|LEVEL]] in the [[Des-file format]] article.
+
*<tt>name</tt> is the name of this special level, used for loading the special levels from disk. The name format will be <tt>name-num</tt>, where <tt>num</tt> is the variant of the level to be loaded. For example, <tt>bigrm-3</tt>. See also [[Des-file format#MAZE|MAZE]] or [[Des-file format#LEVEL|LEVEL]] in the [[Des-file format]] article.
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a bones. This should be unique among all special levels.
+
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a [[bones]], or <tt>"none"</tt>, in which case no bones will be created in the dungeon. This should be unique among all special levels in this dungeon.
 
*<tt>base</tt> and <tt>range</tt> define the branch depth
 
*<tt>base</tt> and <tt>range</tt> define the branch depth
 
*<tt>chance</tt> is optional, gives the % chance of this level existing in any given game.
 
*<tt>chance</tt> is optional, gives the % chance of this level existing in any given game.
*<tt>nlevels</tt> is the number of different special level layout version for this particular level.
+
*<tt>nlevels</tt> is the number of different special level layout versions or variants for this particular level.
  
 
Example:
 
Example:
Line 139: Line 142:
 
  LEVELDESC: flag
 
  LEVELDESC: flag
  
Defines flags for a previously defined LEVEL or RNDLEVEL.
+
Defines flags for a previously defined {{sa|LEVEL}} or {{sa|RNDLEVEL}}.
  
<tt>flag</tt> is the same as [[#DESCRIPTION|DESCRIPTION]] has.
+
<tt>flag</tt> is the same as {{sa|DESCRIPTION}} has.
  
 
Example:
 
Example:
Line 150: Line 153:
 
  LEVALIGN: flag
 
  LEVALIGN: flag
  
Defines alignment of a previously defined LEVEL or RNDLEVEL.
+
Defines alignment of a previously defined {{sa|LEVEL}} or {{sa|RNDLEVEL}}.
  
<tt>flag</tt> is the same as [[#ALIGNMENT|ALIGNMENT]] has.
+
<tt>flag</tt> is the same as {{sa|ALIGNMENT}} has.
  
 
Example:
 
Example:
Line 161: Line 164:
 
  CHAINLEVEL: "name" "bonetag" "chain" + (base, range) chance
 
  CHAINLEVEL: "name" "bonetag" "chain" + (base, range) chance
  
Adds a special level to the previously defined DUNGEON. This is similar to LEVEL, except the depth depends where another LEVEL occurs in the previously defined DUNGEON.
+
Adds a special level to the previously defined {{sa|DUNGEON}}. This is similar to {{sa|LEVEL}}, except the depth depends where another LEVEL occurs in the previously defined DUNGEON.
  
 
*<tt>name</tt> is the name of this special level. used for loading the special levels from disk.
 
*<tt>name</tt> is the name of this special level. used for loading the special levels from disk.
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a bones. This should be unique among all special levels. Can also be <tt>"none"</tt>.
+
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a [[bones]], or <tt>"none"</tt>, in which case no bones will be created in the level. This should be unique among all special levels in this dungeon.
 
*<tt>chain</tt> is a name of a previously defined LEVEL in this DUNGEON.
 
*<tt>chain</tt> is a name of a previously defined LEVEL in this DUNGEON.
 
*<tt>base</tt> and <tt>range</tt> define the level depth, relative to <tt>chain</tt>.
 
*<tt>base</tt> and <tt>range</tt> define the level depth, relative to <tt>chain</tt>.
Line 176: Line 179:
 
  RNDCHLEVEL: "name" "bonetag" "chain" + (base, range) chance nlevels
 
  RNDCHLEVEL: "name" "bonetag" "chain" + (base, range) chance nlevels
  
Adds a special level to the previously defined DUNGEON, with several variants for the des-level. This is similar to CHAINLEVEL, except the depth depends where another LEVEL occurs in the previously defined DUNGEON.
+
Adds a special level to the previously defined {{sa|DUNGEON}}, with several variants for the des-level. This is similar to {{sa|CHAINLEVEL}}, except the depth depends where another LEVEL occurs in the previously defined DUNGEON.
  
*<tt>name</tt> is the name of this special level. used for loading the special levels from disk. The name format will be <tt>name-num</tt>, where <tt>num</tt> is the variant of the level to be loaded. For example, <tt>bigrm-3</tt>. See also MAZE in [[Des-file format#MAZE|Des-file format]].
+
*<tt>name</tt> is the name of this special level. used for loading the special levels from disk. The name format will be <tt>name-num</tt>, where <tt>num</tt> is the variant of the level to be loaded. For example, <tt>bigrm-3</tt>. See also MAZE in [[Des-file format#MAZE|MAZE]] or [[Des-file format#LEVEL|LEVEL]] in the [[Des-file format]] article.
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a bones. This should be unique among all special levels. Can also be <tt>"none"</tt>
+
*<tt>bonetag</tt> is a single character used in a filename when this level leaves a [[bones]], or <tt>"none"</tt>, in which case no bones will be created in the level. This should be unique among all special levels in this dungeon.
 
*<tt>chain</tt> is a name of a previously defined LEVEL in this DUNGEON.
 
*<tt>chain</tt> is a name of a previously defined LEVEL in this DUNGEON.
 
*<tt>base</tt> and <tt>range</tt> define the level depth, relative to <tt>chain</tt>.
 
*<tt>base</tt> and <tt>range</tt> define the level depth, relative to <tt>chain</tt>.
Line 186: Line 189:
  
 
[[Category:Annotations]]
 
[[Category:Annotations]]
 +
{{nethack-343}}

Latest revision as of 02:32, 19 December 2015

dungeon.def is the file that describes how the dungeon branches and what special levels are used and where. It is compiled into a binary file by dgn_comp

Comments

All lines beginning with # are comments and are ignored by the compiler.

Example:

# This is a comment.

DUNGEON

DUNGEON: "name" "bonetag" (base, range)

This is used to define a new dungeon.

  • "name" is the name of the dungeon
  • "bonetag" is the character used in file names when a bones file is created in this dungeon, or "none", in which case no bones will be created in the dungeon.
  • base and range define the dungeon depth.

You can also add an optional integer, which is the chance of this dungeon being generated.

Example:

DUNGEON: "The Dungeons of Doom" "D" (25, 5)

ENTRY

ENTRY: lvl

Set the entry level for this dungeon. 0 means from the top, negative number means the level from the bottom (-1 is the bottom level), greater than 0 means the level number from the top of the dungeon.

Example:

ENTRY: -1

DESCRIPTION

DESCRIPTION: flag

Sets a flag for the previously defined DUNGEON. You can use as many DESCRIPTION lines as you want.

flag is one of the following flags:

  • town
  • hellish
  • mazelike
  • roguelike

Example:

DESCRIPTION: mazelike

ALIGNMENT

ALIGNMENT: flag

Sets the alignment for the previously defined DUNGEON. Only one of these per dungeon allowed.

flag is one of the following flags:

  • unaligned (or its synonym noalign)
  • lawful
  • neutral
  • chaotic

Example:

ALIGNMENT: lawful

PROTOFILE

PROTOFILE: "str"

Sets the special level prototype filename. This is used when loading the lev-file from disk. See MAZE in Des-file format.

Example:

PROTOFILE: "tower"

BRANCH

BRANCH: "name" @ (base, range) type dir

Adds a branch to the previously defined DUNGEON.

  • "name" is the name of the branch. You must later define a DUNGEON with the same name.
  • base and range define the depth where the branch occurs.
  • type is optional (defaults to stair), or one of the following:
    • stair, a two-way stair
    • no_up, no up staircase
    • no_down, no down staircase
    • portal, portal connection
  • dir is optional (defaults to down), or is one of the following:
    • up
    • down

Example:

BRANCH: "Vlad's Tower" @ (9, 5) up

CHAINBRANCH

CHAINBRANCH: "name" "chain" + (base, range) type dir

Adds a branch to the previously defined DUNGEON. This is similar to BRANCH, except the depth depends where a LEVEL occurs in the previously defined DUNGEON.

  • name is the name of the branch. You must later define a DUNGEON with the same name.
  • chain is a name of a previously defined LEVEL in this DUNGEON.
  • base and range define the branch depth, relative to chain.
  • type and dir as in BRANCH

Example:

CHAINBRANCH: "Gehennom" "castle" + (0, 0) no_down

LEVEL

LEVEL: "name" "bonetag" @ (base, range) chance

Adds a special level to the previously defined DUNGEON. See also RNDLEVEL.

  • name is the name of this special level, and is used for loading the special levels from disk. You must define a special des-level with the same name.
  • bonetag is a single character used in a filename when this level leaves a bones, or "none", in which case no bones will be created in the level. This should be unique among all special levels in this dungeon.
  • base and range define the branch depth
  • chance is optional, gives the % chance of this level existing in any given game.

Example:

LEVEL: "oracle" "O" @ (5, 5)

RNDLEVEL

RNDLEVEL: "name" "bonetag" @ (base, range) chance nlevels

Adds a special level to the previously defined DUNGEON, with several variants for the des-level. See also LEVEL.

  • name is the name of this special level, used for loading the special levels from disk. The name format will be name-num, where num is the variant of the level to be loaded. For example, bigrm-3. See also MAZE or LEVEL in the Des-file format article.
  • bonetag is a single character used in a filename when this level leaves a bones, or "none", in which case no bones will be created in the dungeon. This should be unique among all special levels in this dungeon.
  • base and range define the branch depth
  • chance is optional, gives the % chance of this level existing in any given game.
  • nlevels is the number of different special level layout versions or variants for this particular level.

Example:

RNDLEVEL: "bigrm" "B" @ (10, 3) 40 5

LEVELDESC

LEVELDESC: flag

Defines flags for a previously defined LEVEL or RNDLEVEL.

flag is the same as DESCRIPTION has.

Example:

LEVELDESC: town

LEVALIGN

LEVALIGN: flag

Defines alignment of a previously defined LEVEL or RNDLEVEL.

flag is the same as ALIGNMENT has.

Example:

LEVALIGN: chaotic

CHAINLEVEL

CHAINLEVEL: "name" "bonetag" "chain" + (base, range) chance

Adds a special level to the previously defined DUNGEON. This is similar to LEVEL, except the depth depends where another LEVEL occurs in the previously defined DUNGEON.

  • name is the name of this special level. used for loading the special levels from disk.
  • bonetag is a single character used in a filename when this level leaves a bones, or "none", in which case no bones will be created in the level. This should be unique among all special levels in this dungeon.
  • chain is a name of a previously defined LEVEL in this DUNGEON.
  • base and range define the level depth, relative to chain.
  • chance is optional, gives the % chance of this level existing in any given game.

Example:

CHAINLEVEL: "wizard2" "X" "wizard1" + (1, 0)

RNDCHLEVEL

RNDCHLEVEL: "name" "bonetag" "chain" + (base, range) chance nlevels

Adds a special level to the previously defined DUNGEON, with several variants for the des-level. This is similar to CHAINLEVEL, except the depth depends where another LEVEL occurs in the previously defined DUNGEON.

  • name is the name of this special level. used for loading the special levels from disk. The name format will be name-num, where num is the variant of the level to be loaded. For example, bigrm-3. See also MAZE in MAZE or LEVEL in the Des-file format article.
  • bonetag is a single character used in a filename when this level leaves a bones, or "none", in which case no bones will be created in the level. This should be unique among all special levels in this dungeon.
  • chain is a name of a previously defined LEVEL in this DUNGEON.
  • base and range define the level depth, relative to chain.
  • chance is optional, gives the % chance of this level existing in any given game.
  • nlevels is the number of different special level layout version for this particular level.

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.