User:Kernelmethod/Sandbox:ZoneBuilders
![]() |
This page is about modding. See the modding overview for an abstract on modding. |
![]() |
This article has information that is missing or not up to par.
Reason: This article is currently a work-in-progress. Please check back later. |
Reason: This article is currently a work-in-progress. Please check back later.
Zone builders are bits of code that allow you to shape the generation of a zone. At the lowest level of detail they are used to place and remove objects from zones; more broadly, they can be used to shape the geometry and encounters that a player runs into in a room.
The game provides a limited suite of generic builders that you may find useful for your mod. In general, if you are making small alterations to a zone you do not need to deal with zone builders. On the other hand, if you're planning to create your own maps with custom procedural generation, you will want to know how to write them by hand.
Using zone builders
When you enter a new zone, the game uses a zone factory (an implementation of IZoneFactory
) to generate your zone, using the zone factory appropriate to the world that you are currently in. It starts with a blank zone and successively triggers whatever builders have been specified for the zone.
Most commonly, these zone builders are specified in Worlds.xml
. For example, here's the specification of MoonStairCell
(used to generate generic Moon Stair zones):
<cell Name="MoonStairCell" Inherits="DefaultJoppaCell" ApplyTo="TerrainMoonStair">
<zone Level="5-9" x="0-2" y="0-2" Name="sky above the Moon Stair" IndefiniteArticle="the" AmbientBed="Sounds/Ambiences/amb_bed_moonstair">
<builder Class="Sky"></builder>
</zone>
<zone Level="10" x="0-2" y="0-2" Name="Moon Stair" IndefiniteArticle="the" AmbientBed="Sounds/Ambiences/amb_bed_moonstair">
<builder Class="MoonStair"></builder>
<builder Class="FactionEncounters" Population="GenericFactionPopulation"></builder>
<music Track="Reflections of Ptoh" />
<postbuilder Class="ZoneTemplate:MoonStair"></postbuilder>
</zone>
<zone Level="11-15" x="0-2" y="0-2" Name="subterranean stair">
<builder Class="MoonStair"></builder>
<builder Class="PossibleCryotube"></builder>
<builder Class="FactionEncounters" Population="GenericFactionPopulation"></builder>
<music Track="Reflections of Ptoh" />
<postbuilder Class="ZoneTemplate:MoonStairCaves"></postbuilder>
</zone>
</cell>
Cell specifications are broken up by X, Y, and Z-levels. Depending on where the player is, they will trigger different builders appropriate to their location.
The other place that zone builders are often added is dynamically during world generation. For example, this is how Oboroqoru, Ape God's lair, goatfolk yurts, and dynamic villages are placed by
JoppaWorldBuilder
. It is possible, but less common, to dynamically apply zone builders in other parts of the game.
Generic, pre-existing zone builders
The game provides a limited suite of zone builders that are sufficiently generic that they can be easily applied to any zone.
Builder name | Description |
---|---|
Connecter | |
FactionEncounters | Adds encounters with legendary creatures sampled from a provided table. |
MapBuilder | This builder loads a map from a .rpm file. A MapBuilder is implicitly to a zone by the <map/> tag in Worlds.xml. For example, the map for the ![]() <map FileName="YdFreehold.rpm" />
|
Music | Adds a music track to a zone. A Music zone builder is implicitly added by the <music/> tag in Worlds.xml. For example, the music for the ![]() <music Track="MoghrayiRemembrance" />
|
SolidEarth | Fills the entire map with ![]() |
StairConnector | |
StairsDown | Adds a set of ![]() |
StairsUp | Adds a set of ![]() |
TileBuilding |
In general, the game's existing zone builders tend to be highly monolithic, so any zone builders not listed above are not recommended for use in creating new types of zones. For new zones modders should favor a more modular architecture.
Strategies for creating ZoneBuilders
![]() |
This article is a stub. You can help Caves of Qud Wiki by expanding it. |
The ZoneBuilderSandbox interface
![]() |
This article is a stub. You can help Caves of Qud Wiki by expanding it. |
Helpful utilities
![]() |
This article is a stub. You can help Caves of Qud Wiki by expanding it. |
Creating encounters with zone templates
![]() |
This article is a stub. You can help Caves of Qud Wiki by expanding it. |
Procedural generation
![]() |
This article is a stub. You can help Caves of Qud Wiki by expanding it. |