What it looks like
The rocks belong to the ground. Each one is bedded into the soil on every side, so on a slope the uphill side is buried and the downhill side shows no gap. Every rock's top stands clearly above the grass around it, so no rock is swallowed.
The grass treats a rock as an obstacle. Its flow parts upstream of the rock and joins again behind it, the way water runs round a stone. Most rocks have grass right up to them, pressed against the stone and a little lower at its foot. About one rock in three has a patch of bare earth on one side: usually a wake downstream, sometimes a scour to the side. No rock sits in a ring of bare ground.
Bare earth covers about a fifth of the tile, counting the ground under the rocks. It comes as a few natural-size patches in the low ground, not as one big bald area. Grass stays the main cover.
At the tile edge the ground comes down to the standard edge level, so a meadow tile meets any other ground or grass tile with no step.
Using it in a tile
A tile is a short document that lists elements in a stack. The stack is built in the order it is listed, so grass grows round the solids (rocks, trees, walls, cliffs) listed above it. A meadow looks like this:
dharmatiles version="1.0.0"
use "parts/grass" lawn
tile size="2x2" seed=1 {
stack {
base
dirt // the ground, and the bare earth between the grass
scatter perSquare=2 { // about 8 rocks on a 2×2
rock size="2dmm .. 10dmm" shape=angular buried="30%"
}
lawn cover="80%" // grass over 80% of the ground; it grows round the rocks
}
}
This is elements/demo/meadow.dtile, the tile in the picture above. A tile divided by a path or a shore uses a line and a region, and each element acts at= its region; see the path example on the language page.
Specification
Controls
Composition has no look of its own in the tile language. It is controlled by the words every element shares. These are the ones that decide how elements meet.
| Control | Values | Default | Effect |
|---|---|---|---|
| stack order | the order elements are listed | — | Built in the order listed: each entry stands on the terrain laid so far. Land bodies are laid in order, each the higher of what is below it and its own top; water is built where it is listed: rocks and reeds listed before it stand in it and get ripple rings, and grass listed after it sees its shore. |
at= | a region, a line, an edge or edge path, a point ("(0.5sq, 0.5sq)", counted from the north-west corner), or foot(cliff) | whole tile | Where the element goes. A region is filled, a line is followed (a path, a wall), a point is where one thing stands, and foot(cliff) is the band at the foot of that kind of solid, where scatters gather. Footprints are kept inside the tile and clear of other solids. |
grass cover | percent (a plain fraction) | 100% | Share of the ground grassed over. A meadow uses about 80%. |
scatter count / perSquare | number | — | How many solids. The meadow uses 6–9 rocks on a 2×2. |
rock buried | percent (a plain fraction) | — | How much of each rock is under the ground. |
region | boundedBy lines, fill points | — | Divides the tile, like a paint bucket: name the lines, drop fill points. |
How rocks and grass meet is fixed and has no control: rock tops stand at least max(1.5 mm, 0.45 × rock height) above the grass; grass is half height at a rock's face, back to full height 1.2 mm out; about 35% of rocks get an apron; bare earth is filled to 20% with natural-size patches. The full language is on the language page.
Heights
| Name | Height above the base | Used for |
|---|---|---|
$dirtEdgeHeight | 3.4dmm | Where dirt meets every tile edge. |
$groundHeight | 5dmm | Open land: the library's grass and soil. |
$waterSurfaceHeight | 2.6dmm | The calm water surface beside a shore. |
$wallHeight | 33.1dmm | The DungeonBlocks wall top. |
Every tile gets these, and the others in library/parts/heights.dtile, as $ names without a use line. A tile's own let adds names and override replaces a $ name.
Edges and joining tiles
Every tile obeys one edge contract, so any two tiles butt with no step:
- Ground meets every tile edge at
3.4dmmand rises from there; nothing inside dips below it. - Water meets the edge at a calm, fixed profile.
- Lines such as paths and shores leave the tile only at fixed anchor positions.
- Cliffs end in a standard end section; walls end in a clean vertical cut.
- Solids never cross the tile edge: they are nudged or shrunk inward, never clipped.
The full contract is on the tile system page. It is one file, library/parts/edges.dtile, that every tile uses.
Rules
What this element always does. A change to one of these is a change to the element.
- Rocks are obstacles: grass presses up against them, and only some get a one-sided apron of bare earth.
- Bare earth comes in natural-size patches, never scaled to fit; its share counts the ground under rocks.
- No bare ring round every rock.
Printing and painting
- No supports. Grass blades, rocks and bare earth all print base down at 0.2 mm layers. Each element keeps its own printability rules; see the grass and rocks pages.
- No floating rocks. Each rock stands on a plinth of its own section that reaches below the lowest ground under it, so there is no gap or overhang on its downhill side.
- One piece. Grass, rocks and base are joined into one watertight body that survives a float32 STL reload.
- Painting. Rocks stand clear of the grass, so a rock colour and a grass colour can be drybrushed separately. Bare earth sits in the low ground and takes a wash.
The full printing rules are on the printing page.
How it is made
The program plans the stack by what each element reads and writes, in the order it is listed: surfaces first, then the lift, then solids, with what grows round solids listed after them. It refuses (dt::order) what the listed order cannot satisfy, never reorders it.
- Surfaces. Dirt is the ground; floors (flagstones, planks) are laid on it. A later land body is the higher of what is below it and its own top.
- Solids. Rocks, trees, walls and cliffs claim their footprints and are bedded into the ground, kept inside the tile and clear of each other.
- Growth. Grass and reeds read the footprints: no blade roots inside one, blades stop just inside a rock's face, and the flow parts round each solid.
- Join and check. Everything is joined with the base into one body, and the printability gate checks it.
The code: crates/dt-eval/src/plan.rs.
