RhBake
The authoring-time bakes for **Railhead: Dust Sea**. Nothing here runs during a game; these are the one-shot generators that produce the world's durable content.
RhBake
The authoring-time bakes for Railhead: Dust Sea. Nothing here runs during a game; these are the one-shot generators that produce the world's durable content.
local Bake = require("RhBake")
Bake.terrain() -- ~1.5 s, writes /source/terrain/dust_sea.terrain
terrain()
Regenerates the Dust Sea heightfield — a 384 × 576 grid over 5.12 km × 8.96 km —
and saves it as a .terrain asset. This function is the authoritative
definition of the canyon's shape:
- Domain warping at two scales, so no edge in the landscape reads as an analytic curve.
- A three-tier gorge: a narrow inner channel, a mid bench of scree and buttes, and an upper rim wall, each with its own steep riser and flat bench. The tier widths open out as the canyon runs south.
- Side gullies notch every tier boundary in and out along Z, so the walls grow buttresses and re-entrants instead of running straight.
- Strata — horizontal rock banding sampled off the height itself, so the bands stay level across a wall no matter how it is shaped.
- Discrete rock spires placed one-per-jittered-grid-cell, most candidates rejected, each squashed and fluted differently. These are the Spire Mortar nests, and they are landmarks a gunner can call a range off.
- A boundary massif ringing the basin. Without it the patch edge is visible from the battery as a hard drop into open sky; the south range is the deepest because it terminates the 8 km sightline.
- Flattened pads for the Ridge Battery promontory and the Rig apron.
RhConfig.axisX, RhConfig.channelHalfWidth and RhConfig.benchHalfWidth
mirror the functions used here, because the gameplay code needs to agree with
the landscape about where the canyon is. Change the shape here and change
them there.
Edit mode only
Both bakes write to /source, which is write-locked while the world is
playing. Run them from edit mode.
Related
RhTerrain— samples the baked heightfield on the CPU, without uploading a mesh, which is what gameplay actually needs.RhConfig— the canyon shape functions gameplay reads.
Scoped to this part · feeds back into the world's score.