Skip to content
battlemap-mcp docs
You're reading the docs for battlemap-mcp v1.3.1, an earlier release. See this page in the latest docs.

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 }.

ParameterTypeDefaultDescription
rectnumber[] | nullnull[x, y, w, h] axis-aligned rectangle, or
pointsnumber[][] | nullnull[[x,y], ...] a polygon (>= 3 points), all in woxels (the wall
wall_assetstring""a Walls asset path (omit for the default).
floorstring"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_assetstring""the floor texture.
floor_categorystring"Simple Tiles"pattern bank for floor= 'pattern' (e.g. 'Simple Tiles', 'Smart Tiles', 'Materials').
floor_colorstring""optional '#rrggbb' tint (pattern floors).
floor_slotinteger1
wall_typeinteger00=auto, 1=manual, 2=cave.
wall_jointinteger10=sharp, 1=bevel, 2=round.
snapstring""'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.

ParameterTypeDefaultDescription
points requirednumber[][]
assetstring""optional Walls asset path.
loopbooleanfalseclose into a loop (e.g. a room).
shadowbooleantrue
typeinteger00=auto, 1=manual, 2=cave.
jointinteger10=sharp, 1=bevel, 2=round.
colorstring""
snapstring""'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.

ParameterTypeDefaultDescription
ids requiredinteger[]

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).

ParameterTypeDefaultDescription
asset requiredstring
xnumber | nullnull
ynumber | nullnull
closedboolean | nullnull
radiusnumber64
mountstring"wall"
snap_maxnumber256
flipbooleanfalse
fallback_freebooleantrue
rotationnumber0
snapstring""

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.

ParameterTypeDefaultDescription
points requirednumber[][]
asset requiredstringa Roofs asset path (list_assets('Roofs')).
widthnumber256
typeinteger00=gable, 1=hip,
sortinginteger0
sunlightboolean | nullnullshade 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_anglenumber315degrees 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_contrastnumber0.250 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.

ParameterTypeDefaultDescription
rectnumber[] | nullnull[x, y, w, h] in woxels, or points: [[x,y], ...] for any outline.
pointsnumber[][] | nullnull
invertbooleanfalsecut a hole in the floor instead of adding to it.
smart_tile_idinteger | nullnullwhich floor style. Read the options from list_tool_controls('FloorShapeTool') — they are ids, not names.
wall_assetstring""the Walls asset used for this floor's own border wall.
wall_colorstring""hex tint for that border wall.
bevelboolean | nullnullbevel 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.

ParameterTypeDefaultDescription
asset requiredstringa pattern asset path from list_assets(category=...).
rectnumber[] | nullnull[x, y, w, h] axis-aligned rectangle, or
pointsnumber[][] | nullnull[[x,y], ...] a polygon (>= 3 points), all in woxels.
categorystring"Patterns"which asset bank — 'Patterns', 'Patterns Colorable', 'Materials', 'Simple Tiles', or 'Smart Tiles'.
colorstring""'#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.
rotationnumber | nullnullpattern rotation in degrees.
zinteger-100persistent 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.

ParameterTypeDefaultDescription
designstring"""Dungeon" for rooms and corridors, "Cave" for organic caverns. Omit to use whatever the app's Map Wizard currently has selected.
floorinteger | nullnull
wallinteger | nullnull

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.

ParameterTypeDefaultDescription
namestring""
valuenumber | nullnull