File: dgn_comp_gnomehack.6

package info (click to toggle)
gnomehack 1.0.5-1.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 10,256 kB
  • ctags: 12,966
  • sloc: ansic: 119,783; yacc: 2,002; sh: 610; lex: 417; makefile: 397
file content (402 lines) | stat: -rw-r--r-- 7,170 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
.TH DGN_COMP 6 "12 Dec 1995"
.UC 4
.SH NAME
dgn_comp \- GnomeHack dungeon compiler
.SH SYNOPSIS
.B dgn_comp
[
.I file
]
.PP
If no arguments are given, it reads standard input.
.SH DESCRIPTION
.PP
.I Dgn_comp
is a dungeon compiler for GnomeHack version 3.2 and higher.  It
takes a description file as an argument and produces a dungeon "script" 
that is to be loaded by GnomeHack at runtime.
.PP
The purpose of this tool is to provide GnomeHack administrators and
implementors with a convenient way to create a custom dungeon for the
game, without having to recompile the entire world.
.SH GRAMMAR
.PP
DUNGEON: 
.B name
.B bonesmarker
(
.B base
,
.B rand
) [
.B %age
]
.PP
where
.B name
is the dungeon name,
.B bonesmarker
is a letter for marking bones files, (
.B base
, 
.B rand
) is the number of levels, and
.B %age
is its percentage chance of being generated (if absent, 100% chance).

DESCRIPTION:
.B tag
.PP
where
.B tag
is currently one of
.BR HELLISH ,
.BR MAZELIKE ,
or
.BR ROGUELIKE .

ALIGNMENT | LEVALIGN: [
.B lawful
|
.B neutral
|
.B chaotic
|
.B unaligned
]
.PP
gives the alignment of the dungeon/level (default is unaligned).

ENTRY:
.B level
.PP
the dungeon entry point.  The dungeon connection attaches at this
level of the given dungeon.
If the value of
.B level
is negative, the entry level is calculated from the bottom of the
dungeon, with -1 being the last level.
If this line is not present in a dungeon description, the entry level
defaults to 1.

PROTOFILE:
.B name
.PP
the prototypical name for dungeon level files in this dungeon.
For example, the PROTOFILE name for the dungeon
.I Vlad's Tower
is
.IR tower .

LEVEL:
.B name
.B bonesmarker
@ (
.B base
,
.B rand
) [
.B %age
]
.PP
where
.B name
is the level name,
.B bonesmarker
is a letter for marking bones files, (
.B base
, 
.B rand
) is the location and
.B %age
is the generation percentage, as above.

RNDLEVEL:
.B name
.B bonesmarker
@ (
.B base
,
.B rand
)
[
.B %age
]
.B rndlevs
.PP
where
.B name
is the level name,
.B bonesmarker
is a letter for marking bones files, (
.B base
, 
.B rand
) is the location,
.B %age
is the generation percentage, as above, and
.B rndlevs
is the number of similar levels available to choose from.

CHAINLEVEL:
.B name
.B bonesmarker
.B prev_name
+ (
.B base
,
.B rand
) [
.B %age
]
.PP
where
.B name
is the level name,
.B bonesmarker
is a letter for marking bones files,
.B prev_name
is the name of a level defined previously, (
.B base
,
.B rand
) is the
.I offset
from the level being chained from, and
.B %age
is the generation percentage.

RNDCHAINLEVEL:
.B name
.B bonesmarker
.B prev_name
+ (
.B base
,
.B rand
) [
.B %age
]
.B rndlevs
.PP
where
.B name
is the level name,
.B bonesmarker
is a letter for marking bones files,
.B prev_name
is the name of a level defined previously, (
.B base
,
.B rand
) is the
.I offset
from the level being chained from,
.B %age
is the generation percentage, and
.B rndlevs
is the number of similar levels available to choose from.

LEVELDESC:
.B type
.PP
where
.B type
is the level type, (see DESCRIPTION, above). The
.B type
is used to override any pre-set value used to describe the entire dungeon,
for this level only.

BRANCH:
.B name
@ (
.B base
,
.B rand
) [
.B stair
|
.B no_up
|
.B no_down
|
.B portal
] [
.B up
|
.B down
]
.PP
where
.B name
is the name of the dungeon to branch to, and (
.B base
,
.B rand
) is the location of the branch.
The last two optional arguments are
the branch type and branch direction.
The type of a branch can be a two-way stair connection,
a one-way stair connection, or a magic portal.
A one-way stair is described by the types
.B no_up
and
.B no_down
which specify which stair direction is missing.
The default branch type is
.BR stair .
The direction for a stair can be either up or down; direction is not
applicable to portals.  The default direction is
.BR down .

CHAINBRANCH:
.B name
.B prev_name
+ (
.B base
,
.B rand
) [
.B stair
|
.B no_up
|
.B no_down
|
.B portal
] [
.B up
|
.B down
]
.PP
where
.B name
is the name of the dungeon to branch to,
.B prev_name
is the name of a previously defined
.B level
and (
.B base
,
.B rand
) is the
.I offset
from the level being chained from.
The optional branch type and direction are the same as described above.
.SH GENERIC RULES
.PP
Each dungeon must have a unique
.B bonesmarker ,
and each special level must have a
.B bonesmarker
unique within its dungeon (letters may be reused in different dungeons).
If the
.B bonesmarker
has the special value "none", no bones files will be created for that
level or dungeon.
.PP
The value
.B base
may be in the range of 1 to
.B MAXLEVEL
(as defined in
.I global.h
).
.PP
The value
.B rand
may be in the range of -1 to
.BR MAXLEVEL .
.PP
If
.B rand
is -1 it will be replaced with the value (num_dunlevs(dungeon) - base)
during the load process (ie. from here to the end of the dungeon).
.PP
If
.B rand
is 0 the level is located absolutely at
.BR base .
.PP
Branches don't have a probability.  Dungeons do.  If a dungeon fails
to be generated during load, all its levels and branches are skipped.
.PP
No level or branch may be chained from a level with a percentage generation
probability.  This is to prevent non-resolution during the load.
In addition, no branch may be made from a dungeon with a percentage
generation probability for the same reason.
.PP
As a general rule using the dungeon compiler:
.PP
If a dungeon has a
.B protofile
name associated with it
.RI ( eg.
.BR tower )
that file will be used.
.PP
If a special level is present, it will override the above rule and
the appropriate file will be loaded.
.PP
If neither of the above are present, the standard generator will
take over and make a "normal" level.
.PP
A level alignment, if present, will override
the alignment of the dungeon that it exists within.
.SH EXAMPLE
.PP
Here is the current syntax of the dungeon compiler's "language":

.LP
.nf
.ta +8n +8n +8n
#
#	The dungeon description file for the "standard" original
#	3.0 GnomeHack.
#
DUNGEON:	"The Dungeons of Doom" "D" (25, 5)
LEVEL:		"rogue" "none" @ (15, 4)
LEVEL:		"oracle" "none" @ (5, 7)
LEVEL:		"bigroom" "B" @ (12, 3) 15
LEVEL:		"medusa" "none" @ (20, 5)
CHAINLEVEL:	"castle" "medusa" + (1, 4)
CHAINBRANCH:	"Hell" "castle" + (0, 0) no_down
BRANCH:		"The Astral Plane" @ (1, 0) no_down up

DUNGEON:	"Hell" "H" (25, 5)
DESCRIPTION:	mazelike
DESCRIPTION:	hellish
BRANCH:		"Vlad's Tower" @ (13, 5) up
LEVEL:		"wizard" "none" @ (15, 10)
LEVEL:		"fakewiz" "A" @ (5, 5)
LEVEL:		"fakewiz" "B" @ (10, 5)
LEVEL:		"fakewiz" "C" @ (15, 5)
LEVEL:		"fakewiz" "D" @ (20, 5)
LEVEL:		"fakewiz" "E" @ (25, 5)

DUNGEON:	"Vlad's Tower" "T" (3, 0)
PROTOFILE:	"tower"
DESCRIPTION:	mazelike
ENTRY:		-1

DUNGEON:	"The Astral Plane" "A" (1, 0)
DESCRIPTION:	mazelike
PROTOFILE:	"endgame"
.fi
.PP
.I NOTES:
.br
Lines beginning with '#' are considered comments.
.br
A special level must be explicitly aligned.  The alignment of the dungeon
it is in only applies to non-special levels within that dungeon.
.SH AUTHOR
.PP
M. Stephenson (from the level compiler by Jean-Christophe Collet).
.SH "SEE ALSO"
.PP
lev_comp_gnomehack(6), gnomehack(6)
.SH BUGS
.PP
Probably infinite.