Repository navigation
generated_world G1: terrain sources, generators by name, the terrain as a geometry source - #976
Merged
Merged
Conversation
…as a geometry source
- cvc::world::terrain_source (sample, slope, bounds, datum, optional buildable / channel / cliff
masks); heightfield implements it; raster_heightfield is a gridded relief for any generator's
DEM; sample_terrain rasterizes any source; read_npy + load_dem read an elevation .npy.
world_model, raster(), the scatter and the city take the interface.
- Generators by name: generated_world_params::terrain ("fbm", "dem") and ::city ("districts",
"none"), register_terrain_generator / register_city_generator for a host's own. The
generated_world node reads terrain: / city: / terrain_file:, seeds world.terrain / world.city /
world.terrain_file, publishes the registered names, and keeps the world on a failure with the
error in world.status; world_controls.ari gets Terrain and City combos.
- The terrain as a geometry source: source: { terrain: {...} }, or a heightfield with a
generator: (its layers add on top).
- Fixes: the fBm seed was XORed with itself, so every seed had the same ground (the default
world is now seed 5); the city's buildings were never in the material / occupancy raster;
terrain cells read the raster half a cell off; distance_to_road scanned every segment when no
road was within about 30 to 60 m (distance_within bounds a query): a 5 km world generated in
10 s and now takes about 1.4 s natively.
- GENERATED-WORLD-ROADMAP.md revision 3; ARIADNE.md; a new gallery thumbnail.
transfix
enabled auto-merge (squash)
November 2, 2026 19:09
…hanged-lines check formats it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
G1 of
docs/roadmap/GENERATED-WORLD-ROADMAP.md(now revision 3): one terrain interface, generators switchable by name, and the terrain as an Ariadne geometry source.Terrain sources
cvc::world::terrain_source(inc/cvc/world/terrain_source.h):sample,slope_deg,bounds(), the datum the raster's classes scale by (sea_level_m,relief_m), and optionalbuildable/channel/cliffmasks.world::heightfieldimplements it.raster_heightfield: a gridded relief (bilinear, clamped to its edge, optional mask planes) for any generator's DEM.sample_terrainrasterizes any source;read_npyandload_demread an elevation.npy(anchored at 0, stretched to the relief).world_model(terrain()),raster(), the scatter and the city take the interface;world_params::terrainhands one in.Generators by name
generated_world_params::terrain(fbm,dem) and::city(districts,none), plusterrain_file.register_terrain_generator/register_city_generatoradd a host's own; an unknown name throws before any work.generated_worldnode readsterrain:/city:/terrain_file:, seedsworld.terrain/world.city/world.terrain_file, and publishes the registered names forworld_controls.ari's new Terrain and City combos. A failing generator keeps the world and reports the error inworld.status.The terrain as a geometry source
source: { terrain: { generator, size, resolution, seed, amp, file, preset } }in any document, orheightfield: { generator: ... }with its layers on top. It is a heightfield, soground:, bodies and band colours work on it.Bugs fixed on the way
road_network::distance_to_roadscanned every segment when no road was within about 30–60 m, which on a big world is most queries. Newdistance_within(x, y, r)bounds a query (used byon_or_near_roadand the lots' block-depth probe), anddistance_to_roadwidens its window instead of scanning. Results are unchanged.Measured (native Release, this box,
CVC_TL_PROF=1 terrain_lab --half H): a 5 km world (half 2500) generated in 10.0 s, 8.0 s of it in the city's proximity queries; it now takes about 1.4 s (city 8,041 → 132 ms). A 1.2 km world takes about 0.5 s. The World half slider already goes to 10 km.Tested locally (Windows, MSVC 14.44, Release): world_terrain (6, new), world_generated (13), world_roads (12), world_sites (14), world_raster, world_scatter, world_heightfield, world_bundle, world_geometry, world_buildings, world_road_mesh, world_road_raster, world_surface, nav_world_planes, nav_material_raster, system_macro_headers, physics_world, ariadne_loader (214 incl. the new TerrainSource;
AriadneUri.StoreFileAtomicallyOverwritesfailed once and passed 5/5 on rerun, a Windows rename flake in the URI store), cvcgl_ariadne_realize (new checks: published generator names, a city switch, an unknown generator kept, the terrain source matches the fbm generator) and cvcgl_ariadne_physics. arigl rendersterrain_lab.ari(new thumbnail). Not run: the wasm build and browser timing; the gallery deploy is broken on master until #975 merges.Still to do in G1's area: a polyline →
road_networkconverter for an imported street map, and a service road kind.