1 LEV_COMP(6) Games Manual LEV_COMP(6)
6 lev_comp - NetHack special levels compiler
9 lev_comp [ -w ] [ files ]
11 If no arguments are given, it reads standard input.
14 Lev_comp is a special level compiler for NetHack version 3.2 and
15 higher. It takes description files as arguments and produces level
16 files that can be loaded by NetHack at runtime.
18 The purpose of this tool is to provide NetHack administrators and
19 implementors with a convenient way for adding special levels to the
20 game, or modifying existing ones, without having to recompile the
23 The -w option causes lev_comp to perform extra checks on the level and
24 display extra warnings, however these warnings are sometimes superflu-
25 ous, so they are not normally displayed.
41 maze_level : maze_def flags lev_init messages regions
44 room_level : level_def flags lev_init messages rreg_init rooms corridors_def
47 level_def : LEVEL_ID ':' string
50 lev_init : /* nothing */
51 | LEV_INIT_ID ':' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled
59 | FLAGS_ID ':' flag_list
62 flag_list : FLAG_TYPE ',' flag_list
66 messages : /* nothing */
70 message : MESSAGE_ID ':' STRING
73 rreg_init : /* nothing */
77 init_rreg : RANDOM_OBJECTS_ID ':' object_list
78 | RANDOM_MONSTERS_ID ':' monster_list
81 rooms : /* Nothing - dummy room for use with INIT_MAP */
89 corridors_def : random_corridors
93 random_corridors: RAND_CORRIDOR_ID
96 corridors : /* nothing */
100 corridor : CORRIDOR_ID ':' corr_spec ',' corr_spec
101 | CORRIDOR_ID ':' corr_spec ',' INTEGER
104 corr_spec : '(' INTEGER ',' DIRECTION ',' door_pos ')'
107 aroom : room_def room_details
108 | subroom_def room_details
111 subroom_def : SUBROOM_ID ':' room_type ',' light_state ',' subroom_pos ',' room_size ',' string roomfill
114 room_def : ROOM_ID ':' room_type ',' light_state ',' room_pos ',' room_align ',' room_size roomfill
117 roomfill : /* nothing */
121 room_pos : '(' INTEGER ',' INTEGER ')'
125 subroom_pos : '(' INTEGER ',' INTEGER ')'
129 room_align : '(' h_justif ',' v_justif ')'
133 room_size : '(' INTEGER ',' INTEGER ')'
137 room_details : /* nothing */
138 | room_details room_detail
141 room_detail : room_name
156 room_name : NAME_ID ':' string
159 room_chance : CHANCE_ID ':' INTEGER
162 room_door : DOOR_ID ':' secret ',' door_state ',' door_wall ',' door_pos
169 door_wall : DIRECTION
177 maze_def : MAZE_ID ':' string ',' filling
188 aregion : map_definition reg_init map_details
191 map_definition : NOMAP_ID
192 | map_geometry MAP_ID
195 map_geometry : GEOMETRY_ID ':' h_justif ',' v_justif
198 h_justif : LEFT_OR_RIGHT
202 v_justif : TOP_OR_BOT
206 reg_init : /* nothing */
210 init_reg : RANDOM_OBJECTS_ID ':' object_list
211 | RANDOM_PLACES_ID ':' place_list
212 | RANDOM_MONSTERS_ID ':' monster_list
216 | object ',' object_list
219 monster_list : monster
220 | monster ',' monster_list
224 | place ',' place_list
227 map_details : /* nothing */
228 | map_details map_detail
231 map_detail : monster_detail
253 monster_detail : MONSTER_ID chance ':' monster_c ',' m_name ',' coordinate
257 monster_infos : /* nothing */
258 | monster_infos monster_info
261 monster_info : ',' string
265 | ',' MON_APPEARANCE string
268 object_detail : OBJECT_ID object_desc
269 | COBJECT_ID object_desc
272 object_desc : chance ':' object_c ',' o_name ',' object_where object_infos
275 object_where : coordinate
279 object_infos : /* nothing */
280 | ',' curse_state ',' monster_id ',' enchantment optional_name
281 | ',' curse_state ',' enchantment optional_name
282 | ',' monster_id ',' enchantment optional_name
285 curse_state : RANDOM_TYPE
292 enchantment : RANDOM_TYPE
296 optional_name : /* nothing */
301 door_detail : DOOR_ID ':' door_state ',' coordinate
304 trap_detail : TRAP_ID chance ':' trap_name ',' coordinate
307 drawbridge_detail: DRAWBRIDGE_ID ':' coordinate ',' DIRECTION ',' door_state
310 mazewalk_detail : MAZEWALK_ID ':' coordinate ',' DIRECTION
313 wallify_detail : WALLIFY_ID
316 ladder_detail : LADDER_ID ':' coordinate ',' UP_OR_DOWN
319 stair_detail : STAIR_ID ':' coordinate ',' UP_OR_DOWN
322 stair_region : STAIR_ID ':' lev_region ',' lev_region ',' UP_OR_DOWN
325 portal_region : PORTAL_ID ':' lev_region ',' lev_region ',' string
328 teleprt_region : TELEPRT_ID ':' lev_region ',' lev_region teleprt_detail
331 branch_region : BRANCH_ID ':' lev_region ',' lev_region
334 teleprt_detail : /* empty */
339 | LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'
342 fountain_detail : FOUNTAIN_ID ':' coordinate
345 sink_detail : SINK_ID ':' coordinate
348 pool_detail : POOL_ID ':' coordinate
351 diggable_detail : NON_DIGGABLE_ID ':' region
354 passwall_detail : NON_PASSWALL_ID ':' region
357 region_detail : REGION_ID ':' region ',' light_state ',' room_type prefilled
360 altar_detail : ALTAR_ID ':' coordinate ',' alignment ',' altar_type
363 gold_detail : GOLD_ID ':' amount ',' coordinate
366 engraving_detail: ENGRAVING_ID ':' coordinate ',' engraving_type ',' string
395 prefilled : /* empty */
397 | ',' FILLING ',' BOOLEAN
405 door_state : DOOR_STATE
409 light_state : LIGHT_STATE
413 alignment : ALIGNMENT
418 altar_type : ALTAR_TYPE
422 p_register : P_REGISTER '[' INTEGER ']'
425 o_register : O_REGISTER '[' INTEGER ']'
428 m_register : M_REGISTER '[' INTEGER ']'
431 a_register : A_REGISTER '[' INTEGER ']'
454 engraving_type : ENGRAVING_TYPE
458 coord : '(' INTEGER ',' INTEGER ')'
461 region : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'
465 Lines beginning with '#' are considered comments.
467 The contents of a "MAP" description of a maze is a rectangle showing
468 the exact level map that should be used for the given part of a maze.
469 Each character in the map corresponds to a location on the screen.
470 Different location types are denoted using different ASCII characters.
471 The following characters are recognized. To give an idea of how these
472 are used, see the EXAMPLE, below. The maximum size of a map is nor-
473 mally 76 columns by 21 rows.
477 '+' a doorway (state is specified in a DOOR declaration)
479 'B' boundary room location (for bounding unwalled irregular regions)
483 'H' a secret corridor
487 '}' a part of a moat or other deep water
490 'W' water (yes, different from a pool)
494 '.' a normal room location (unlit unless lit in a REGION declaration)
498 Here is an example of a description file (a very simple one):
500 MAZE : "fortress", random
501 GEOMETRY : center , center
513 MONSTER: '@', "Wizard of Yendor", (4,4)
514 OBJECT: '"', "Amulet of Yendor", (4,4)
515 # a hell hound flanking the Wiz on a random side
516 RANDOM_PLACES: (4,3), (4,5), (3,4), (5,4)
517 MONSTER: 'd', "hell hound", place[0]
518 # a chest on another random side
519 OBJECT: '(', "chest", place[1]
520 # a sack on a random side, with a diamond and maybe a ruby in it
521 CONTAINER: '(', "sack", place[2]
522 OBJECT: '*', "diamond", contained
523 OBJECT[50%]: '*', "ruby", contained
524 # a random dragon somewhere
525 MONSTER: 'D', random, random
526 # 3 out of 4 chance for a random trap in the EAST end
527 TRAP[75%]: random, (6,4)
528 # an electric eel below the SOUTH end
529 MONSTER: ';', "electric eel", (4,8)
530 # make the walls non-diggable
531 NON_DIGGABLE: (0,0,8,8)
532 TELEPORT_REGION: levregion(0,0,79,20), (0,0,8,8)
534 This example will produce a file named "fortress" that can be inte-
535 grated into one of the numerous mazes of the game.
537 Note especially the final, TELEPORT_REGION specification. This says
538 that level teleports or other non-stairway arrivals on this level can
539 land anywhere on the level except the area of the map. This shows the
540 use of the ``levregion'' prefix allowed in certain region specifica-
541 tions. Normally, regions apply only to the most recent MAP specifica-
542 tion, but when prefixed with ``levregion'', one can refer to any area
543 of the level, regardless of the placement of the current MAP in the
547 Jean-Christophe Collet, David Cohrs.
550 dgn_comp(6), nethack(6)
553 Probably infinite. Most importantly, still needs additional bounds
557 This file is Copyright (C) Kenneth Lorber and was last modified
558 2018/04/25 (version NetHack-3.6.0:1.7). NetHack may be freely redis-
559 tributed. See license for details.
563 NETHACK 25 May 2015 LEV_COMP(6)