|
How to design a level
|
A level is defined by several lines specifying the layout with simple ASCII
symbols.
Example (layout of the "Thieves Hideout"):
D:XXXXXXXXXXXXXXX
D:XT...a....X..TX
D:XT........D..TX
D:X.........Xa..X
D:XXXXX.....XXXXX
D:XT..D.........X
D:XTa.X.........X
D:XXXXX.........X
D:X<..D.........X
D:XXXXXXXXXXXXXXX
Every line starts with D (for Dungeon layout) followed by a colon ":".
Then follows the layout of the dungeon row encoded in different letters.
Every letter represents a dungeon feature, monster, or object.
You can define yourself what each letter should represent in front of the
layout definition.
The definition of the letter looks like this:
F:letter:feature:cave_info:monster:object:ego:artifact:trap:special
Every line starting with a F defines a grid that can be used in the
layout of the level. You don't have to write down trailing zero fields
("F:X:61:8:0:0:0:0:0:0" is equivalent to "F:X:61:8").
The different values in the list are:
- letter .. The letter you are assigning to the grid. Everytime you use
this letter in the dungeon layout, all the things from the definition
like monsters, terrain or objects will be placed in the grid.
- feature .. The terrain feature assigned to the grid (look into lib/edit/f_info.txt
for the numbers of the different grids).
- cave_info .. Flags assigned to the grid. Sum of the following values:
1 = grid is already known by the player,
2 = grid is self illuminating,
4 = grid is part of a vault (can't be teleported into),
8 = grid is part of a room (affects lighting up with "Light room" spells).
For example a value of 3 means that the location is already known to the player
and is permanently illuminated.
- monster .. The index of the monster that should be placed in the grid (see lib/edit/r_info).
If this field is 0 then no monster will be created on this position.
A * in this field represents a random monster, if another
value x is added right behind the * then the random monster will be
generated x levels out of deep. For example a value of *9 will try to
create a random monster 9 levels out of deep.
- object .. The index of the object that should be placed in the grid (see lib/edit/k_info).
If this field is 0 then no object will be created on this position.
A * in this field represents a random object, if another
value x is added right behind the * then the random object will be
generated x levels out of deep. For example a value of *5 will try to
create a random object 5 levels out of deep.
- ego .. unused .. leave it 0.
- artifact .. the number of the artifact that should be placed in the grid (see lib/edit/a_info).
If this field is 0 then no artifact will be created on this position.
- trap .. unused .. leave it 0.
- special .. A special value, currently used for the number of the quest
assigned to the grid.
Example from the "Thieves Hideout" quest:
# Lines starting with # are comments
# Permanent wall
F:X:61:8
# Floor with random object
F:T:1:8:0:*
# Floor
F:.:1:8
# Door
F:D:32:8
# up staircase
F:<:6:8
# Floor with novice rogue
F:a:1:8:38
# Dungeon layout
D:XXXXXXXXXXXXXXX
D:XT...a....X..TX
D:XT........D..TX
D:X.........Xa..X
D:XXXXX.....XXXXX
D:XT..D.........X
D:XTa.X.........X
D:XXXXX.........X
D:X<..D.........X
D:XXXXXXXXXXXXXXX