Map Editor Documentation

Data Overrides

Per-map changes to units, buildings, items and spells: patching a definition, cloning a new one, and why a map is always self-contained.

Page 9 of 12

The Data module changes what things are for the length of one match. Give a crossbowman more range, make a farm cost nothing, clone the ironguard into a new unit with different armour and a different name. It is the equivalent of WarCraft III's Object Editor.

Patch or clone

Each entry either patches an existing definition or creates a new one.

A patch names an existing id and lists the fields that differ. Everything unlisted stays as it is.

{
  "id": "dwarf_crossbowman",
  "attackRange": 8,
  "cost": { "gold": 90, "lumber": 20, "stone": 0, "oil": 0 }
}

A clone names a base as well, and produces a new definition that inherits everything from the base and then applies the differences. The new id can be placed in the palette and referenced by triggers like any other.

{
  "id": "dwarf_marksman",
  "baseId": "dwarf_crossbowman",
  "name": "Marksman",
  "attackRange": 10,
  "hp": 60
}

The same shape works for units, buildings, items and spells. There is one override path rather than four, which is also why custom item definitions live here rather than in the item placement tools.

Assets

A custom definition may reference any sprite, model, icon or sound the game already ships, and only those. There is no asset upload. An override naming an asset key that does not exist is a publish error rather than a silently invisible unit, because a unit with no sprite renders as a coloured circle and is easy to miss until the map is in front of players.

Naming an existing key is not a limitation in practice: the shipped roster is large, and a clone with a different name, different stats and an existing model reads as a different unit to a player.

When overrides are applied

Overrides install once, immediately after the map is read and before anything spawns. That ordering matters because unit health and damage are baked into components at spawn time, so a unit created before the override installs would carry the old numbers for the rest of the match.

They are a per-match registry that the definition lookups consult, never a change to the shipped definition tables. Those tables are shared by every match in the browser tab and by the campaign, so mutating them would leak your map's balance changes into the next match played in that tab. The registry is cleared when the match ends.

Mods

A mod is a separate document containing only overrides and a library of triggers, with no terrain and no entities. Maps can link one, which is how a set of maps shares a balance patch or a common trigger library without copy-paste.

Publishing a map resolves the link and copies the mod's contents into the map. The published file records which mod and which version it came from as provenance, but it does not depend on it at load time.

That is deliberate. A match sends the whole map as a string with no hash and no dependency resolution, so a live dependency would allow a host running mod version 3 and a joiner running version 2. The symptom is a full-world desync at tick zero with the sync report saying that everything differs, which is about the least useful error a player can be handed. Copying the bytes in removes the possibility at the cost of some duplication, and duplication is cheap.

Independently of that, the map itself is hashed and the hash is checked at match start, so "your copy of this map is not the same as the host's" is a clear message rather than a mysterious desync.

What to change and what to leave

Two habits worth having.

Patch rather than clone when the change is a number. A patched crossbowman still reads as a crossbowman to a player who already knows what one does, and the tech tree, the AI's build orders and the tooltips all keep working.

Clone when the change is an identity. If it has a different role, a different name and a different place in the tech tree, it should be a different unit rather than a familiar one that behaves unexpectedly.

Next: Cutscenes.