- Knownframe
- battlemap-mcp
- Docs
- v1.3.1
- Walls, rooms and floors
Walls, rooms and floors
Generated from battlemap-mcp v1.3.1. Your assistant gets these same names, descriptions and parameters from the server when it connects; the server is named battlemap, so a client may show a tool as battlemap:ping or similar.
build_room
Build a room in one call: a looped wall AND a matching floor on the SAME path.
Because the wall and floor share the boundary, the floor meets the wall exactly (no gap) — like the UI's combined wall+floor trace. Provide ONE of: rect or points.
centerline; the wall covers the floor's outer edge).
Returns { wall_id, floor_id?, points }.
| Parameter | Type | Default | Description |
|---|---|---|---|
rect | number[] | null | null | [x, y, w, h] axis-aligned rectangle, or |
points | number[][] | null | null | [[x,y], ...] a polygon (>= 3 points), all in woxels (the wall |
wall_asset | string | "" | a Walls asset path (omit for the default). |
floor | string | "pattern" | 'pattern' (a tiled floor; floor_asset + floor_category), 'terrain' (paints terrain into floor_slot; floor_asset assigns the slot texture), or 'none' for walls only. |
floor_asset | string | "" | the floor texture. |
floor_category | string | "Simple Tiles" | pattern bank for floor= 'pattern' (e.g. 'Simple Tiles', 'Smart Tiles', 'Materials'). |
floor_color | string | "" | optional '#rrggbb' tint (pattern floors). |
floor_slot | integer | 1 | |
wall_type | integer | 0 | 0=auto, 1=manual, 2=cave. |
wall_joint | integer | 1 | 0=sharp, 1=bevel, 2=round. |
snap | string | "" | 'none', 'grid' or 'auto'; see get_snap_settings. A rect gets all four corners on the grid (on hex, the far one may shift). |
draw_wall
Draw a wall through a list of [x, y] woxel points. Returns the new element id.
| Parameter | Type | Default | Description |
|---|---|---|---|
points required | number[][] | ||
asset | string | "" | optional Walls asset path. |
loop | boolean | false | close into a loop (e.g. a room). |
shadow | boolean | true | |
type | integer | 0 | 0=auto, 1=manual, 2=cave. |
joint | integer | 1 | 0=sharp, 1=bevel, 2=round. |
color | string | "" | |
snap | string | "" | 'none', 'grid' or 'auto'; see get_snap_settings. |
merge_walls
Join two matching open walls sharing one endpoint, in ONE undo step.
The first ID survives; the second is removed. Mounted doors/windows retain their IDs, appearance and positions. Returns id, removed_ids, portal_ids, point_count. Supports automatic/manual wall runs and corners. Both walls must be on the current level with matching styles. Rejects loops, cave walls, T-junctions, overlaps and self-intersections before changing the map. Each input wall may contain up to 512 points. Undo restores both original walls and portal attachments; switch to their level before undo/redo.
| Parameter | Type | Default | Description |
|---|---|---|---|
ids required | integer[] |
add_portal
Add a door/window portal at a woxel position. Returns the new element id.
By default the portal MOUNTS on the nearest wall and the wall cuts a gap around it (like placing a door by hand).
| Parameter | Type | Default | Description |
|---|---|---|---|
asset required | string | ||
x | number | null | null | |
y | number | null | null | |
closed | boolean | null | null | |
radius | number | 64 | |
mount | string | "wall" | |
snap_max | number | 256 | |
flip | boolean | false | |
fallback_free | boolean | true | |
rotation | number | 0 | |
snap | string | "" |
add_roof
Add a roof from its RIDGE LINE. Returns the new element id.
IMPORTANT: points is the roof's ridge (the peak line), NOT a footprint to trace. DD builds a complete, self-closing roof that slopes down width woxels perpendicular to each side of the ridge, with hips/gables off the ridge ends. The footprint covered = the ridge's bounding box expanded by width on every side.
To roof a building W x H: put the ridge along the LONG axis, centered, and set width = half the SHORT dimension so the eaves reach the side walls. The ridge should be shorter than the long wall by ~width at each end (so the end hips land on the short walls). Two points that are close together give a near-pyramid (a square hip roof).
2=dormer. Roofs render above everything (z 800). Undoable as a create.
| Parameter | Type | Default | Description |
|---|---|---|---|
points required | number[][] | ||
asset required | string | a Roofs asset path (list_assets('Roofs')). | |
width | number | 256 | |
type | integer | 0 | 0=gable, 1=hip, |
sorting | integer | 0 | |
sunlight | boolean | null | null | shade the roof's faces from a sun direction. This is what makes a roof read as a solid volume rather than a flat patch of tiles, and it is worth setting on any exterior building. |
sun_angle | number | 315 | degrees the light comes FROM. Use ONE angle for every roof on a map — two buildings lit from different directions read as a mistake immediately. |
sun_contrast | number | 0.25 | 0 is flat, higher is starker. |
add_floor
Draw a solid floor shape — the bordered room floors a built map is made of.
This is a different system from terrain and from patterns. Terrain is the painted ground beneath everything; a pattern is a tiled surface; a floor shape is a solid slab with an outlined edge, which is what makes a room read as a built interior rather than a patch of ground. Reach for it when walling a room, and paint terrain outside it.
Like terrain and water it is a layer, not an object: there is nothing to select or delete, so use invert to take one back.
A native floor is not a pattern: it carries its own border WALL and can use Dungeondraft's smart tiles. Unset options keep whatever the tool holds.
| Parameter | Type | Default | Description |
|---|---|---|---|
rect | number[] | null | null | [x, y, w, h] in woxels, or points: [[x,y], ...] for any outline. |
points | number[][] | null | null | |
invert | boolean | false | cut a hole in the floor instead of adding to it. |
smart_tile_id | integer | null | null | which floor style. Read the options from list_tool_controls('FloorShapeTool') — they are ids, not names. |
wall_asset | string | "" | the Walls asset used for this floor's own border wall. |
wall_color | string | "" | hex tint for that border wall. |
bevel | boolean | null | null | bevel the border wall's corners. |
place_pattern
Place a tiled floor/pattern shape (the Building Tool's "Floor" / Pattern Shape).
Draws an actual tiled floor (wood planks, tile, brick, ...) that renders BELOW objects, distinct from terrain. Provide ONE of: rect, points, asset, category, color, rotation or z.
| Parameter | Type | Default | Description |
|---|---|---|---|
asset required | string | a pattern asset path from list_assets(category=...). | |
rect | number[] | null | null | [x, y, w, h] axis-aligned rectangle, or |
points | number[][] | null | null | [[x,y], ...] a polygon (>= 3 points), all in woxels. |
category | string | "Patterns" | which asset bank — 'Patterns', 'Patterns Colorable', 'Materials', 'Simple Tiles', or 'Smart Tiles'. |
color | string | "" | '#rrggbb' tint. Omit it and a greyscale texture gets a neutral brown, while one with its own colours (marble, painted tile) is left untinted; the reply's texture_greyscale says which. |
rotation | number | null | null | pattern rotation in degrees. |
z | integer | -100 | persistent layer VALUE, a multiple of 100 from -500 to 900. Default -100 sits below objects. Arbitrary z offsets cannot survive saving. |
generate_dungeon
Run Dungeondraft's own procedural generator: a whole layout in one call.
floor / wall: texture indices from generator_options. They must be passed HERE rather than set beforehand — enabling the generator resets the wizard's pickers, so a choice made earlier is discarded. Set the numeric dials with generator_options first; those do survive.
The response reports the design actually generated, read back from the wizard — not the one requested.
This REPLACES the level's layout, so run it FIRST, on an empty map, after set_map_size and before placing anything by hand. Re-generating works, but Dungeondraft's own UI does not offer it: treat it as a do-over on an undecorated map, not a way to iterate on work.
It gives structure, not a finished map. Character comes from scatter, shadow paths along the walls, floor shapes and terrain.
| Parameter | Type | Default | Description |
|---|---|---|---|
design | string | "" | "Dungeon" for rooms and corridors, "Cave" for organic caverns. Omit to use whatever the app's Map Wizard currently has selected. |
floor | integer | null | null | |
wall | integer | null | null |
generator_options
Read or set the Map Wizard's generator dials.
Call with no arguments to list them: each dial's current value, min, max and step, plus which design is selected. Only dials the current design actually shows are listed — a cave has Boundary, Complexity and Density; a dungeon adds the Floor and Wall pickers — so list them AFTER choosing the design.
name + value sets a "number" dial — Boundary, Complexity and Density — to a value inside its min..max. The response reports what it became.
"list" dials (Floor and Wall) are reported here but set through generate_dungeon's floor= and wall= arguments, not here. Enabling the generator resets the wizard's pickers, so a selection made beforehand is discarded.
Effects, strongest first: Complexity and Density transform a cave; on a dungeon both raise room and corridor count substantially; Boundary trades map coverage for compactness.
Set these before generate_dungeon; they are the difference between a sprawling open cavern and a tight warren.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | "" | |
value | number | null | null |