Modding:Maps

From Caves of Qud Wiki
Revision as of 07:19, 21 April 2020 by Gnarf (talk | contribs) (adding some information on editing the world map and what Load="Merge" exactly does)
Jump to navigation Jump to search
This page is about modding. See the modding overview for an abstract on modding.
This page is about modding. See the modding overview for an abstract on modding.


.rpm files

RPM files are stores of static map content. They are a simple XML format. You can create your own RPM files, or "patch" the ones shipped with the game in your mod folders by using the same filename for the .rpm file.

The in-game map editor loads and saves files in the .rpm XML format. It supports saving complete maps with all of the 80x25 cells included in the XML.

RPM files can represent a particular zone (such as the Grit Gate complex), but an RPM file is also used for the world map (currently JoppaWorldNew4.rpm), which is generated in similar fashion to other zones.

Adding something to an existing map

In the following example only a single cell is defined in the rpm. It also defines Load="Merge" on the map which tells the map reader to append the content to the cell without deleting what is already there (a floor tile, or other object for instance). You name the rpm file the same as the version from StreamingAssets/Base/.

Example Joppa.rpm from Two Ctesiphus tutorial mod

<?xml version="1.0" encoding="utf-8"?>
<Map
  Width="80"
  Height="25" Load="Merge">
  <cell
    X="41"
    Y="7">
    <object Name="Ctesiphus"></object>
  </cell>
</Map>

Replace a Terrain Tile in World Map

This example also only defines the one cell it wants to replace, however does not use the Load="Merge option. The world map expects only one terrian object per map cell, and not using Load="Merge" tells the game to replace the contents of that cell.

Example JoppaWorldNew4.rpm to replace a terrain tile

<?xml version="1.0" encoding="utf-8"?>
<Map
  Width="80"
  Hight="25">
  <cell
    X="12"
    Y="22">
    <object Name="My_TerrainEastJoppa"></object>
  </cell>
</Map>

My_TerrainEastJoppa would be an object you define in the object blueprints to render the cell however you want, and you can then define your own "sub zone" within Worlds.xml attached to that Terrain tile via <cell ApplyTo="My_TerrainEastJoppa"%gt

Using the Map Editor

The map editor is available as a utility from the main menu in-game when the Overlay UI is enabled.

  1. Start Qud
  2. Enable the Overlay UI (Options > Overlay UI > Enable overlay user interface elements)
  3. Enable mouse input (Options > Overlay UI > Allow mouse input)
    • The map editor won't work if you skip this step
  4. Return to the main menu.
  5. Click Modding Utilities in the lower right corner.
  6. Click Map Editor.
  7. Click New Map to start a new map design, or click Load Map to load an existing RPM file (there are some in the game directory if you want to open one to look at it as an example)

You can:

  • Use the search bar in the upper right corner to filter object blueprints for selection, and select items in the sidebar.
  • Ctrl+click to add the selected item to the map
  • Alt+click to select an existing item on the map
  • Click and drag to move the map around.

Examples

The Brainwraith mod (Nexus, Steam) is an example of a mod that makes extensive use of map and world modifications. It modifies the world map and also creates several new RPM-based zones.