Map Editor Documentation

Players & Teams

The per-seat roster, controllers, teams, starting resources, AI settings, map rules, and how to make a one-player map boot.

Page 7 of 12

The Players module is a table with one row per seat. Without it, a custom map's seats are inferred: seat 0 is human, everything else is a computer opponent, everyone is on their own team, and each seat's race is guessed by counting the race prefixes of the entities you placed. That inference is why a map with more goblin critters than dwarf buildings on a seat could hand that seat the wrong faction.

A roster replaces every part of that guess.

The seat table

ColumnWhat it sets
ControllerUser, computer, neutral, hostile, creep, or none
RaceThe seat's faction, explicitly
TeamSeats sharing a team number are allied
ColourThe seat's player colour
ResourcesAbsolute starting gold, lumber, stone and oil
WorkersHow many starting workers, independent of the town hall
TechPer-seat gates on what the seat may build
AIDifficulty, personality, build order, first attack tick, passive

Controller is the interesting one. User is a human slot. Computer is an AI opponent. Neutral is a seat that owns things but takes no actions, which is how you place a village that neither side starts at war with. Hostile is neutral-but-at-war-with-everyone. Creep is the neutral camp owner. None is a seat that exists in the roster but is not filled, which is how you write a map that supports up to eight players but plays fine with three.

The roster is a pure function of the map bytes. No randomness enters it, which is what makes every client in a lockstep match resolve the same seats from the same file.

Teams

Team numbers are the whole model. Two seats with the same team number are allied for vision, for damage and for victory. Alliances can then be changed at runtime by a trigger, which is how a free-for-all that becomes 2v2 halfway through works.

Map rules

Alongside the seat table sits a small set of rules that apply to the whole map:

  • Heroes. Whether the same hero may be taken twice by one player, or twice across the whole match, and whether the normal hero cap applies at all.
  • Standard victory. On by default. Off means the engine never decides who won, and the map's triggers do it.
  • Minimum and maximum players. What the lobby will let people set up.
  • No starting units. Explicit control over whether seats get an automatic town hall and workers.
  • Fog. Normal fog of war, permanently revealed, or no fog.

Making a one-player map work

A single-seat map is legal, and there are exactly two things to get right.

Declare a roster of one seat. Without one, the seat count is floored at two, and a one-spawn map boots with a phantom AI sitting at seat 1 with no base.

Turn standard victory off. This is the one that catches everyone. The win check ends the match as soon as one player is left alive, and on a one-seat map that is true on tick 1. The map declares victory before the player has done anything. The validator refuses to publish a one-seat map with standard victory still on, and that rule exists because the failure is instant, total and completely unexplained if you have not seen it before.

With both set, the map boots with one human seat and ends when a trigger says it ends. Tower Defense and survival maps are the same shape: standardVictory: false, an integer counter for lives, and a trigger that declares defeat when it reaches zero.

AI settings

The AI block per seat is deliberately small.

Difficulty flows through to the existing AI difficulty setting. Personality is normally drawn at random per match; forcing it makes an opponent play predictably, which is what a scripted scenario wants. Because the random draw comes from the match's seeded generator, a forced personality has to be decided from the map bytes before any other draw, or every subsequent random number in the match shifts.

Build order replaces the AI's own opening with an authored list. First attack tick and passive control when, and whether, it attacks at all.

There is no scripted-AI editor and there will not be one. An enemy that does a specific sequence of specific things is a trigger, not an AI, and triggers already express it better. Use the AI settings for an opponent that plays the game, and Triggers for an opponent that performs a scenario.

Spawn points and cameras

A seat's spawn point is its town hall position and, by default, its camera start. Giving a seat an explicit camera position separates the two, so the match can open looking at a lane, a hero or a landmark rather than at a building.

Next: Triggers.