Skip to content

feat(worldgen): asteroid belts — shared orbit annuli, belt mining density & ring-colour families - #688

Merged
marceld23 merged 1 commit into
mainfrom
feat/asteroid-belts
Aug 3, 2026
Merged

feat(worldgen): asteroid belts — shared orbit annuli, belt mining density & ring-colour families#688
marceld23 merged 1 commit into
mainfrom
feat/asteroid-belts

Conversation

@marceld23

Copy link
Copy Markdown
Owner

Summary

Real asteroid belts (#683) + seeded planetary-ring colour families (#684).

Worldgen (new worlds only): all landable asteroids of a system now share 1–2 orbit annuli instead of scattering uniformly across the disc (which regularly parked them inside planet orbit lanes). The outer belt sits one orbit step beyond the outermost planet; big systems (5+ planets, 4+ asteroids) may roll a second, inner belt into a ≥620-unit gap between two planet orbits. Members occupy evenly spaced angular slots with a small wobble, so the flight-view clear-gap guarantee holds by construction. Geometry comes from new Hash01 salts (8xx series), never the body rng — and everything is gated on a new WorldDescription.AsteroidBelts flag (defaults false; ServerConfig's creation-time description carries true, mirroring SystemVariance; --belts off escape hatch), so existing universes regenerate byte-identically.

Mining density:

  • S1: launching from an asteroid body spawns a dense 9-rock local field instead of the classic trio (per-instance respawn target).
  • S2: every other asteroid body in the resident system carries a 4-rock mineable cluster at its flight-view position (server and client agree via the shared SystemBodyLayout.FlightViewScale; total capped at 24). Flying into the belt now means flying through rocks worth mining.
  • Fix along the way: a never-launched ship's CurrentLocationId holds the default planet TYPE ("varied"), not a body id — the space-instance anchor now falls back to the save's active location for the asteroid logic. The hostile-archetype lookup deliberately keeps the legacy raw-id behaviour so fresh-start difficulty in pirate-space starts is unchanged.

Flight chart: belt members are grouped by orbit radius and drawn as ONE translucent band with a localized label (ui.map.belt: "Asteroid belt" / "Asteroidengürtel") instead of N stacked orbit rings; legacy scattered worlds keep per-body rings.

Ring colours (#684): PlanetRings.TintFor now rolls a seeded material family per ring system — ice white (55 %), dusty tan (20 %), rocky grey (15 %), rare pale violet (10 %) — consistent across flight view, surface sky and horizon band. Retroactive-safe: same RingSeed → same tilt/bands, only richer tints.

Tests

  • New: UniverseTests.Belts_AsteroidsShareOneOrTwoAnnuli_ClearOfPlanetOrbits (annulus clustering, ≥200-unit clearance from every planet orbit, second-belt coverage), Belts_LeavePlanetsAndMoonsExactlyWhereTheLegacyLayoutPutThem, SpaceCombatTests.EnterSpace_ParksMineableClustersAtTheSystemsAsteroidBodies, EnterSpace_AtAnAsteroidBody_SpawnsADenseLocalField.
  • Extended: SystemBodyLayoutTests + SystemChartLayoutTests sweeps now include a belt-enabled pass; star-centring zoom budget raised 2.0→2.1 (measured ~2.01× with the outer belt, documented in the test).
  • Full non-Slow suites green locally: 1360 server + 147 client, 0 warnings (Release). Local Unity build succeeds.

closes #683
closes #684

🤖 Generated with Claude Code

@marceld23 marceld23 added enhancement New feature or request area: server GameServer / Networking / WorldHost / Api / Persistence area: client Unity client / Client.Core labels Aug 3, 2026
@marceld23 marceld23 self-assigned this Aug 3, 2026
@marceld23
marceld23 force-pushed the feat/asteroid-belts branch 3 times, most recently from 0651e08 to b2e62ae Compare August 3, 2026 15:26
…sity & ring-colour families (#683, #684)

Asteroids no longer scatter across planet orbits: new worlds place all landable
asteroids of a system on 1-2 shared belt annuli (outer belt one orbit step past
the outermost planet; big systems may roll an inner belt into a wide orbit gap),
gated on WorldDescription.AsteroidBelts so existing saves regenerate unchanged.
Every asteroid body carries a mineable rock cluster at its flight-view position
(shared SystemBodyLayout.FlightViewScale), launching from an asteroid spawns a
dense 9-rock field, and the flight chart draws grouped members as one localized
belt band instead of stacked orbit rings. Planetary rings additionally roll a
seeded colour family (ice/tan/grey/rare violet) instead of near-constant grey.

closes #683
closes #684

Co-Authored-By: Claude Fable 5 <[email protected]>
@marceld23
marceld23 force-pushed the feat/asteroid-belts branch from b2e62ae to 0802ec6 Compare August 3, 2026 15:36
@marceld23
marceld23 merged commit bf53db2 into main Aug 3, 2026
13 checks passed
@marceld23
marceld23 deleted the feat/asteroid-belts branch August 3, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: client Unity client / Client.Core area: server GameServer / Networking / WorldHost / Api / Persistence enhancement New feature or request

Projects

None yet

1 participant