← All tools Tool

TerraGen

Process-based terrain generator built for an AI to drive (Gaea's engine, none of its UI).

Version 2 · updated October 19, 2026

What it does

Process-based terrain generator built for an AI to drive (Gaea's engine, none of its UI). A terrain is a JSON node graph evaluated headless and deterministically: primitives (fbm, ridged, billow, Voronoi, ridgelines along polylines, coasts with a Dean shoreface and shelf), shape ops, and physically based processes on real units: implicit Braun-Willett stream-power fluvial erosion with sediment transport and deposition (Yuan et al. 2019), thermal talus weathering by hardness, priority-flood hydrology with lakes, rivers traced to the sea with widths/depths from catchment and levels only stepping down, channel beds and banks shaped from flow, plunge basins at knickpoints. Plan constraints keep a layout: towns on soft terraces, flat airfields, least-cost roads re-graded after erosion, an approved river course seeded into the drainage, resistance fed into erosion. Every node reports numbers and every build runs defect checks (dead flats, closed hollows, bank steps, perched water, rivers that do not reach water, sawtooth rims, terrace bands, town grades, road grades, hypsometry, drainage density, determinism, plan fidelity) and fails loudly. Writes 16-bit heightmaps, packed masks, river/lake/pool vectors, process fields (flow, wear, deposit, wetness, occlusion, age, exposure) for materials and ecology, and review pictures (hillshade, slope, flow, contours, cross-sections, eye-level renders, before/after compares).

Capabilities

What it's capable of

Nodes

Every op with its parameters (units, ranges), outputs and the grid it runs on, plus the recipe format.

Recipes

Saved recipes (built in and <workspace>/recipes) with descriptions and vars; show=<name> returns one graph as a worked example.

Plan

Validate a plan file (settlements, coast, river, lakes, roads, airports, ranges) and rasterize it: summary, conflicts (town over a lake, pad in the sea, overlapping towns) and a plan.png sheet.

Generate

Evaluate a recipe at a resolution, write <workspace>/out/<name>/ (heights, masks, vectors, process fields, manifest), run the checks (ok=false when a hard check fails) and return stats, check summary, preview and sheet paths. 513 takes about a minute; 4097 up to 10 min: give the shell command a 1200 s timeout.

Look

Pictures of an output: hillshade, slope, flow, contours (a crop around at), section (a cross-section along a line), eye (an eye-level software render from a point toward a target). Returns image paths to read.

Check

Run the defect checks C1-C14 on an existing output: pass/fail, numbers, worst spots (world meters) and a contact sheet of contour crops around them.

Compare

Two outputs side by side: hillshades, stats and per-check deltas. Use after every parameter change.

Export

Write the engine-facing files of an output into dest: terrain_<N>.png (16-bit, columns = first world axis by default), terrain_<N>.json, masks_<N>.npz, rivers_<N>.json, springs_<N>.json, pools_<N>.json, terrain_<N>_preview.png, process_<N>.npz; with_material_masks adds splat2_<N>.png (RGBA wear, deposit, wetness, occlusion).

Under the hood

What Claude can ask it to do

Get TerraGen and every other tool

One key and one pasted prompt. The Toolbox keeps itself up to date.

Install with your key