[FEATURE] RimWorld-style map generation: mountains, rivers, lakes, forests #52

Open
opened 2026-10-20 12:31:20 +02:00 by agent-claude · 1 comment
Collaborator

Problem

generateColonyMap rolls every tile independently against biome percentages. The result is salt-and-pepper static: isolated single-tile rocks everywhere, with no mountains, rivers, lakes or forests. Maps feel samey across biomes, and the world tile's hilliness and rainfall are ignored.

Plan (RimWorld-style terrain)

  • Deterministic coherent noise (fBm value noise with domain warping) in a new sim-core/src/noise.ts.
  • Mountains: elevation field scaled by world-tile hilliness (Flat → Mountainous). On hilly tiles a range rolls in from one side. Gravel foothills, stone-type bands, and mineable salvage alloy veins inside the rock.
  • Water: lakes and ponds driven by rainfall. Meandering rivers with shallow banks, a deep impassable center, fords, and fertile riverbanks. New terrains deep_water, shallow_water, gravel, alloy_vein.
  • Soil, vegetation: biome-specific soil patches, beaches and marsh fringes, clustered forests and berry thickets.
  • Guarantees: a clear, dry landing site, and every map edge reachable from the colony (passes are carved if needed). Raids and wanderers spawn only on reachable edge tiles. Air over water counts as outdoors for room detection, and crops can't be sown on infertile ground.
  • Client procedural textures for the new terrains.
## Problem `generateColonyMap` rolls every tile independently against biome percentages. The result is salt-and-pepper static: isolated single-tile rocks everywhere, with no mountains, rivers, lakes or forests. Maps feel samey across biomes, and the world tile's `hilliness` and rainfall are ignored. ## Plan (RimWorld-style terrain) - Deterministic coherent noise (fBm value noise with domain warping) in a new `sim-core/src/noise.ts`. - **Mountains**: elevation field scaled by world-tile hilliness (Flat → Mountainous). On hilly tiles a range rolls in from one side. Gravel foothills, stone-type bands, and mineable **salvage alloy veins** inside the rock. - **Water**: lakes and ponds driven by rainfall. Meandering **rivers** with shallow banks, a deep impassable center, fords, and fertile riverbanks. New terrains `deep_water`, `shallow_water`, `gravel`, `alloy_vein`. - **Soil, vegetation**: biome-specific soil patches, beaches and marsh fringes, clustered forests and berry thickets. - **Guarantees**: a clear, dry landing site, and every map edge reachable from the colony (passes are carved if needed). Raids and wanderers spawn only on reachable edge tiles. Air over water counts as outdoors for room detection, and crops can't be sown on infertile ground. - Client procedural textures for the new terrains.
Author
Collaborator

Handoff (agent-claude): PR #53 is ready for review.

Done:

  • New noise.ts and terrain-gen.ts generate mountains (scaled by hilliness), lakes, rivers, soils, forests and ruins; map-gen.ts now delegates to them.
  • New terrains: shallow_water, deep_water, gravel, alloy_vein, each with a client texture.
  • Alloy veins are mineable; raids and wanderers spawn only on reachable edges; no sowing on fertility-0 ground; water counts as open air for room detection.
  • Fixed the silver_coin caravan bug.

Remaining: peer review, then merge approval from @johnw. Optional follow-up: a more natural Blender fertile_loam.png sprite.

Gotchas:

  • terrain-gen uses its own RNG stream (seed ^ 0x5bd1e995), so the colony RNG sequence is unchanged by terrain tweaks.
  • Any code that adds impassable terrain must keep edges reachable. floodFrom() is exported for that check.
  • Existing saved colonies keep their old terrain.
Handoff (agent-claude): PR #53 is ready for review. Done: - New noise.ts and terrain-gen.ts generate mountains (scaled by hilliness), lakes, rivers, soils, forests and ruins; map-gen.ts now delegates to them. - New terrains: shallow_water, deep_water, gravel, alloy_vein, each with a client texture. - Alloy veins are mineable; raids and wanderers spawn only on reachable edges; no sowing on fertility-0 ground; water counts as open air for room detection. - Fixed the silver_coin caravan bug. Remaining: peer review, then merge approval from @johnw. Optional follow-up: a more natural Blender fertile_loam.png sprite. Gotchas: - terrain-gen uses its own RNG stream (seed ^ 0x5bd1e995), so the colony RNG sequence is unchanged by terrain tweaks. - Any code that adds impassable terrain must keep edges reachable. floodFrom() is exported for that check. - Existing saved colonies keep their old terrain.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
game-dev/RicosWorld#52
No description provided.