The result

dharmatiles version="1.0.0"
// A tile is columns by rows of squares, and every position counts from the north-west corner:
// across, then down. This tile is two squares across and one down; the knoll is in the second
// square, 1.28 squares across and 0.72 down.
tile size="2x1" seed=8 {
point knoll "(1.28sq, 0.72sq)"
region hill { within "9dmm" of=knoll }
stack {
base
dirt
grass at=hill
}
}
Say it plainly
The whole printed piece is a tile. It is made of squares, the same size as the grid you play on: 35 mm for DungeonBlocks, 25.4 mm for OpenLOCK. A tile of size="2x1" is two squares across and one down.
Inside a tile you point at places by saying how far across and how far down. Those two numbers, with their units, are a point; a few functions give the same numbers back for any region, which is how heights follow the land.
The rules
A tile is columns by rows of squares
The whole printed output is a tile; one 35 mm DungeonBlocks unit (25.4 mm for OpenLOCK) of it is a square; one subdivision of a square that the program works in is a cell. sq is the unit for a square. size="2x1" is columns first, and the default is "1x1". A square is never called a tile, and densities are per square.
Every position counts from the north-west corner
A tile is rows and columns. Every position counts from the north-west corner: across the row from the west edge, then down the column from the north edge. A size="2x1" tile is 2 squares across and 1 down.
A coordinate is a function of a region and a unit
A coordinate is a function of a region and a unit. x and y are where a point is (across, down), d is how far in from the edge, a is how far round. The unit says what to count in, and divides, so the result is a plain number.
| Written | Means |
|---|---|
x($tile, sq), y($tile, sq) | squares from the tile's north-west corner ($x and $y for short) |
x($region, sq), y($region, sq) | squares from the region's own north-west corner |
x($region, %), y($region, %) | 0 at the west (north) edge of the region's bounding box and 1 at its east (south): across the region by share. On $tile it scales with the tile's size, so a 2×2 and a 4×4 give different values the same distance from the corner; anything that must meet across tiles, like the tide, stays in sq |
d($region, %) | 0 wherever deepest in the interior, 1 right at the edge, scaled by the deepest part of each separate piece (a puddle beside a lake has its own 0). A region thinner than a cell is given a depth of one cell ($d for short) |
d($region, mm) | the distance in from the edge in printed millimetres: 0 at the edge, rising inward |
a($region, %), a($region, deg) | how far round the region: 0 at east, turning towards the south as the page reads (90deg is straight down), a full turn 1 or 360deg; so a wave round it is sin(360deg * $a) ($a for short) |
The shorthands $x and $y are always the tile's, so neighbouring tiles meet; $d and $a are always the thing's own region. In a region with a hole (land round a pond) “round” has no meaning for $a, and a thing that cannot read a name (a rock sets only $region) is refused at check, at the spot.
dharmatiles version="1.0.0"
tile size="2x1" seed=4 {
region hill { within "[8dmm .. 14dmm]" of=center }
stack {
base
dirt top="$groundHeight + 0.6dmm * (1 + sin(360deg * $x / 2))" // a swell along the tile
// a dome over the hill's own region, laid over the swell: up to 3dmm higher where deepest, a skin thick at its rim
dirt at=hill top="$bottom + 1dmm + 3dmm * (1 - $d * $d)"
}
}
A point is across, then down, in the frame it is written in
A point has two halves, across and down, written in parentheses and quoted, each half a length: "(0.65sq, 0.5sq)". A half may be in any length unit, or a %, which here is a length: the share of the frame's width (or height), "(50%, 0.25sq)". A tuple is a point in the frame it is written in: the tile, unless it sits in a pin of a body that acts in a named region, where it is that region's own corner.
| Written | Means |
|---|---|
"(0.65sq, 0.5sq)" | across 0.65 squares from the west edge, down half a square from the north edge |
"(50%, 2dmm)" | half way across, 2 design millimetres down |
point($tile, 25%, 75%) | the frame always named: $tile, $region (the region the point sits in) or parent($region), then across and down |
polar($tile, 40%, 90deg) | out from the frame's deepest point by a share of its depth, at an angle round it (0 east, 90deg straight down) |
north, southEast… a point's name | corner and edge words, the built-in names and declared points, unchanged |
A point outside the tile, or outside the region it is written in, is dt::point at check, with the box it should be inside. In a line's through and a region's fill either half may be a range, drawn once from the tile seed ("(0sq .. 0.1sq, 0.3sq .. 0.5sq)", or a weighting such as bell(…)), keyed by the line's name and the point's place in the list, so another seed draws another line and editing one point moves no other. A thing's at= is one fixed point, not a range. A part, which has no tile of its own, writes points the same way and they are worked out at each place it is called.
| Thing | Written as | Means |
|---|---|---|
| Tile size | size="2x1" | Columns first. Default "1x1". |
| Edge | north, south, east, west | For a thing, a point: the middle of that edge. For a wall, surface or scatter, a line: that edge. |
| Edge path | at="north west" | Several edges in order, quoted. Two edges meeting make a corner. |
| Corner | northWestCorner, southEastCorner, … | A point at that corner. |
A wall or cliff on a tile edge always stands inside the tile, its outer face flush with the edge. That is the DungeonBlocks slab standard, and it means an author never has to work out which side of a line a wall is on.
Errors this page explains
Next
Next: lines, which run through points.