Element · thing

rock

One chiselled rock: a convex body cut by tilted planes into crisp facets of mixed sizes, chipped at its sharpest corners, grained, and bedded into the ground beneath it. Alone it is a landmark; scattered it is a rocky field, a stream bed or a cliff's scree.

Three elements are rocks with other default sizes, each with its own page: stone (1dmm .. 6dmm), boulder (4.5dmm .. 8dmm) and pebble (1dmm .. 2.2dmm). Many rocks are a scatter.

Sizes
6dmm .. 15dmm across by default; any range with size=
Printing
no supports: a flat base, nothing pointing down past 30°
Bases
DungeonBlocks and OpenLOCK
In the library
the water tiles' pools, scree at every cliff
Words used on this page
facet
One flat face of a rock, 2–7 mm across.
chip
A small flat cut off a corner or edge, 0.2–0.9 mm deep.
grain
The fine roughness over every face, about 0.1 mm high, that catches a drybrush.
cluster
Two to four stones of different sizes leaning together, fused into one piece.
scatter
How rocks are spread over a tile: how many, how far apart.
A two-square tile of dirt with faceted grey rocks scattered over it
lib:tests/rocks/2x2-rocks.dtile, built by the program today.

What it looks like

Each rock is broad and flat at the bottom and never wider above the ground than at it, so it sits on the earth rather than perching. A few large facets give it its mass; many small ones break up the corners, like a stone that has been knapped. No two rocks on a tile are copies: each draws its own footprint (round to twice as long as wide), height, profile and facets. About one placement in four is a cluster of two to four stones of different sizes leaning together. The ground between them is bare dirt, with open floor left for miniature bases.

ShapeWhat it isShare
domeA rounded mound, widest at the ground35%
wedgeA ridge or pyramid whose peak leans to one side25%
slabA low, flat-topped stone, about 60% of the usual height20%
blockA blocky stone on a squarish footprint20%

Using it in a tile

A thing is one of itself. Place one rock with at= (a point, counted from the north-west corner), or leave at= out to let it land anywhere in its area:

rock at="(0.5sq, 0.5sq)" size="6dmm .. 10dmm"     // one rock, there
rock at=pool                                      // one rock, anywhere in the pool region

Many rocks are a scatter:

dharmatiles version="1.0.0"

tile size="2x2" seed=1 {
    stack {
        base
        dirt top="$dirtEdgeHeight"
        scatter perSquare="2.25..3" gap="1.5dmm" { rock }
    }
}

Scattered at="foot(cliff)", stones and boulders gather at the cliff's foot as scree. Every rock is seated into the ground under it, and grass grows round it wherever the grass is listed. A rock lays its top into the surface laid after it: a dirt listed after the rock lies on its top where that is flatter than the dirt's maxSlope, and a dirt listed before it is laid first and the rock beds into it.

Reference

Kind
a thing: one solid, standing on the surface
Place
at= region, point
Built
yes

Controls

ControlTakesDefaultWhat it does
sizelength (dmm), over 0, up to 200, or a range, or a weighted range6dmm..15dmmrock width
shapeworda mix of all threeriver stones, broken rock, flat slabs
rounded
river stones
angular
broken rock
flat
flat slabs
wearword—sharp, or chipped and rounded edges not built yet check accepts it; build refuses it
crisp
sharp edges
worn
chipped and rounded edges
buriedpercent, 0% to 100%, or a range, or a weighted range—how much of each rock is under the ground
topheightits own height, not held to a levelhow high the top stands, as a height worked out where it stands: $bottom + [4dmm .. 9dmm]

In the library

Generated from dharmatiles elements rock by cargo xtask docs.

A rock's top

A rock takes a top= like a tree's: a cloud, a low surface, a high surface and one weighting, as a height above zero, where $bottom is the land at the rock's foot. It is worked out once for each stone, at the stone's middle: $x and $y are the tile's coordinates there, $d is 0% and $region is the stone's own disc, so parent($region) is the region it stands in (d(parent($region), %) reads how far into it the stone is). The stone rolls one number in the cloud and its peak stands there: the rock keeps its width and its facets and is stretched or squeezed upward to the height the cloud gives it, so it never undercuts.

rock at="(0.5sq, 0.5sq)" size="10dmm" top="$bottom + [4dmm .. 9dmm]"
scatter count=8 { rock top="$bottom + high(3dmm .. 9dmm)" }          // a few low, most tall
scatter count=8 { boulder top="$bottom + 3dmm + 6dmm * (1 - d(parent($region), %))" }

Rolls are one smooth field over the tile (stones a square apart are alike), read by rank over the stones of the entry so a weighting's odds hold; a lone stone draws its own roll from its seed. Each stone of a cluster rolls on its own. A plain range builds with every height equally likely. A top that leaves a peak under 1 mm or over 120 mm above the stone's foot is refused with top on the rock's line. A rock without a top= builds as it always has. stone, boulder and pebble take it the same way.

Sizes and levels

Edges and joining tiles

Rules

What this element always does. A change to one of these is a change to the element.

Printing and painting

The full printing rules are on the printing page.

How it is made

Step by step

A rock is a convex body cut by planes. The facets come from cutting half-spaces away, not from pushing a surface around, so the edges stay crisp and the facets come in mixed sizes. That is also why every rock is closed and prints: it is one convex solid with a flat base.

Click a step to jump to it. A 2.5D stand-in for the 3D body.

    The animation is a simplified stand-in for the idea, drawn in your browser; it is not the program's output. What the program does, in order:

    1. Body: the convex hull of a profile that never widens going up (dome, slab, block or wedge), with lumps that depend only on the angle round it.
    2. Facets: blue-noise seeds of mixed sizes on the body; each seed's tangent plane, tilted up to 14°, cuts the body. No cut may leave a face pointing down past 30°.
    3. Chips: small planes at the corners and along edges sharper than 18°, 8 to 16 a rock, each refused if it would remove more than 3% of the volume.
    4. Scale and grain: the shape is scaled to the system like a photocopy, then given a fine grain in true millimetres.
    5. Seat: each rock is set into the ground under it, 0.25 mm below the lowest point of its footprint, so it never floats on a slope.
    6. Scatter: a quarter of placements are clusters of 2 to 4 stones; the largest go first, 1.5 mm apart and 1 mm inside the rim.

    The code: crates/dt-elements/src/rock.rs.

    Stone finish

    Rocks, cliffs and walls share one idea of what worked stone looks like at miniature scale. Photos and measured DungeonBlocks floors show the same thing: stone reads as a calm plateau carved downward. Most of a face is flat; the relief is recesses, worn channels and shallow dished patches, with almost nothing finer than 2 mm. Even waves of noise, which go up as much as down, read as choppy water or wrinkled cloth instead.

    Seen from the language

    The guide pages that use rock: The stack, Placement and scatter, Values and ranges, Weighted ranges, Clouds.