Generate map
generate_mapGenerate a dungeon or cave map procedurally in RPG Maker MV, paint it with a tile profile, and place entrance, exit, and chest markers in an existing or new map.
Instructions
Procedurally generate a dungeon (rooms joined by corridors) or a cave (organic, one connected region) and paint it with a tile profile. Give exactly one of mapId (generate into an existing map, using its size and tileset) or create (make a new map and register it in MapInfos.json). An existing map that has any tile or any event is refused unless overwrite is true; overwrite resets every tile layer and removes all events. seed makes the result repeatable; when omitted a random seed is picked, and the seed used is always returned. The profile (floor, wall, optional wallTop, optional weighted decor) defaults to suggestTileProfile, which works from the tileset's data only: the lowest-numbered walkable A2 kind as floor (else the first walkable A5 tile), the lowest-numbered blocking A4 wall kind as wall with the floor-rule A4 kind above it as wall top (else the first blocking A5 or B tile), and no decor. The profile used and the reasoning are returned as profileUsed and profileNotes. Nothing is written when the profile's floor is not walkable, its wall or wall top does not block movement, a sheet has no image, or the painted map is not fully reachable from the entrance. Markers are empty placeholder events at priority 0 (below characters, so they never block the player) named Entrance, Exit and Chest 1..n, placed on floor cells; chests are random floor cells away from the entrance and exit, chosen so that no chest cuts off any part of the map. markers defaults to {entrance: true, exit: true, chests: 0}. The result lists each marker's eventId and position under markers. Afterwards: call render_map_image to look at the result (consider showPassability); wire doors to other maps with connect_maps using the returned entrance and exit coordinates; fill the chest markers with create_event_from_template or the event tools. A marker occupies its tile: delete it with delete_event before placing a door or chest there, or pass allowOverlap (connect_maps) / allowStack (create_event_from_template) to place on top of it. A dungeon needs a map of at least 14x7 (or 7x14) cells; smaller maps are refused with a clear error (caves are reliable from about 13x13, and MV's default 17x13 never failed in testing; 9x9 to 12x12 and thin maps fail for many seeds, so try another seed or a larger map). Limits: decor is best-effort (sparse, only on open floor), and wall faces are a one-row simplification, since many tilesets draw wall sides two or more tiles tall.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | ||
| seed | No | Same seed, size and options give the same layout; random when omitted | |
| mapId | No | Existing map to generate into (use instead of `create`) | |
| create | No | New map to create (use instead of `mapId`) | |
| markers | No | ||
| profile | No | Tiles to paint with; defaults to a suggestion from the tileset | |
| overwrite | No | Allow replacing a map that already has tiles or events |