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#
| Statement | Example | Notes |
|---|---|---|
home "name" | home "Beach House" | Name shown in the editor. |
roof <shape> | roof gable | flat (default), gable, pyramid or asbestos — the top storey's roof. |
wall height <m> | wall height 3 | Default 2.7. Affects every storey. |
wall thickness <m> | wall thickness 0.25 | Default 0.2. |
no auto doors | no auto doors | Don't add connecting doors between touching rooms. |
floor <n> | floor 2 | Rooms after this line are on storey n (1 = ground). See Floors. |
Rooms#
syntax
room <Name> <width>x<depth> [placement]
| Placement | Meaning |
|---|---|
right of Living | East of Living, top edges aligned. |
left of Living | West of Living, top edges aligned. |
above Living | North of Living (up the plan), left edges aligned. Not a storey up. |
below Living | South of Living (down the plan), left edges aligned. |
over Living | Directly on top of Living, one storey up. |
at 4, 6 | Top-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#
| Statement | Examples | Notes |
|---|---|---|
door | door south · door south, east · door south at 1.5 width 1.2 | at = 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.5 | Default 1.2 × 1.2 m, sill 0.9 m. Moves aside if a door is there. |
light(s) | light · lights 3 | Ceiling lights in a row, 12 W, circuit C1. |
fan(s) | fan · fans 2 | Ceiling fans, 60 W, circuit C2. |
plug(s) | plugs 2 · plugs 15A, 5A · plugs 2 x 15A | Low on the walls (west, east, south, north in turn). 15 A → circuit C4, others C3. |
stairs | stairs · stairs east | Staircase climbing toward that side, up to the next floor. See Stairs. |
furniture | furniture bed, wardrobe · or just bed, wardrobe | bed, sofa, table, chair, cabinet, wardrobe, toilet, sink. |
What’s generated for you#
| Thing | Rule |
|---|---|
| Walls | Every room edge; an edge shared by two rooms becomes one wall, split where other walls meet it. |
| Connecting doors | Between rooms on the same floor sharing at least 1.2 m of wall, unless either already has a door there. |
| Floors & ceilings | A floor per ground-floor room; a thin ceiling board in every room (around the stairwell in a stairs room). |
| Main Switch | By the first room's first door. |
| Switches | One per room with lights or fans, beside its first door, controlling all of them, fed from the Main Switch. |
| Roof & slabs | A flat slab over every storey that has one above it; the roof shape on top. |
| Plumbing | If 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 }]}