reduce how many legs newly discovered planet spreads on map - we should limit them to random 1-4 #51

Closed
opened 2026-10-06 12:53:48 +02:00 by kamilkrzywda · 1 comment
Owner

also try to make more circular connections so map size wont grow exponently

also try to make more circular connections so map size wont grow exponently
Author
Owner

Shipped — merged via PR #53 (auto-merge after CI green in ~3m), tagged v0.13.0 at master, deployed to production (space-wanderer.dev.kkhost.pl, /api/version reports 0.13.0).

Implementation summary:

  • generateRing now spreads a seeded-random 1-4 legs per undiscovered jump (was fixed 4), all draws from the existing expansionRng(seed, turn) stream in a fixed order.
  • Each leg has a 35% chance to close onto the existing chart (new two-way route to a random existing system) instead of minting a new one — more loops, ~2.3x slower map growth.
  • Frontier guarantee: at least one new system per discovery, so the map can never exhaust.
  • Fixed a latent ringEdges bug (self-loop at n=1, duplicate route at n=2 — both would violate the jump_routes PK); n>=3 output byte-identical, start region unchanged.
  • Tests: rewritten world.test.ts suite (pinned deterministic values, frontier guarantee, n>=3 byte-identity), updated save.test.ts (1-4 fresh systems; A/B full-DB byte-identity snapshot still green), new e2e smoke test (1-4 new systems, each undiscovered + routed to target, graph stays connected via BFS). Reviewer: approved, no findings.
Shipped — merged via PR #53 (auto-merge after CI green in ~3m), tagged **v0.13.0** at master, deployed to production (space-wanderer.dev.kkhost.pl, /api/version reports 0.13.0). Implementation summary: - generateRing now spreads a **seeded-random 1-4 legs** per undiscovered jump (was fixed 4), all draws from the existing expansionRng(seed, turn) stream in a fixed order. - Each leg has a 35% chance to **close onto the existing chart** (new two-way route to a random existing system) instead of minting a new one — more loops, ~2.3x slower map growth. - **Frontier guarantee**: at least one new system per discovery, so the map can never exhaust. - Fixed a latent ringEdges bug (self-loop at n=1, duplicate route at n=2 — both would violate the jump_routes PK); n>=3 output byte-identical, start region unchanged. - Tests: rewritten world.test.ts suite (pinned deterministic values, frontier guarantee, n>=3 byte-identity), updated save.test.ts (1-4 fresh systems; A/B full-DB byte-identity snapshot still green), new e2e smoke test (1-4 new systems, each undiscovered + routed to target, graph stays connected via BFS). Reviewer: approved, no findings.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/SpaceWanderer#51