Overview Screenshots Downloads News Documentation Thanks Simugraph Home Page

H-World - Level configuration

Level configuration

Each level in H-World is described by a level template. This means the structure of the world is described by the links between the level templates. The levels itself are created with help of a random number generator following the outline of the template. Thus different generated levels of the same type, even of the same template will be different in the game.

There is only one exception: file based levels can be created with a 100% predefined layout and contents. But even they allow randomization of their contents if wanted.

The level templates are sets of property definitions like described in the Item and monster properties documentation.

Required properties are marked with (*). All other properties are optional.

Basic level properties

A few properties are common in all level templates, regardless of the level type. They are listed below.

Property Description
type (string) Level type. Please read the following section to learn which level types are available. (*)
ILevel (int) Item generation base level.
IRange (int) Item generation level range: actual_level = ILevel + random(IRange). See also the ILevel attribute of items and monsters.
magic.max (int) Maximum number of special attributes that an item that is generated for this level will get.
magic.chance (int) This is the chance for an item to get a special attribute, given in percent. If the level allows items with several magic attributes, then aftet getting one attribute, the roll is done again to see if another attribute can be added. This is repeated until the maximum number of attributes is reached, or one of the rolls fails.
IRange (int) Item generation level range: actual_level = ILevel + random(IRange). See also the ILevel attribute of items and monsters.
unseen (int) Image number to use for unseen squares. (*)
floor (int) Image number to use for default floor squares. (*)
exits (int) Number of exits to other levels
exit[0].level (string) Name of the level template for the level lead to by the first exits. I.e. ./data/cave001.props
exit[0].image (int) Image to use for the exit.
monsters (int) Number of monster types to place in this level.
monster[0].type (string) Section name of the first monster type (must be in beings.sects)
monster[0].chance (int) Chance in x/100000 per square to generate this monster type
items = 3 Number of item types to place in this level.
item[0].type (string) Section name of the first monster type (must be in beings.sects)
item[0].chance (int) Chance in x/100000 per square to generate this item type
traps = 2 Number of trap types to configure. Set to 0 to prevent creation of traps on this level
trap[0].type = 0 First trap type. See [module]/scripts/traps.lua for a list of trap types and effects. Actually the trap type is just handed as a parameter to trap_triggered(). Thus it is easy to define new trap types by extending the trap_triggered() function.
trap[0].chance = 5 Chance to create this trap type. Given in n/10000 chance per square.

Forest level type

The forest level type generates outdoor levels with forests and plains.

More details

House level type

The forest level type generates indoor levels with rooms and corridors. It is not very advanced yet, and creates only simple room levels. H-World uses this to generate the castle and temple levels.

Map examples (images)
More details

Cave level type

The cave level type generates indoor levels with irregularly shaped caves. It is not very advanced yet, and creates only very simple caves.

Map examples (images)
More details

Rooms 'n corridors level type

Rooms and corridor levels are unerground levels, consisting of a set of rooms that are linked by corridors.

Map examples (images)
More details

External (file based) level type

This level generator reads a level layout from a text file. It is useful for providing hardcoded, user-defined levels.

More details

Room templates, e.g. used by the "house" level type, use the same syntax as file based levels. In fact room templates are file based levels describing exactly one room.


Hansjörg Malthaner
Last modified: Mon Sep 13 17:13:42 CEST 2004