Writing it
dharmatiles version="1.0.0"
tile size="1x1" seed=97 {
about "Water in the lower half, a meadow bank in the upper."
line shore wobble="5dmm" { through "wsw" "e" }
region pool { boundedBy shore; fill "(0.5sq, 0.75sq)" }
region bank { boundedBy shore; fill "(0.5sq, 0.25sq)" }
region shoreBand { within "7dmm" of=shore }
stack {
base
dirt {
pin top="[$waterBedHeight .. $groundHeight + 1dmm]" at=shoreBand // anywhere from the bed to the land
pin top="$waterBedHeight" at=pool // later, so it wins in the pool
}
water
scatter at=pool count=2 { rock size="6dmm .. 10dmm" }
grass at=bank
}
}
Try it

dharmatiles version="1.0.0"
// A range is two values and `..`: each rock draws its own size from it, keyed by the tile's seed.
tile size="1x1" seed=7 {
stack {
base
dirt
scatter count=5 { rock size="5dmm .. 11dmm" }
}
}
... Each rock draws its own size from it, keyed by the tile's seed: roll the seed for another draw.
dharmatiles version="1.0.0"
// A weighted range says which sizes are likelier: `low` favours the small end 4 to 1, so there
// are many small stones and a few big ones.
tile size="1x1" seed=7 {
stack {
base
dirt
scatter perSquare=14 { rock size="low(3dmm .. 12dmm, 4)" }
}
}
low(3dmm .. 12dmm, 4) favours the small end four to one.dt::unitdharmatiles version="1.0.0"
// A bare number is not a length: the wobble needs a unit, so this tile does not build.
tile size="1x1" seed=4 {
line stream wobble=5 { through "(0sq, 0.5sq)" "(1sq, 0.5sq)" }
stack {
base
dirt
}
}
5dmm.Reference
| Written | Takes | Default | What it does |
|---|---|---|---|
size= | "CxR" | "1x1" | Squares across, then down. A square is 35 mm (DungeonBlocks) or 25.4 mm (OpenLOCK). |
seed= | a whole number | 1 | The root seed. Every element's randomness is keyed from it and the stack, never from the file name, so renaming a tile never changes it; dharmatiles build --seed overrides it. |
seams= | free | kept | A tile's lines may cross its edges only at a seam: a third, a half or two thirds of a square's side, or a tile corner (dt::seam otherwise). seams=free lets this tile's lines cross anywhere. |
about | a string | — | Free text: what the tile is. |
let | a name and a value | — | Names this tile adds; override replaces a $ name. |
point | a name and a point | — | Named points. |
line | — | Lines, for divided tiles. | |
region | — | Areas bounded by lines. | |
stack | — | What the tile is made of. Exactly one. |
Notes
The document starts with its header line, and above the tile it may have use lines. Anything else at the top level of a tile document is an error. Positions in the tile count from the north-west corner: across the row, then down the column. The tile is the root region, $tile. The build adds the DungeonBlocks or OpenLOCK base; the document never names it.
The file name is the tile's name everywhere: in the preview, the tile list and the STL (1x1-water+grass.dtile builds 1x1-water+grass-db.stl). To rename a tile, rename its file. Library tiles follow the tile-system naming; your own can be called anything.
Seen from the language
The guide pages that use tile: The tile document, Syntax, Squares, cells and points, Lines, Seams, Units and kinds, Kinds, Seeds, Reading errors, Worked tiles.
