← Paracosm·Docs/Handbook
Contents · Terrain and the ground

Terrain and the ground

The region is 256 x 256 m with a 1 m terrain vertex grid. In this build the water plane is at 20 m, and the generated heights put H = 0 at 20 m, so the sea and an inland pool (its floor carved below 20 m) both hold water.

Making the land

1. Generate the land, then load it as a RAW32 heightmap

tools/make_paracosm_terrain.js <seed> drives an external terrain-simulation library (uplift, thermal and hydraulic erosion, a coastal pass; not included in this repo) and writes assets/terrain_data.json; tools/make_terrain_outputs.py <vscale> turns it into assets/paracosm.r32 (256 x 256 little-endian float32, metres) plus a relief map to check the features by eye. Load it with the console: wb("console", command="terrain load <path>.r32"). Save the current terrain first (terrain save) so it can be restored with terrain load.

2. Edit single vertices with terrain op=set radius=0.5

At an integer (cx, cy), op=set with radius=0.5 sets exactly ONE heightmap vertex. Keep the originals in a JSON backup and restore from it first, so a re-cut is idempotent.

3. Keep ONE record of the ground as it is now

Every tool that edits terrain records the heights it set; every tool that places things on the ground reads from that record.

4. Record NATURAL heights once for anything you cut

A rebuild that reads terrain_now takes its own earlier cut for the hill. Keep the natural heights in a JSON beside the builder and read them on every rebuild.

Building on slopes

5. A building on a slope: cut, shelve, blend, close

Cut every vertex under the floor below the slab, a shelf just under floor level round the walls, blend back to the slope over about 2 m, and close the exposed underside with a plinth. The viewer triangulates between 1 m vertices, so a keep-out must reach about 1.2 m past the walls.

6. A level platform over a slope floats: build a terrace

A retaining wall from wherever the ground is up to the floor, and where the floor cuts INTO the hill, a revetment facing in from under the floor up to the hill. Cut the terrain vertices inside the outline down to just under the floor, then terrain_now.record.

7. Dry-stone walls batter

A dry-stone wall's foot stands out and its face leans back as it rises (offset outward by the batter times the height below the top). The dark void skin behind the stones must lean with them.

8. Place openings from the thing people move along

Place every window slit in a stair tower from the stair: a helper gives the tread height at a wall angle, and a slit goes at tread + 1.25..2.05 m (eye height).

Water on the ground

9. Fit the water to the ground, not the ground to the water

A stream about a metre wide cannot have a carved bed and banks inside a 1 m vertex grid.

10. Running water is a ribbon mesh, not prim slabs

Straight prim slabs on a bending slope float and meet at plumb joins. A ribbon sampled about every 0.2 m follows the ground (a running minimum so it never climbs) or a fall's parabola, with edge skirts, and a scrolling texture (motion.md).

11. Find a water body from the live terrain

Flood-fill below the water line from its deepest point; if the fill reaches the box edge it is the sea.

Things that lie ON the ground

12. Drape, do not set down

A box set level on a slope floats downhill and pokes in uphill.

13. Paths go round buildings and end at the door

Ground textures

14. The ground is four textures blended by height

Stock: dirt, grass, mountain, rock over a 10-60 m band. An estate-owner script may swap them (osSetTerrainTexture(0..3, key)) and move the band (osSetTerrainTextureHeight). The stock textures can be read out of Asset.db (table assets, columns UUID and Data, J2C) to derive variants that still look like the region. The four stock UUIDs are listed in tools/build_snowline.py.

15. A PBR viewer is sent the PBR terrain slots

A viewer that declares PBR terrain support (Firestorm 7.x) is sent TerrainPBR1-4 in the region handshake, not TerrainTexture1-4, and unpatched OpenSim set only the legacy slots from a script: the database changed and the viewer drew the stock ground.

16. Cover by coverage fraction

Snow cover textures are set by COVERAGE FRACTION (the threshold is a quantile of a drift-and-hollow field), not by a fixed value.