Purpose: AI-readable reference for how all Structs entity types relate. Ownership graph, economic graph, and ID format system.
All entities use type-index format (e.g., 1-11, 2-1). Exception: StructType uses integer IDs only (e.g., 1, 2).
| Type Code | Entity | Example |
|---|---|---|
| 0 | Guild | 0-1 |
| 1 | Player | 1-11 |
| 2 | Planet | 2-1 |
| 3 | Reactor | 3-1 |
| 4 | Substation | 4-3 |
| 5 | Struct | 5-42 |
| 6 | Allocation | 6-1 |
| 7 | Infusion | 7-1 |
| 8 | Address | 8-1 |
| 9 | Fleet | 9-11 |
| 10 | Provider | 10-1 |
| 11 | Agreement | 11-1 |
Guild
└── hasMembers → Player
Player
├── owns → Planet (one at a time)
├── owns → Struct (many)
├── owns → Fleet (one)
├── owns → Reactor (many)
├── owns → Substation (many)
├── owns → Provider (many)
└── memberOf → Guild
Planet
├── ownedBy → Player
├── contains → Struct
├── contains → Reactor
└── contains → Substation
Fleet
├── ownedBy → Player
├── contains → Struct (slots)
└── status: station | away
Struct
├── ownedBy → Player
├── typeOf → StructType (integer ID)
└── locatedOn → Planet | Fleet
Provider (10-x)
├── ownedBy → Player
├── linkedTo → Substation (per DB schema)
└── hasAgreements → Agreement
Agreement (11-x)
├── providedBy → Provider
└── consumerId → Player
Allocation (6-x)
├── sourceId → Reactor | Provider
└── destinationId → Player | Struct
Flow: Provider offers capacity → Consumer opens Agreement → Allocation records energy flow from source to destination.
Reactor (3-x) → infuse Alpha Matter → produces kW
↓
Substation (4-x) → distributes to connected players
↓
Player.capacity, Player.capacitySecondary
↓
Struct.passiveDraw (when online)
Allocatable capacity: Only the player’s personal capacity (from infusions) can be allocated out. capacitySecondary (substation-provided) cannot. Formula: capacity - load. A substation delivers 90% of its incoming allocations to its connected players. See power.md.
Ore Refinery → refine complete → ualpha minted into Player VAULT (1-x)
↓ ↓
Reactor infuse (stake from vault) Guild Central Bank (mint from Guild VAULT 0-x; redeem/convert via Player VAULT)
↓ ↓
Generator infuse (burn from vault) Rank purchase: Player VAULT → Guild VAULT in uguild.<id>
Every player (1-x) and guild (0-x) owns exactly one deterministic vault account (structsd query structs vault [owner-id]). Refined Alpha, staking, generator fuel, agreement collateral and Central Bank operations all settle against vaults, not against the signing key’s wallet. playerInventory.rocks is the vault’s spendable ualpha. Move value out with vault-send or player-send from the vault address; the spending permission is the key’s token bits (PermTokenTransfer etc.) on the owner. See energy.md — Vaults.
| Category | Entities |
|---|---|
| core | Player, Planet, Struct, StructType, Fleet, Address, Permission |
| social | Guild |
| resource | Reactor, Substation |
| economic | Provider, Agreement, Allocation, Infusion |
| Constraint | Entities |
|---|---|
| One planet per player | Player, Planet |
| Planet must be empty (0 ore) to explore new | Planet |
| Command Ship required for building/raiding | Fleet, Struct |
| 1 Planetary Defense Cannon per player | Struct |
| 1 Command Ship per player | Struct |
| Agreements bind Provider → Player | Provider, Agreement |
| Relationship | Query |
|---|---|
| Player’s planets | GET /structs/planet_by_player/{playerId} |
| Planet’s structs | Filter structs by locationId = planetId |
| Player’s fleet | GET /structs/fleet → filter by ownerId |
| Agreements by provider | GET /structs/agreement_by_provider/{providerId} |
| Agreements for a guild (webapp) | No guild_id on agreements. Resolve guild → entry_substation_id → GET /api/provider/substation/{id}/page/{n} → GET /api/agreement/provider/{provider_id}/page/{n} |
| Allocations by source/dest | GET /structs/allocation_by_source/{id}, _by_destination/{id} |