1DGN_COMP(6)                      Games Manual                      DGN_COMP(6)
2
3
4

NAME

6       dgn_comp - NetHack dungeon compiler
7

SYNOPSIS

9       dgn_comp [ file ]
10
11       If no arguments are given, it reads standard input.
12

DESCRIPTION

14       Dgn_comp  is a dungeon compiler for NetHack version 3.2 and higher.  It
15       takes a description file as an argument and produces a dungeon "script"
16       that is to be loaded by NetHack at runtime.
17
18       The  purpose  of  this  tool  is  to provide NetHack administrators and
19       implementors with a convenient way to create a custom dungeon  for  the
20       game, without having to recompile the entire world.
21

GRAMMAR

23       DUNGEON: name bonesmarker ( base , rand ) [ %age ]
24
25       where  name  is  the  dungeon name, bonesmarker is a letter for marking
26       bones files, ( base , rand ) is the number of levels, and %age  is  its
27       percentage chance of being generated (if absent, 100% chance).
28
29       DESCRIPTION: tag
30
31       where tag is currently one of HELLISH, MAZELIKE, or ROGUELIKE.
32
33       ALIGNMENT | LEVALIGN: [ lawful | neutral | chaotic | unaligned ]
34
35       gives the alignment of the dungeon/level (default is unaligned).
36
37       ENTRY: level
38
39       the dungeon entry point.  The dungeon connection attaches at this level
40       of the given dungeon.  If the value of level  is  negative,  the  entry
41       level  is  calculated from the bottom of the dungeon, with -1 being the
42       last level.  If this line is not present in a dungeon description,  the
43       entry level defaults to 1.
44
45       PROTOFILE: name
46
47       the  prototypical  name  for  dungeon level files in this dungeon.  For
48       example, the PROTOFILE name for the dungeon Vlad's Tower is tower.
49
50       LEVEL: name bonesmarker @ ( base , rand ) [ %age ]
51
52       where name is the level name, bonesmarker is a letter for marking bones
53       files,  ( base , rand ) is the location and %age is the generation per‐
54       centage, as above.
55
56       RNDLEVEL: name bonesmarker @ ( base , rand ) [ %age ] rndlevs
57
58       where name is the level name, bonesmarker is a letter for marking bones
59       files, ( base , rand ) is the location, %age is the generation percent‐
60       age, as above, and rndlevs is the number of similar levels available to
61       choose from.
62
63       CHAINLEVEL: name bonesmarker prev_name + ( base , rand ) [ %age ]
64
65       where name is the level name, bonesmarker is a letter for marking bones
66       files, prev_name is the name of a level defined previously,  (  base  ,
67       rand ) is the offset from the level being chained from, and %age is the
68       generation percentage.
69
70       RNDCHAINLEVEL: name bonesmarker prev_name + ( base , rand )  [  %age  ]
71       rndlevs
72
73       where name is the level name, bonesmarker is a letter for marking bones
74       files, prev_name is the name of a level defined previously,  (  base  ,
75       rand  )  is  the  offset from the level being chained from, %age is the
76       generation percentage, and rndlevs is  the  number  of  similar  levels
77       available to choose from.
78
79       LEVELDESC: type
80
81       where  type  is  the  level type, (see DESCRIPTION, above). The type is
82       used to override any pre-set value used to describe the entire dungeon,
83       for this level only.
84
85       BRANCH:  name  @ ( base , rand ) [ stair | no_up | no_down | portal ] [
86       up | down ]
87
88       where name is the name of the dungeon to branch to, and ( base , rand )
89       is the location of the branch.  The last two optional arguments are the
90       branch type and branch direction.  The type of a branch can be  a  two-
91       way stair connection, a one-way stair connection, or a magic portal.  A
92       one-way stair is described by the types no_up and no_down which specify
93       which  stair  direction  is missing.  The default branch type is stair.
94       The direction for a stair can be either up or down;  direction  is  not
95       applicable to portals.  The default direction is down.
96
97       CHAINBRANCH: name prev_name + ( base , rand ) [ stair | no_up | no_down
98       | portal ] [ up | down ]
99
100       where name is the name of the dungeon to branch to,  prev_name  is  the
101       name  of  a  previously defined level and ( base , rand ) is the offset
102       from the level being chained from.  The optional branch type and direc‐
103       tion are the same as described above.
104

GENERIC RULES

106       Each  dungeon  must  have a unique bonesmarker , and each special level
107       must have a bonesmarker unique  within  its  dungeon  (letters  may  be
108       reused  in  different  dungeons).   If  the bonesmarker has the special
109       value "none", no bones files will be created for that level or dungeon.
110
111       The value base may be in the range of 1  to  MAXLEVEL  (as  defined  in
112       global.h ).
113
114       The value rand may be in the range of -1 to MAXLEVEL.
115
116       If  rand is -1 it will be replaced with the value (num_dunlevs(dungeon)
117       - base) during the load process (ie. from here to the end of  the  dun‐
118       geon).
119
120       If rand is 0 the level is located absolutely at base.
121
122       Branches don't have a probability.  Dungeons do.  If a dungeon fails to
123       be generated during load, all its levels and branches are skipped.
124
125       No level or branch may be chained from a level with a percentage gener‐
126       ation  probability.  This is to prevent non-resolution during the load.
127       In addition, no branch may be made from a  dungeon  with  a  percentage
128       generation probability for the same reason.
129
130       As a general rule using the dungeon compiler:
131
132       If  a dungeon has a protofile name associated with it (eg.  tower) that
133       file will be used.
134
135       If a special level is present, it will override the above rule and  the
136       appropriate file will be loaded.
137
138       If  neither  of the above are present, the standard generator will take
139       over and make a "normal" level.
140
141       A level alignment, if present, will override the alignment of the  dun‐
142       geon that it exists within.
143

EXAMPLE

145       Here is the current syntax of the dungeon compiler's "language":
146
147
148       #
149       #       The dungeon description file for the "standard" original
150       #       3.0 NetHack.
151       #
152       DUNGEON:        "The Dungeons of Doom" "D" (25, 5)
153       LEVEL:          "rogue" "none" @ (15, 4)
154       LEVEL:          "oracle" "none" @ (5, 7)
155       LEVEL:          "bigroom" "B" @ (12, 3) 15
156       LEVEL:          "medusa" "none" @ (20, 5)
157       CHAINLEVEL:     "castle" "medusa" + (1, 4)
158       CHAINBRANCH:    "Hell" "castle" + (0, 0) no_down
159       BRANCH:         "The Astral Plane" @ (1, 0) no_down up
160
161       DUNGEON:        "Hell" "H" (25, 5)
162       DESCRIPTION:    mazelike
163       DESCRIPTION:    hellish
164       BRANCH:         "Vlad's Tower" @ (13, 5) up
165       LEVEL:          "wizard" "none" @ (15, 10)
166       LEVEL:          "fakewiz" "A" @ (5, 5)
167       LEVEL:          "fakewiz" "B" @ (10, 5)
168       LEVEL:          "fakewiz" "C" @ (15, 5)
169       LEVEL:          "fakewiz" "D" @ (20, 5)
170       LEVEL:          "fakewiz" "E" @ (25, 5)
171
172       DUNGEON:        "Vlad's Tower" "T" (3, 0)
173       PROTOFILE:      "tower"
174       DESCRIPTION:    mazelike
175       ENTRY:          -1
176
177       DUNGEON:        "The Astral Plane" "A" (1, 0)
178       DESCRIPTION:    mazelike
179       PROTOFILE:      "endgame"
180
181       NOTES:
182       Lines beginning with '#' are considered comments.
183       A  special level must be explicitly aligned.  The alignment of the dun‐
184       geon it is in only applies to non-special levels within that dungeon.
185

AUTHOR

187       M. Stephenson (from the level compiler by Jean-Christophe Collet).
188

SEE ALSO

190       lev_comp(6), nethack(6)
191

BUGS

193       Probably infinite.
194
196       This file is  Copyright  (C)  Kenneth  Lorber  and  was  last  modified
197       2018/04/25  (version  NetHack-3.6.0:1.6).  NetHack may be freely redis‐
198       tributed.  See license for details.
199
200
201
202NETHACK                           25 May 2015                      DGN_COMP(6)
Impressum