Consolidate spatial docs into universe model

This commit is contained in:
2026-04-06 21:29:49 -04:00
parent 74b8bf4116
commit fdcf83ccec
15 changed files with 129 additions and 652 deletions

View File

@@ -26,7 +26,7 @@ The current simulation behavior is driven mostly by:
This gives the project a working prototype, but it does not yet reflect the design in:
- [SPACES.md](/home/jbourdon/repos/space-game/docs/SPACES.md)
- [UNIVERSE-MODEL.md](/home/jbourdon/repos/space-game/docs/UNIVERSE-MODEL.md)
- [COMMANDERS.md](/home/jbourdon/repos/space-game/docs/COMMANDERS.md)
- [ECONOMY.md](/home/jbourdon/repos/space-game/docs/ECONOMY.md)
- [WORKFORCE.md](/home/jbourdon/repos/space-game/docs/WORKFORCE.md)
@@ -53,11 +53,11 @@ Target design:
- `universe-space`
- `galaxy-space`
- `system-space`
- `local-space`
- node-attached local bubbles
- one structure per Lagrange point
- warp between nodes
- local gameplay inside bubbles
- `localspace`
- anchor-owned localspaces
- construction only at valid construction anchors
- warp between anchors within one system
- local gameplay inside localspaces
Current state:
@@ -66,16 +66,16 @@ Current state:
- resource nodes exist, but only as extractable asteroid/gas sites
- stations are positioned directly in system coordinates
- ships move by `Position` and `TargetPosition`
- no first-class system node graph
- no first-class local bubbles
- no first-class anchor graph
- no first-class localspaces
- no claim entities
- no construction-site entities
Primary gaps:
- [`RuntimeModels.cs`](/home/jbourdon/repos/space-game/apps/backend/Simulation/RuntimeModels.cs) has no `NodeRuntime`, `LocalBubbleRuntime`, `ClaimRuntime`, or `ConstructionSiteRuntime`.
- [`ScenarioLoader.cs`](/home/jbourdon/repos/space-game/apps/backend/Simulation/ScenarioLoader.cs) computes station positions directly instead of creating node-backed placement.
- [`SimulationEngine.cs`](/home/jbourdon/repos/space-game/apps/backend/Simulation/SimulationEngine.cs) still treats travel as raw coordinate movement rather than node-to-node transit between spaces.
- [`RuntimeModels.cs`](/home/jbourdon/repos/space-game/apps/backend/Simulation/RuntimeModels.cs) has no `AnchorRuntime`, `LocalspaceRuntime`, `ClaimRuntime`, or `ConstructionSiteRuntime`.
- [`ScenarioLoader.cs`](/home/jbourdon/repos/space-game/apps/backend/Simulation/ScenarioLoader.cs) computes station positions directly instead of creating anchor-backed placement.
- [`SimulationEngine.cs`](/home/jbourdon/repos/space-game/apps/backend/Simulation/SimulationEngine.cs) still treats travel as raw coordinate movement rather than anchor-to-anchor transit between spaces.
### Command and Control
@@ -202,12 +202,12 @@ Current state:
- viewer consumes a flat snapshot of systems, resource nodes, stations, ships, and factions
- systems are strategic and visual, but not tied to explicit multi-space simulation layers
- no contracts for bubbles, claims, construction sites, market orders, commanders, or policies
- no contracts for localspaces, claims, construction sites, market orders, commanders, or policies
Primary gaps:
- [`contracts.ts`](/home/jbourdon/repos/space-game/apps/viewer/src/contracts.ts) mirrors the old backend model.
- [`GameViewer.ts`](/home/jbourdon/repos/space-game/apps/viewer/src/GameViewer.ts) cannot render node graph, local bubbles, claims, or construction states because that data does not exist yet.
- [`GameViewer.ts`](/home/jbourdon/repos/space-game/apps/viewer/src/GameViewer.ts) cannot render an anchor graph, localspaces, claims, or construction states because that data does not exist yet.
## Subsystem Assessment
@@ -226,7 +226,7 @@ These should evolve in place.
- string-based ship state with explicit enums and structured movement state
- ship-only planning fields with commander/task-layer entities
- direct station placement with node, claim, and construction-site placement
- direct station placement with anchor, claim, and construction-site placement
- flat event records with typed event payloads
### Avoid
@@ -246,8 +246,8 @@ Goal:
Work:
- extend [`RuntimeModels.cs`](/home/jbourdon/repos/space-game/apps/backend/Simulation/RuntimeModels.cs) with:
- `NodeRuntime`
- `LocalBubbleRuntime`
- `AnchorRuntime`
- `LocalspaceRuntime`
- `CommanderRuntime`
- `ClaimRuntime`
- `ConstructionSiteRuntime`
@@ -261,33 +261,33 @@ Work:
- commander kinds
- add structured ship spatial state:
- current space layer
- current node
- current bubble
- current anchor
- current localspace
- current transit
Why first:
- every later change depends on this vocabulary existing in runtime state
### Phase 2: Refactor Scenario and World Building Around Nodes
### Phase 2: Refactor Scenario and World Building Around Anchors
Goal:
- make systems produce a real node graph with local bubbles and Lagrange-backed construction points
- make systems produce a real anchor graph with localspaces and supported construction anchors
Work:
- extend [`WorldDefinitions.cs`](/home/jbourdon/repos/space-game/apps/backend/Data/WorldDefinitions.cs) with authored node and claim-related definitions only where necessary
- extend [`WorldDefinitions.cs`](/home/jbourdon/repos/space-game/apps/backend/Data/WorldDefinitions.cs) with authored anchor and claim-related definitions only where necessary
- update [`ScenarioLoader.cs`](/home/jbourdon/repos/space-game/apps/backend/Simulation/ScenarioLoader.cs) to:
- generate system-space nodes for stars, planets, moons, stations, and Lagrange points
- attach local bubbles to nodes
- translate existing `planetIndex` and `lagrangeSide` station hints into actual node IDs
- generate system-space anchors for stars, planets, moons, Lagrange points, and resource nodes where appropriate
- attach localspaces to anchors
- translate existing `planetIndex` and `lagrangeSide` station hints into actual anchor IDs
- stop treating station placement as an arbitrary coordinate
- preserve current authored content while migrating scenario interpretation
Why second:
- movement, claims, construction, and viewer transitions all depend on real nodes
- movement, claims, construction, and viewer transitions all depend on real anchors
### Phase 3: Introduce Founding, Claims, and Construction Sites
@@ -303,7 +303,7 @@ Work:
- active
- destroyed
- add construction-site runtime state with:
- target node
- target anchor
- blueprint or constructible reference
- construction storage inventory
- construction buy orders
@@ -315,7 +315,7 @@ Work:
Why here:
- it lets the code start reflecting the station and Lagrange rules without requiring the full economy rewrite first
- it lets the code start reflecting the construction-anchor rules without requiring the full economy rewrite first
### Phase 4: Replace Raw Travel With Space-Aware Movement
@@ -326,8 +326,8 @@ Goal:
Work:
- replace direct long-range movement with:
- local thruster movement inside a bubble
- in-system warp between nodes
- local thruster movement inside a localspace
- in-system warp between anchors
- inter-system transit through gates or FTL
- update ship runtime in [`RuntimeModels.cs`](/home/jbourdon/repos/space-game/apps/backend/Simulation/RuntimeModels.cs)
- split movement logic in [`SimulationEngine.cs`](/home/jbourdon/repos/space-game/apps/backend/Simulation/SimulationEngine.cs) into clearer controllers or subsystems
@@ -335,7 +335,7 @@ Work:
Why here:
- this is the point where [SPACES.md](/home/jbourdon/repos/space-game/docs/SPACES.md) starts becoming real in the simulation
- this is the point where [UNIVERSE-MODEL.md](/home/jbourdon/repos/space-game/docs/UNIVERSE-MODEL.md) starts becoming real in the simulation
### Phase 5: Introduce Commanders and Task Layers
@@ -376,7 +376,7 @@ Work:
Why here:
- once commanders and nodes exist, this becomes a coherent system instead of isolated resource transfers
- once commanders and anchors exist, this becomes a coherent system instead of isolated resource transfers
### Phase 7: Upgrade Events and Streaming
@@ -391,7 +391,7 @@ Work:
- universe
- galaxy
- system
- local bubble
- localspace
- refactor [`WorldService.cs`](/home/jbourdon/repos/space-game/apps/backend/Simulation/WorldService.cs) so subscriptions are observer-scoped rather than globally broadcast
- support higher-space streaming with filtering into lower-space views
@@ -408,8 +408,8 @@ Goal:
Work:
- extend [`contracts.ts`](/home/jbourdon/repos/space-game/apps/viewer/src/contracts.ts) for:
- nodes
- local bubbles
- anchors
- localspaces
- claims
- construction sites
- market orders
@@ -417,8 +417,8 @@ Work:
- richer ship movement state
- update [`GameViewer.ts`](/home/jbourdon/repos/space-game/apps/viewer/src/GameViewer.ts) to support:
- galaxy/system/local scale transitions
- node-centric system view
- local bubble detail
- anchor-centric system view
- localspace detail
- regime-aware ship rendering
Why last: