BuildingMaps
From The Battle for Wesnoth Wiki
Wesnoth map data format
Map data is used to represent maps in Wesnoth. The encoding for maps has a specific format:
- A map data file consists of any number of lines, each with the same number of characters.
- Each character must be either a letter specified in a letter key specifying a terrain (see TerrainLettersWML), or a digit.
- When the file is interpreted, each letter will be replaced by the terrain it refers to.
- Each nonzero digit n where n = 1, 2, 3, ... will be replaced by keep, with the leader of side n placed on the keep.
Since text file tiles are squares while game tiles are hexes, some tiles must be shifted. Tiles in even-numbered columns are shifted down 1/2 of a tile. For example, to have a road of connected dirt ('r') tiles, the map data would look like this:
gggrr grrgg rgggg
Map data is used in three ways.
- It is used as an input to the key map_data (see ScenarioWML).
- Files consisting entirely of map data can be read and edited easily by the WesnothMapEditor.
- Files in the folder ~wesnoth/editor/maps/ which consist entirely of map data can be played in multiplayer as user maps.