8.9 KiB
Data Model
This document defines the intended high-level data model for the simulation.
It is a design-side schema document. It does not describe the current codebase exactly. It describes the durable entity vocabulary the codebase should move toward.
Design Goals
The data model should support:
- the layered spatial model
- commander-driven behavior
- market-driven economy
- module-based capability
- population and workforce
- claimable construction sites
- local-space combat
- scalable replication and future sharding
Core Principles
- important game concepts should exist as explicit entities or records
- IDs should be stable and durable
- spatial state should be explicit, not inferred from one generic position alone
- access, market, and behavior restrictions should be data-driven
- construction, production, and logistics should all use shared entity vocabulary
Identity
Every major persistent entity should have:
- a stable ID
- an owning faction where relevant
- a type or kind
- a current lifecycle or state
Recommended global ID families:
factionIdcommanderIdsystemIdnodeIdbubbleIdstationIdshipIdmoduleIdclaimIdorderIdrecipeIdpolicyIdmarketOrderIdconstructionSiteId
Core Entity Set
The intended core entities are:
FactionCommanderSystemNodeLocalBubbleStationShipModuleInstanceClaimConstructionSiteMarketOrderRecipePolicySet
Faction
A faction is the top-level strategic actor.
Suggested fields:
factionIdlabelcolordoctrinepopulationTotalcreditsif retainedrelation state to other factionscommanderIdspolicy defaults
Commander
Commanders are first-class AI actors.
Suggested fields:
commanderIdkindownerFactionIdparentCommanderId?controlledEntityId?doctrinepolicy overridesgoal setsubordinateCommanderIdsalive
Recommended commander kinds:
factionstationshipfleetsectortask-group
System
A system is a strategic world entity in galaxy space.
Suggested fields:
systemIdlabelgalaxyPositionstar definitionnodeIdsfaction influence later
Node
A node is a meaningful location in system space that owns a local bubble.
Suggested fields:
nodeIdsystemIdkindsystemPositionbubbleIdparentNodeId?orbital metadata?occupyingStructureId?
Recommended node kinds:
starplanetmoonlagrange-pointstationgateresource-sitestructure
LocalBubble
A local bubble is the tactical simulation context attached to one node.
Suggested fields:
bubbleIdnodeIdsystemIdradiusoccupantShipIdsoccupantStationIdsoccupantClaimIdsoccupantConstructionSiteIdsserverAuthorityId later
Station
A station is a structure attached to a Lagrange-point node.
Suggested fields:
stationIdownerFactionIdcommanderId?nodeIdsystemIdbubbleIdmoduleIdsinventorypopulationworkforceCapacityworkforceEfficiencypower statepolicySetId?marketOrderIdsconstruction state if incompletedocking state
Ship
A ship is a mobile actor that changes movement regime over time.
Suggested fields:
shipIdownerFactionIdcommanderId?shipClassrolemoduleIdsinventoryhealthpower statecurrentSpatialStatepolicySetId?current goal/order/task references
ModuleInstance
A module instance is a fitted capability component on a ship or station.
Suggested fields:
moduleIddefinitionIdhostKindhostIdcategoryoperational stateconstruction stateworkforceRequirementpower requirement
Recommended host kinds:
shipstation
Claim
A claim is a vulnerable object placed at a Lagrange point before construction.
Suggested fields:
claimIdownerFactionIdcommanderId?systemIdnodeIdbubbleIdplacedAtactivatesAtstatehealth
Recommended claim states:
placedactivatingactivedestroyed
ConstructionSite
A construction site is the market-facing and build-facing record for an incomplete structure or expansion.
Suggested fields:
constructionSiteIdownerFactionIdnodeIdbubbleIdtargetKindtargetDefinitionIdrequiredItemsdeliveredItemsprogressassignedConstructorIdsmarketOrderIdsstate
Recommended target kinds:
stationstation-moduleship later
MarketOrder
A market order expresses station-side demand or supply.
Suggested fields:
marketOrderIdstationIdorconstructionSiteIdownerFactionIdkinditemIdamountremainingAmountvaluationreserveThreshold?policy restrictionsstate
Recommended market order kinds:
buysell
Recommended market order states:
openpartially-filledfilledcancelledexpired later
Recipe
A recipe defines a conversion from inputs to outputs.
Suggested fields:
recipeIdlabelinputItemsoutputItemscycleTimevalidModuleCategoriespowerRequirement?workforceModifier?
PolicySet
A policy set defines access and restriction rules.
Suggested fields:
policySetIdownerKindownerIdtradeAccessPolicydockingAccessPolicyconstructionAccessPolicyoperationalRangePolicyhostility rules later
Recommended owner kinds:
factionstationcommandership
Spatial State
Ships should not be modeled with only one generic position and target.
Recommended ship spatial state fields:
spaceLayercurrentSystemIdcurrentNodeId?currentBubbleId?localPosition?systemPosition?movementRegimedestinationNodeId?transitState?
Recommended space layers:
universe-spacegalaxy-spacesystem-spacelocal-space
Recommended movement regimes:
local-flightwarpstargate-transitftl-transit
Population State
Population should remain explicit rather than hidden in generic inventory only.
Suggested station-side workforce fields:
populationpopulationCapacityworkforceRequiredworkforceEffectiveRatioworkerConsumptionRates
Commanders should not be ordinary cargo items even if they are population-derived.
Inventories
Inventories should remain generic item maps, but hosts should also have explicit context.
Recommended inventory host kinds:
shipstationconstruction-site
This prevents construction storage from being a special-case invisible system.
Ownership vs Access
The model should separate:
- ownership
- commander control
- policy-based access
- current occupancy
These are not the same thing.
Examples:
- a faction owns a station
- a station commander operates it
- another faction may be allowed to trade there
- multiple factions may be present in the same system
Minimum Enums
The following enum families should exist somewhere in the model:
SpaceLayerMovementRegimeNodeKindCommanderKindModuleCategoryMarketOrderKindMarketOrderStateClaimStateConstructionTargetKindTradeAccessPolicyDockingAccessPolicyOrderStateTaskStateTaskKind
Replication Implication
This entity model is also intended to support replication.
That means entity shape should make it easy to stream:
- strategic summaries from higher layers
- detailed updates from lower layers
- explicit lifecycle changes
- explicit claim, market, and construction updates
See EVENTS.md for the typed event layer built on top of this model.
Minimum Rules
The following rules should remain true unless deliberately revised:
- important world concepts should have explicit records
- ships need explicit spatial state
- claims and construction sites are real entities
- market orders are real entities
- modules are real instances attached to hosts
- policy is separate from ownership
- population is explicit at the station level
Relationship To Other Documents
-
- defines the layered world structure
-
- defines commander roles and hierarchy
-
- defines market behavior
-
- defines capability-bearing module instances
-
- defines population and commander generation
-
- defines the policy sets attached to entities
-
- defines the execution-layer fields that entities should carry