Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion toolchain/mapping/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This application is used to process the XML file generated by the CDF Converter
**About the mapping file**

Mapping tool uses an XML file to determine the bindings from source elements to buildings of the world.
Editing this file allows you to use the city metaphors the way you want. Mapping XMLs must follow a specific format.
Editing this file allows you to use the city metaphors the way you want. You may place monster spawners, too. Mapping XMLs must follow a specific format.

~~~ xml
<linking source="method" target="floor">
Expand Down Expand Up @@ -59,12 +59,18 @@ The bindings are used to tell the mapping component which properties of the sour
| flower-ratio | float (0 to 1) | garden | quantity of flowers |
| tree-ratio | float (0 to 1) | garden | quantity of trees |
| mushroom-ratio | float (0 to 1) | garden | quantity of mushrooms |
| monster-count** | integer (0 to 4) | garden | quantity of monster spawners to place
| monster-label** | string | garden | signpost label for monster spawners

**\*supported values:** stone, cobblestone, mossy_stone, sandstone, obsidian, wood, dark_wood, birch_wood, planks, dark_planks, metal, dirt, sand, red_sand, brick, stone_brick, dark_brick, glass, gold, diamond

**\*\*** the monster spawners will be placed along the sides, near the buildings' entrances.

Sometimes a source value doesn't fit the world element we use as target. In this case, we use conversions. At the moment, the following conversions are available:

* `to int`
* `to double`
* `multiply`
* `quantization`
* `normalize`
* `switch`
Expand All @@ -78,4 +84,6 @@ The next example show a quantization conversion.
</conversion>
~~~

The project includes several example mapping files that allow you to quickly build worlds from the input XMLs. The examples demonstrate how you can use different bindings and conversions. They also show how monster spawners can be placed in the generated world.

[sm]: <https://www.sourcemeter.com/>