Element · surface

water

Sculpted still water: broad swells rolling off the shore, short chop round rocks, and calm toward the tile edge, where every water tile meets its neighbour in the same shared tide. Water fills its area up to the water level wherever the ground is lower.

Water needs a bed under it: dirt pinned below the water. Reeds at the shore are their own element, reeds.

Sizes
any tile size; waves 2–16dmm long
Printing
no supports: one height field
Edges
the shared tide: any two water tiles butt any way round
In the library
tiles/water/: pools, rivers, corridors and banks
Words used on this page
water level
The calm surface height, 2.6dmm above the base's top. Waves rise and fall around it.
swell
A long, low, rounded wave, 5–16 mm from crest to crest.
chop
Short, sharper waves, 2–4.5 mm apart, round the rocks and reeds that stand in the water.
emitter
Anything the waves come from: the land, a rock, a reed, or a faint source at an open-water corner.
bank
The slope where land runs down into the water.
edge profile
The fixed wave shape every water tile has along its edges, so two tiles meet with no step.
A one-square tile of blue water with sculpted swells
lib:tiles/water/1x1-water.dtile, built by the program today.

What it looks like

The waves come from things. Land sends out the biggest waves: long rounded swells that follow the shoreline, with smaller, sharper waves riding on them. Each rock sends out short chop that hugs its outline, with a little extra wake on the side away from the shore. The further a wave travels from its source, the more it loses its shape, so the water is orderly near the shore and rocks and becomes a soft, crossing chop out in the open.

The relief is exaggerated, about 2 mm from trough to crest, so the waves cast shadows and catch a drybrush. Crests are rounded and at least about 1 mm wide; troughs are broad and smooth. There are no perfect rings, no rows of parallel waves, and no pattern that repeats.

Open water, bays and obstacles

The same water works whatever is in the tile. In open water with nothing in it, faint sources at the corners give a calm, directionless chop. A rock in open water makes its own rings, and two rocks make two sets that merge between them. Square obstacles get squarish rings. When land surrounds the water on two, three or four sides, the shore waves stay close to the banks and the middle of the pond goes calm.

The shore

The shore is where a meadow meets the water. The land runs down a real bank, never a cliff or a cut, and the shoreline wanders in bays, headlands and small coves. Along some stretches the grass grows right to the water and laps over its edge; along others a strip of bare earth up to 4 mm wide lies between. Grass near the water leans toward it or runs along the shore, never away. Three to five clumps of reeds stand in the shallows, each sending out its own small ripple rings. Rocks sit on the land, in the shallows and in the water; the ones listed before the water ring it with chop.

Reeds are deliberately simple: 5–9 chunky blades per clump with a pointed-oval cross-section, 8–13 mm tall, rising from one base and curving gently outward to a fairly blunt point. They stand no more than about 40° from vertical.

Using it in a tile

A pool is a bed of dirt pinned below the water's top, then water, which fills everything lower than its top over the ground listed above it:

dharmatiles version="1.0.0"

tile size="1x1" seed=7 {
    stack {
        base
        dirt top="$waterBedHeight" { pin top="$waterBedHeight" at=edges }   // the bed, 2.2dmm under the water
        water                                                                // fills to its top, about 2.6dmm
    }
}

A shore is a line dividing the tile into a pool and a bank. Water is built where it is listed, like every other layer. List it after the rocks and reeds and before the grass: the water sees the rocks and rings them with chop, and the grass, listed after the water, sees the shore and keeps off the wet ground:

dharmatiles version="1.0.0"

tile size="1x1" seed=97 {
    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   // a bank drawn between the bed and the land
            pin top="$waterBedHeight" at=pool                                  // later, so it wins in the pool
        }
        scatter at=pool count=2 { rock size="6dmm .. 10dmm" }
        water                                                         // after the rocks: it rings them
        grass at=bank                                                 // after the water: it sees the shore
    }
}

Each rock or reed listed before the water sends its own chop and wake, and the water goes round it; the water fills over it to its level, so a low rock may only just show. A rock listed after the water stands in it without rings. A dirt or ground listed after the water lies over it: where its top is higher than the water the earth shows (a spit, an island), where it is lower the water stays. A tree, grass or wall listed above the ground it stands on is refused (dt::order), as for any element.

The waves come from what is around the water: the land sends swells, each rock or reed listed before the water sends chop. They are drawn inside the water's band, scaled to fit it, so a narrower top gives shorter ripples and a single height a still pond.

Reference

Kind
a layer, a surface: it paints the ground of its area
Place
at= region
Built
yes

Controls

ControlTakesDefaultWhat it does
topheight—the band the body fills over its region, as a height: $dirtEdgeHeight + 35dmm; the library's edge top when not written

In the library

Generated from dharmatiles elements water by cargo xtask docs.

Sizes and levels

Height above the base topdmmNotes
Calm water level2.6$waterSurfaceHeight.
Wave relief−0.74 to +2.2About the water level; troughs are softly floored at −1.1.
Tide at the tile edge±0.6The shared edge profile (below).
Water bed0.4$waterBedHeight, 2.2 below the water level, where the bank ends.
Land top6.0The DungeonBlocks grass band.
Meadow ground (shore)≥ 3.4Hills, with grass on top.
Reeds8–13 tallA tall reed can push the tile onto the tall base peg.

Wave spacing depends on what sends them: land 5–16 mm, rocks and reeds 2–4.5 mm, open-water corners 5–14 mm.

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

The waves are sent out by what is round the water. Each kind of thing sends its own band of wavelengths: the land long swells, rocks short chop. Near a source its own waves rule; far from every source they hand over to an interference “chaos” of all of them. Try the modes: the rejected ones are there for contrast.

1.0

Shading exaggerates relief about 2×. Distances here are straight lines; the program measures them through the water, so swells wrap round rocks.

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. Fill: water fills its area up to its level wherever the ground is lower, and is lifted with the ground as one surface.
  2. Emitters: the land's border with the water sends broad swells (5–16 mm), with distances measured through the water so they wrap round rocks; each thing standing in the water (a rock, a clump of reeds) sends short chop (2–4.5 mm) from its real section at the calm level and leaves a wake on the side away from the land; a rock or reed that does not reach the surface sends none; open corners of the tile send weak long swell.
  3. Blend: near a strong emitter its own waves rule (blend exponent 8); far from every emitter the waves become an interference chaos of all of them.
  4. Shape: troughs are compressed softly above −1.1 mm (the bed is 2.2 mm down), and a small lip rises at every shore.
  5. Edges: the relief calms within 4 mm of the tile edge, where the shared tide takes over: every water tile meets its neighbour with the same shape.

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

Seen from the language

The guide pages that use water: The stack, Heights, Defaults and the edge contract, Clouds.