generate_map
Create a new RPG Maker MV map file with blank, themed, procedural, template, duplicate, batch, or semantic generation, returning map IDs and event markers.
Instructions
Create a new map file (next free map ID, registered in MapInfos.json; both files written immediately). mode selects the generator: "blank" makes an empty map you paint later (edit_map fill_layer); "themed" generates a simple tile layout for a theme using the tileset's real tiles; "procedural" is the full generator — for themes with matching RTP reference templates (town, dungeon, interior, castle, world, etc.) it CLONES a hand-authored template from the 106 bundled maps (real 3D buildings, walls, furniture), auto-picking the closest size; for themes without templates (beach, swamp, etc.) it generates procedurally (Perlin terrain, BSP dungeons, cellular caves). Same seed + params = same map. Pass templateId to force a specific template, or useTemplate:false to force procedural. 21 themes incl. snow, volcano, sewer, space_interior; "batch" generates several procedural maps in one call from batch specs; "duplicate" copies an existing map (transfer events still point at their ORIGINAL destinations — review them); "template" instantiates one of the 106 bundled reference maps by templateId (list them with get_project_context detail "templates"); "semantic" is the tileset-independent generator — it lays out a MISSION (entrance, key, locked door, treasure, boss, exit, side rooms) as a graph and only then paints it, asking the tileset profile which tile plays each role, so the layout works on ANY tileset including DLC and third-party packs, and the key is always reachable before the door it opens. It returns markers naming the cell of every mission role, which is where to place events next. Run manage_system action "mine_templates" first so the profile comes from tiles this project actually uses; pass a mined templateId (like "mined-3") to re-materialise one of the project OWN maps onto a different tileset instead of generating a new mission. Returns {mapId, ...} — procedural also returns the seed; batch returns all mapIds keyed for edit_map "connect". Fails with an error on unknown theme/template or unwritable files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| loop | No | mode "semantic": add one extra corridor so the map has a loop instead of being a tree (default true) | |
| mode | No | Which generator to use; see the tool description. Default "procedural" | |
| name | No | Internal map name for the editor tree (required for mode "duplicate") | |
| note | No | Free-form note field for plugin metadata | |
| seed | No | procedural/batch: random seed for reproducible output (omit for random; returned in the result) | |
| batch | No | mode "batch" only: one spec per map [{key, name, theme, width, height, tilesetId, seed, parentId}]; key is echoed back to match returned mapIds | |
| rooms | No | mode "semantic": rooms on the critical path (default 5) | |
| theme | No | Required for themed/procedural. themed: forest, dungeon, town, castle, cave, village, swamp, desert, ruins, interior, beach. procedural adds: snow, harbor, volcano, sewer, fortress, magic_forest, magic_interior, space_interior, space_exterior, world | |
| width | No | Map width in tiles (defaults: blank/themed 17, procedural 30; template uses the template's size) | |
| height | No | Map height in tiles (defaults: blank/themed 13, procedural 25) | |
| locked | No | mode "semantic": put a key and a locked door on the path (default true when there are 4+ rooms) | |
| bgmName | No | Audio file from audio/bgm/ to autoplay on entry | |
| parentId | No | Map tree folder to nest the new map under (0 = root) | |
| addEvents | No | procedural: also place themed NPCs/chests/bosses/transfers (default true) | |
| keepProps | No | mode "semantic" with a mined templateId: paint the original decorations even onto a different tileset (they may not exist there) | |
| sideRooms | No | mode "semantic": dead-end rooms hung off the path, the first holding treasure (default 2) | |
| tilesetId | No | Tileset to render with. Defaults to the one matching the theme (Outside=2, Inside=3, Dungeon=4, Overworld=1), so you normally omit it — only set it to override. A mismatched tileset renders the map as garbage | |
| encounters | No | procedural combat themes (dungeon/cave/world/fortress/sewer/volcano): auto-populate the map's random encounters from the project's existing troops so enemies appear while walking. Default true (no-op if the project has no troops yet) | |
| keepEvents | No | mode "template" only: also copy the template's events (default true) | |
| templateId | No | mode "template": bundled template ID. mode "procedural": OPTIONAL — force a specific template ID (from get_project_context detail "templates") instead of auto-picking by theme+size | |
| displayName | No | Location name briefly shown to the player on entry | |
| sourceMapId | No | mode "duplicate" only: existing map ID to copy (unchanged by the operation) | |
| useTemplate | No | procedural: when true (default), clone an RTP template for themes that have one (town, dungeon, interior, etc.) instead of generating procedurally. Set false to force procedural generation even when templates exist | |
| enterableHouses | No | procedural town/village only: also auto-generate an interior map per house with a two-way warp (action-button door outside → interior, walk-on mat inside → back to the street). Default true; the new interior map IDs are returned in interiorMapIds |