MAPEDIT(1)Games ManualMAPEDIT(1)

NAME

mapedit — map editor for AgainROM, with an MCP server for agents

SYNOPSIS

starter # pick a game → Map editor
mapedit -assets DIR [-map FILE | -new]
mapedit -assets DIR -mcp stdio
mapedit -assets DIR -mcp http [-mcp-address 127.0.0.1:PORT] [-mcp-new-token]

DESCRIPTION

mapedit ships beside the game in every package. It opens and writes the game's own map files and checks a map against the rules the game applies when it loads one.

MODS

A mod is one folder in mods/ beside the starter: a mod.toml, a Starlark entry script and data files. Tick it in the starter and press Play. A folder packs into one mod-<id>.res. A save remembers which mods were on.

missionsreplace a campaign mission, add guest missions and chains
townstowns, tavern talks, second-game inn talks
itemsnew and changed items and weapons
characterscharacters and guest parties
graphicsbody sheets, weapon bodies, replaced pictures, sounds and texts
spellsspell damage columns
settingsoptions the player sets in the starter

A refused file stops the launch and names the mod, the file and the line. Format: docs/MODS.md.

MCP

With -mcp the editor is an MCP server. Each tool call runs through the visible window: the person and the agent see the same map, and every edit is one step of the same Undo history. Without -mcp nothing listens.

stdiothe client starts the editor; no network listener
httpattach to an open window at 127.0.0.1 only, bearer token; the token and port persist in mapedit-mcp.json in the player profile
-mcp-pacepause between calls, up to one minute, to watch the agent work

tools

windowkey pointer text frame state open save save_as
editnew_map paint add_record add_drop_zone write_trigger and more, one per editor command
readmap records brushes trigger_items check

client configuration

{
  "mcpServers": {
    "againrom-editor": {
      "command": "C:\\Games\\Againrom\\mapedit.exe",
      "args": ["-assets", "C:\\Games\\ROM", "-mcp", "stdio"]
    }
  }
}

a small map from nothing

new_map       {"width":32,"height":32}
paint         {"plane":"terrain","value":<sand>,"radius":4,"cells":[[16,16]]}
add_record    {"kind":"Player","values":{"name":"Rivals"}}
add_record    {"kind":"Unit","x":12,"y":12,"values":{"class":40,"owner":<first>}}
add_drop_zone {"x":13,"y":14}
write_trigger {"name":"Victory","conditions":[…],"actions":[{"item":"a.win"}]}
check         {}
save_as       {"path":"C:\\Maps\\small.alm"}

Full reference: docs/MAPEDIT-MCP.md.

AgainROMMAPEDIT(1)