Config format
Config files are used when working with the GUI. They should cover most of the API of the C# library. They sometimes even support features that are not directly possible with the API.
Reference
Sections
Bellow you can find a list of all sections that can be used in config files. The order of sections is not important.
roomsRange
(required)
roomsRange:from: # int, requiredto: # int, required
This section describe what rooms should be added to the map description. to must be greater than from - that mean that there must always be at least one room in the map description.
For example:
roomsRange:from: 1to: 10
passages
(required)
passages:- # [int, int]
This section describes passages between pairs of rooms. Map description represents an undirected graph so both [x, y]
and [y, x]
represent the same passage. Every passage can be added at most once.
Rooms together with passages must form a connected graph. That means that there must be a path between every pair of rooms.
For example:
passages:- [1, 2]- [2, 5]
Note: Passages are described as yaml arrays suggesting that there could be more than two elements. But the parser expects every such array to contain exactly two elements and will throw an exception otherwise.
rooms
(optional)
rooms:[array of room numbers]:roomShapes: # roomShapesModel, optional - see below
This section describes properties of individual rooms. It overrides default settings.
For example:
rooms:[8]:roomShapes:-setName: bossRoomsroomDescriptionName: bossRoom1scale: [2,2][1,2,3]:roomShapes:-setName: basicRoomroomDescriptionName: basicRooms
Note: This section is required if defaults are not set.
Typical usage: When all but one room should have common settings. Settings of that one special room can then be overriden in this section. See the different shapes for some rooms documentation.
defaultRoomShapes
(optional)
defaultRoomShapes: # [roomShapesModel - see below]
This section describes default room shapes to be used by all rooms. Values from this section are used only when they are not overriden in the rooms section.
For example:
defaultRoomShapes:-setName: rectanglesroomDescriptionName: squarerotate: false-setName: otherShapes
Note: This section is required to be non empty if not all rooms have their room shapes described in the rooms section.
Typical usage: When there are many rooms that should use the same room shapes. Special rooms can then override defaults in the rooms section.
corridors
(optional)
corridors:enable: # bool, optional, default trueoffsets: # [positive int], required if enabledcorridorShapes: # [roomShapesModel - see below], required if enabled
This section describes whether we want to add corridors between rooms. And if so, it lets us set them up.
- enable: Whether we want to enable corridors.
- offsets: What should be the distance between neighbouring non-corridor rooms. It would be often only a single number - the length of the corridor shape. But it is also possible to have multiple corridor shapes and thus multiple offsets. (See the Corridors tutorial for details about why is this field needed.)
- corridorShapes: Room shapes that we want to use for our corridors.
For example:
corridors:enable: trueoffsets: [1]corridorShapes:-setName: tutorial_corridors
Misc
roomShapesModel
setName: # string, optionalroomDescriptionName: # string, optionalrotate: # bool, optionalprobability: # double, optionalnormalizeProbabilities: # bool, optionalscale: # [positive int, positive int], optional
setName: basicSetroomDescriptionName: squarerotate: falseprobability: 1.2normalizeProbabilities: truescale: [2,2]
- setName: Name of the set when having a room shapes set in a different file. Defaults to custom.
- roomDescriptionName: Name of the room description to be used. Defaults to all room descriptions in the set.
- rotate: Whether room shapes should be rotated. Defaults to true.
- probability: Probability of choosing the room shape when randomly perturbing shapes. Defaults to 1.
- normalizeProbabilities: Whether probabilities should be normalized when rotating shapes. That means that if a room shape has 4 different rotations the probability of each such rotation will be equal to probability / 4. Defaults to true.
- scale: Whether room shapes should be scaled. Defaults to [1,1].