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
at= regionControls
| Control | Takes | Default | What it does |
|---|---|---|---|
top | height | — | the band the body fills over its region, as a height: $dirtEdgeHeight + 35dmm; the library's edge top when not written |
In the library
1x1-water+grass-angle.dtilelib:tiles/water/1x1-water+grass-angle.dtile1x1-water+grass-corner.dtilelib:tiles/water/1x1-water+grass-corner.dtile1x1-water+grass-tree.dtilelib:tiles/water/1x1-water+grass-tree.dtile1x1-water+grass.dtilelib:tiles/water/1x1-water+grass.dtile1x1-water+soil-angle.dtilelib:tiles/water/1x1-water+soil-angle.dtile1x1-water+soil-corner.dtilelib:tiles/water/1x1-water+soil-corner.dtile1x1-water+soil.dtilelib:tiles/water/1x1-water+soil.dtile1x1-water-corridor+grass.dtilelib:tiles/water/1x1-water-corridor+grass.dtile1x1-water-corridor+soil.dtilelib:tiles/water/1x1-water-corridor+soil.dtile1x1-water-corridor-open+grass.dtilelib:tiles/water/1x1-water-corridor-open+grass.dtile1x1-water-corridor-open+soil.dtilelib:tiles/water/1x1-water-corridor-open+soil.dtile1x1-water-corridor-t+grass.dtilelib:tiles/water/1x1-water-corridor-t+grass.dtile1x1-water-corridor-t+soil.dtilelib:tiles/water/1x1-water-corridor-t+soil.dtile1x1-water-corridor-turn+grass.dtilelib:tiles/water/1x1-water-corridor-turn+grass.dtile1x1-water-corridor-turn+soil.dtilelib:tiles/water/1x1-water-corridor-turn+soil.dtile1x1-water-corridor-x+grass.dtilelib:tiles/water/1x1-water-corridor-x+grass.dtile1x1-water-corridor-x+soil.dtilelib:tiles/water/1x1-water-corridor-x+soil.dtile1x1-water-u+grass.dtilelib:tiles/water/1x1-water-u+grass.dtile1x1-water-u+soil.dtilelib:tiles/water/1x1-water-u+soil.dtile1x1-water.dtilelib:tiles/water/1x1-water.dtile3x3-water.dtilelib:tiles/water/3x3-water.dtile
Generated from dharmatiles elements water by cargo xtask docs.
Sizes and levels
| Height above the base top | dmm | Notes |
|---|---|---|
| Calm water level | 2.6 | $waterSurfaceHeight. |
| Wave relief | −0.74 to +2.2 | About the water level; troughs are softly floored at −1.1. |
| Tide at the tile edge | ±0.6 | The shared edge profile (below). |
| Water bed | 0.4 | $waterBedHeight, 2.2 below the water level, where the bank ends. |
| Land top | 6.0 | The DungeonBlocks grass band. |
| Meadow ground (shore) | ≥ 3.4 | Hills, with grass on top. |
| Reeds | 8–13 tall | A 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
- Every water tile has the same wave shape along its edges: a sine of 0.6 mm amplitude and 17.5 mm wavelength (half a square), with crests at the square corners and edge centres. Inside 9 mm of the edge the water blends into this profile, and the ripples fade out within 4 mm. Two water tiles of any seed meet with no step.
- This profile is part of the edge contract, checked to within 0.05 mm on all four edges.
- Land meets the tile edge at the ground's edge level. Tile sizes and the edge contract are on the tile system page.
Rules
What this element always does. A change to one of these is a change to the element.
- A cloud top (
$waterSurfaceHeight + bell(-0.8dmm .. 0.8dmm)) makes the waves one smooth surface whose heights come up as often as the weighting says: calm, with rare crests. The edge pin keeps the water flush with its neighbours (Clouds). - Water covers its whole area up to its top; the shoreline comes from the dirt beneath it.
- The water is a layer of the terrain over the ground, not a skin: the shore is cut exactly where the water's top meets the ground, and where the water meets a tile's side the side shows its whole depth in water colour.
- Waves come from the obstacles: land sends strong ones, rocks and reeds listed before the water weak ones and small rings. Each kind of object sends its own range of wavelengths.
- A source's waves grow less clear with distance; open corners are very faint sources.
- Ripples are smoother at the shore and round rocks, and stroke ends fade like ripples.
- It is a body of the stack:
top=says how high it may be, as a band (a height, or a range[low .. high]),pinlines hold the band to a height at a place, andat=names the region it fills. Every water starts with the library's top,[$waterSurfaceHeight - 1.9dmm .. $waterSurfaceHeight + 3dmm], and a pin atedgesat$waterEdgeHeight, the tide. Water is built where it is listed, over the ground listed above it: what is listed after it stands in it or on the shore and reads it (grass keeps off the wet ground), and a dirt or ground listed after it lies over it. It eases over 9 mm round a pin.checkreads and solves these andbuildfills them. See pin, let and heights.
Printing and painting
- No supports. The water is one surface with exactly one height at every point, so nothing on it overhangs. Print base down at 0.2 mm layers.
- Nothing too fine. Crests are at least about 1 mm wide, the shortest waves are 2 mm apart, and there is no detail under 0.3 mm.
- Reeds stand up. Each reed is chunky at the base (about 3.4–4.6 mm wide) and leans no more than about 40° from vertical.
- Painting. Prime dark blue and drybrush lighter blues, then a near-white on the crest tips; the broad crests catch the brush and the troughs stay dark. The painted previews above follow this scheme.
- Checked on every build. Each STL is one watertight body that survives a float32 reload.
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.
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:
- Fill: water fills its area up to its level wherever the ground is lower, and is lifted with the ground as one surface.
- 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.
- 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.
- Shape: troughs are compressed softly above −1.1 mm (the bed is 2.2 mm down), and a small lip rises at every shore.
- 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.
