TMX Format
TMX (Tile Map XML) is a standard file format for tilemaps used by many tilemap editors and game engines.
Overview
- TMX is an XML-based format designed to store tilemap data.
- It supports layers, tilesets, properties, and object groups.
- Widely supported by tools like Tiled Map Editor.
Acid compiles the PCG-related code into TMX, making outputs compatible with external tools and game engines.
Structure Generated
- Tile layers containing tile indexes matching the declared tiles.
- Map dimensions defined by
map_dims
or the rows/columns specification. - Optional horizontal mirroring or other transformations.
Example Output
Given an input:
rows {
1 * rock -> 20 * path
3 * wall -> 17 * grass
}
xrows !mirror {
4 * rock -> 4 * grass
}
The Acid interpreter produces a TMX file encoding the tile sequence and mirroring instructions.
Benefits of TMX
- Compatibility with standard tools.
- Easy visualization and editing post-generation.
- Interoperability with game engines supporting TMX import.