W1 spike: overworld schematic generator (epic #1640) - #1646
Draft
100yenadmin wants to merge 1 commit into
Draft
Conversation
New tools/overworld/ package (new files only, no existing files touched): heightfield fBm -> D8 hydrology (vector rivers) -> biome table -> Poisson/habitability settlements -> A* roads + auto bridges. Emits overworld.json + biome_map.png + height_map.png + area_constraints.json (the downstream per-area edge-constraint contract). Pure numpy+PIL, zero LLM/CU spend; ~6s at 1024². render_worldmap.py stylizes the schematic; seed_overworld_locations.py is a DRY-RUN engine-shape preview. Design references (ideas only, noncommercial licence blocks their code): OpenMMO doc/TERRAIN_GENERATION.md.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| import json | ||
| import sys | ||
| import time | ||
| from dataclasses import asdict, dataclass, field |
| and length; bridges are the river crossings recorded as explicit nodes that | ||
| reference BOTH the road and the river they join. | ||
| """ | ||
| h, w = cost_full.shape |
| and length; bridges are the river crossings recorded as explicit nodes that | ||
| reference BOTH the road and the river they join. | ||
| """ | ||
| h, w = cost_full.shape |
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.
W1 spike — overworld schematic generator
Deterministic, seeded, CPU-only, zero LLM/CU spend overworld schematic generator for The World Layer (epic #1640, Option C step W1). Pure
stdlib + numpy + PIL— no new deps. New files only, undertools/overworld/; no existing file touched.Seed 42 (1024², generated in ~6s)
Stylized world map (hillshade + biome tint + river/road vectors + settlements):
Raw biome schematic (rivers rasterized in):
Seed 7 (a second seed, same pipeline):
Pipeline
biome-featureslots.Output contract (all under
--out)overworld.json— seed, params, settlements[], rivers[] (polylines+widths), roads[], bridges[], region grid.biome_map.png+height_map.png.area_constraints.json— the key downstream contract: one proposed AREA per settlement and per river/road crossing, each withedge_constraints(which edge a river/road enters, at what fraction, width). A future outdoor-area generator consumes exactly this so discrete painted areas stay globally coherent.seed_overworld_locations.py— DRY-RUN preview mapping the schematic to the engine'sLocation/WorldGraphNodeshape (prints JSON; touches no engine state).Tests
7 offline pytest cases (determinism, rivers-flow-downhill, roads-connect-two-settlements, bridges-on-both-vectors, constraints-reference-real-features, settlements-on-land, engine-shape preview). Green in 0.85s:
Honest quality notes (seed 42)
Design references
Two-resolution terrain, vector rivers/roads, D8-flow hydrology, Poisson settlements + habitability, A* roads + auto bridges are design references (ideas only, no code) from OpenMMO's
doc/TERRAIN_GENERATION.md— their licence is noncommercial and blocks code reuse, not concepts.Closes nothing; part of epic #1640. Draft — do not merge.