Skip to content

Add rare procedural world regions - #5

Merged
NetGraniz merged 11 commits into
mainfrom
feature/world-regions
Aug 22, 2026
Merged

NetGraniz merged 11 commits into
mainfrom
feature/world-regions

Conversation

@NetGraniz

Copy link
Copy Markdown
Owner

Summary

Adds a deterministic logical-distance region system while preserving the existing chunk streamer, floating origin, vehicle physics, autopilot, and vegetation pipeline.

  • Adds rare FIELDS, COAST, and RIVER_BRIDGE regions around the default FOREST world.
  • Guarantees at least 100 km of forest between special regions, plus a seeded 0–60 km interval.
  • Uses a deterministic shuffle bag so all three special types recur without permanent repetition.
  • Blends road curvature, elevation, terrain, colors, and vegetation at region boundaries.
  • Adds chunk-owned procedural coast/river water.
  • Builds the 1008 m bridge from 14 normal 72 m world chunks, including deck, rails, beams, and piers.
  • Adds bridge driving-surface support for vehicle physics and autopilot.
  • Adds F3 region diagnostics and development-only F8/F9/F10 region jumps.
  • Adds npm run test:regions for deterministic scheduling, road continuity, bridge surface, floating-origin, and chunk lifecycle probes.

Main files

  • src/world/WorldRegionDirector.ts
  • src/world/RoadGenerator.ts
  • src/world/WorldChunk.ts
  • src/world/VegetationChunkRenderer.ts
  • src/world/WorldMaterials.ts
  • src/world/InfiniteWorld.ts
  • src/game/Game.ts
  • src/input/InputManager.ts
  • scripts/run-region-probes.mjs

First regions for seed 731947

ID Type Start End
1 COAST 131.099 km 141.951 km
2 RIVER_BRIDGE 285.090 km 289.704 km
3 FIELDS 439.383 km 448.772 km
4 FIELDS 584.746 km 592.491 km
5 RIVER_BRIDGE 748.990 km 753.179 km
6 COAST 871.476 km 880.500 km

The first bridge runs from 286.920 km to 287.928 km (1008 m).

Automated verification

  • 1000 km schedule: PASS
  • Special region counts: FIELDS 2 / COAST 2 / RIVER_BRIDGE 2
  • Minimum forest gap: 118.298 km
  • Same-seed determinism: PASS
  • Different-seed schedule: PASS
  • Road continuity: PASS
  • Bridge driving surface: PASS
  • 500 km lifecycle/floating-origin test: PASS
  • Maximum active chunks: 20
  • Maximum active bridge sections: 14
  • Maximum scene objects observed: 2599
  • npm run typecheck: PASS
  • npm run build: PASS

Performance / known limitations

  • Region geometry uses the existing chunk lifecycle and pooling; active chunk count does not increase after special regions.
  • Region sampling avoids per-sample array allocation.
  • Water and bridge sections are chunk-owned and unload with their chunks.
  • Exact browser FPS per region still needs manual GPU/browser measurement. The built-in browser automation was unavailable in this run, so this remains a draft PR for visual/FPS review.
  • The existing Vite large-bundle warning remains unchanged in nature; the production build succeeds.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
roads 9a9c2a9 Commit Preview URL

Branch Preview URL
Aug 22 2026, 08:37 AM

@NetGraniz
NetGraniz merged commit 9a9c2a9 into main Aug 22, 2026
3 checks passed
@NetGraniz
NetGraniz deleted the feature/world-regions branch November 29, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant