Documentation menu
DreamCode

Language reference

Every DreamCode statement, its options and defaults.

One statement per line, case-insensitive. # or // starts a comment. Lines after a room line describe that room; indenting them is optional but recommended. Sizes are metres.

House settings#

StatementExampleNotes
home "name"home "Beach House"Name shown in the editor.
roof <shape>roof gableflat (default), gable, pyramid or asbestos — the top storey's roof.
wall height <m>wall height 3Default 2.7. Affects every storey.
wall thickness <m>wall thickness 0.25Default 0.2.
no auto doorsno auto doorsDon't add connecting doors between touching rooms.
floor <n>floor 2Rooms after this line are on storey n (1 = ground). See Floors.

Rooms#

syntax
room <Name> <width>x<depth> [placement]
PlacementMeaning
right of LivingEast of Living, top edges aligned.
left of LivingWest of Living, top edges aligned.
above LivingNorth of Living (up the plan), left edges aligned. Not a storey up.
below LivingSouth of Living (down the plan), left edges aligned.
over LivingDirectly on top of Living, one storey up.
at 4, 6Top-left corner at x = 4, z = 6 metres.
(none)Right of the previous room on the same floor; the first room of a new floor goes over the floor below's first room.
  • Names may contain spaces: room Master Bedroom 4x4 right of Hall. Names must be unique.
  • A placement can only refer to a room written earlier. Rooms on the same floor must not overlap.
  • behind = above, in front of = below, on top of = over.

Plan directions

plan view
north (above)
┌───────────────┐
west │ │ east
(left of)│ room │ (right of)
│ │
└───────────────┘
south (below) x → east, z → south

Room details#

StatementExamplesNotes
doordoor south · door south, east · door south at 1.5 width 1.2at = metres from the west/north end of that side. Default 0.9 × 2.1 m, centred.
window(s)windows west, north · window east at 0.5Default 1.2 × 1.2 m, sill 0.9 m. Moves aside if a door is there.
light(s)light · lights 3Ceiling lights in a row, 12 W, circuit C1.
fan(s)fan · fans 2Ceiling fans, 60 W, circuit C2.
plug(s)plugs 2 · plugs 15A, 5A · plugs 2 x 15ALow on the walls (west, east, south, north in turn). 15 A → circuit C4, others C3.
stairsstairs · stairs eastStaircase climbing toward that side, up to the next floor. See Stairs.
furniturefurniture bed, wardrobe · or just bed, wardrobebed, sofa, table, chair, cabinet, wardrobe, toilet, sink.

What’s generated for you#

ThingRule
WallsEvery room edge; an edge shared by two rooms becomes one wall, split where other walls meet it.
Connecting doorsBetween rooms on the same floor sharing at least 1.2 m of wall, unless either already has a door there.
Floors & ceilingsA floor per ground-floor room; a thin ceiling board in every room (around the stairwell in a stairs room).
Main SwitchBy the first room's first door.
SwitchesOne per room with lights or fans, beside its first door, controlling all of them, fed from the Main Switch.
Roof & slabsA flat slab over every storey that has one above it; the roof shape on top.
PlumbingIf there’s any sink or toilet: a Water Main outside the west wall and a Sewer Outlet outside the east side; every pipe is then routed automatically (Plumbing).

Legacy JSON form#

Code that starts with { is read as the older DreamCode JSON. The { } button shows the JSON form of any program:

DreamCode JSON
{
"home": "My Home",
"rooms": [
{ "name": "Living", "size": "6x5", "doors": ["south"], "lights": 2 },
{ "name": "Kitchen", "size": "4x5", "rightOf": "Living", "windows": ["east"], "lights": 1 }
]
}