Skip to content
Star

Walls, rooms and floors tools

Generated from the battlemap-mcp server at a020c64. 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: [x, y, w, h] axis-aligned rectangle, or points: [[x,y], ...] a polygon (>= 3 points), all in woxels (the wall centerline; the wall covers the floor's outer edge).

wall_asset: a Walls asset path (omit for the default).

floor: '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: the floor texture. floor_category: pattern bank for floor= 'pattern' (e.g. 'Simple Tiles', 'Smart Tiles', 'Materials').

floor_color: optional '#rrggbb' tint (pattern floors).

wall_type: 0=auto, 1=manual, 2=cave. wall_joint: 0=sharp, 1=bevel, 2=round.

snap: 'none', 'grid' or 'auto'; see get_snap_settings. A rect gets all four corners on the grid (on hex, the far one may shift).

Returns { wall_id, floor_id?, points }.

ParameterTypeDefault
rectnumber[] | nullnull
pointsnumber[][] | nullnull
wall_assetstring""
floorstring"pattern"
floor_assetstring""
floor_categorystring"Simple Tiles"
floor_colorstring""
floor_slotinteger1
wall_typeinteger0
wall_jointinteger1
snapstring""

draw_wall

Draw a wall through a list of [x, y] woxel points. Returns the new element id.

asset: optional Walls asset path. loop: close into a loop (e.g. a room).

type: 0=auto, 1=manual, 2=cave. joint: 0=sharp, 1=bevel, 2=round.

snap: 'none', 'grid' or 'auto'; see get_snap_settings.

ParameterTypeDefault
points requirednumber[][]
assetstring""
loopbooleanfalse
shadowbooleantrue
typeinteger0
jointinteger1
colorstring""
snapstring""

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.

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

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

sunlight: 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: 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: 0 is flat, higher is starker.

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

asset: a Roofs asset path (list_assets('Roofs')). type: 0=gable, 1=hip, 2=dormer. Roofs render above everything (z 800). Undoable as a create.

ParameterTypeDefault
points requirednumber[][]
asset requiredstring
widthnumber256
typeinteger0
sortinginteger0
sunlightboolean | nullnull
sun_anglenumber315
sun_contrastnumber0.25

add_floor

Draw a solid floor shape — the bordered room floors a built map is made of.

rect: [x, y, w, h] in woxels, or points: [[x,y], ...] for any outline.

invert: cut a hole in the floor instead of adding to it.

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.

smart_tile_id: which floor style. Read the options from list_tool_controls('FloorShapeTool') — they are ids, not names.

wall_asset: the Walls asset used for this floor's own border wall.

wall_color: hex tint for that border wall.

bevel: bevel the border wall's corners.

ParameterTypeDefault
rectnumber[] | nullnull
pointsnumber[][] | nullnull
invertbooleanfalse
smart_tile_idinteger | nullnull
wall_assetstring""
wall_colorstring""
bevelboolean | nullnull

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: [x, y, w, h] axis-aligned rectangle, or points: [[x,y], ...] a polygon (>= 3 points), all in woxels.

asset: a pattern asset path from list_assets(category=...).

category: which asset bank — 'Patterns', 'Patterns Colorable', 'Materials', 'Simple Tiles', or 'Smart Tiles'.

color: '#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: pattern rotation in degrees.

z: persistent layer VALUE, a multiple of 100 from -500 to 900. Default -100 sits below objects. Arbitrary z offsets cannot survive saving.

ParameterTypeDefault
asset requiredstring
rectnumber[] | nullnull
pointsnumber[][] | nullnull
categorystring"Patterns"
colorstring""
rotationnumber | nullnull
zinteger-100

generate_dungeon

Run Dungeondraft's own procedural generator: a whole layout in one call.

design: "Dungeon" for rooms and corridors, "Cave" for organic caverns. Omit to use whatever the app's Map Wizard currently has selected. 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.

ParameterTypeDefault
designstring""
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.

ParameterTypeDefault
namestring""
valuenumber | nullnull