Cross-Table Relationships
How Darkstar's data tables reference each other. Foreign-key chains traced through IL2CPP struct fields — from combat linkages and stage progression to gemstone effects and building tech trees.
Combat Chain
The combat system links ships, admirals, bosses, and skills through foreign-key
integer fields. Every combat entity ultimately resolves to one or more
GeneralSkillTable entries that define what happens during battle.
Ships → Skills
Each ship carries a primary attack ID and an array of skill event IDs. These reference entries in the skill table to determine the ship's combat behaviour.
Admirals → Ships
Admirals are bound to specific ship types via iMatchShipID. This
determines which mothership an admiral can command.
Admirals → Skills
Admirals also carry their own skill arrays, granting additional abilities beyond what the ship itself provides.
Bosses → Skills
Boss entries reference a single skill ID that defines the boss's attack pattern and special abilities.
Skills are the terminal node of every combat chain. Ships reference them via
attack and event arrays; admirals add their own skill sets on top; bosses each
carry a single skill reference. Resolving any combat entity means following
these IDs into GeneralSkillTable.
Stage Progression
The stage system chains three tables together to define what the player fights at each point in the game. Stages also link laterally to the boss table for boss encounters.
Stages → Waves → Ships
Each stage is keyed by a (sector, world, stage) tuple and contains
references to wave entries. Each wave in turn holds an array of ship IDs that
define the enemy formation for that wave.
Stages → Bosses
Stages and bosses share a StageType key via the eType
field. When a stage's type matches a boss entry, that boss appears as the
stage's boss encounter.
Stage progression resolves in two directions: vertically through waves into
individual enemy ships, and laterally into the boss table via a shared
StageType enum. Together these define the complete enemy lineup
for any given stage.
Gemstone Chain
The gemstone system uses four sub-tables. Two of these link outward to the
shared skill table and the PropertyType enum for their effects.
Gemstone Skills → Skills
Gemstone skill entries reference the main skill table by ID, reusing the same skill definitions that ships and admirals use.
Gemstone Collections → PropertyType
Collection bonuses specify their effects using EffectTypes that
map to the PropertyType enum — the same 132+ value enum
used across all effect systems in the game.
Gemstones connect to the broader game through two paths: skill references
that reuse the shared GeneralSkillTable, and effect-type
references that resolve to the universal PropertyType enum.
Building Tech Tree
The building system forms a self-referential prerequisite chain. Each building entry can list other buildings that must be upgraded first, creating a directed acyclic graph (DAG) of dependencies.
Building → Building (prerequisites)
The iUpgradeBuildIDs[] array on each building entry points back
into the same GeneralBuildingTable, defining which other buildings
must reach a required level before this one can be upgraded.
Unlike the other chains, the building tech tree is self-referential. Each
building's iUpgradeBuildIDs[] array creates a prerequisite DAG
within the same table, defining the unlock order for base upgrades.
Full Relationship Map
The following table summarises every cross-table foreign key extracted so far, grouped by source table.
| Source Table | Field | Target Table | Cardinality |
|---|---|---|---|
GeneralShipTable | iAttackID | GeneralSkillTable | 1 → 1 |
GeneralShipTable | iSkillEventID[] | GeneralSkillTable | 1 → N |
GeneralAdmiralTable | iMatchShipID | GeneralShipTable | 1 → 1 |
GeneralAdmiralTable | SkillIDs[] | GeneralSkillTable | 1 → N |
GeneralContentsBossTable | iSkillID | GeneralSkillTable | 1 → 1 |
GeneralStageTable | sector/world/stage | GeneralWaveTable | 1 → N |
GeneralStageTable | eType | GeneralContentsBossTable | 1 → 1 |
GeneralWaveTable | ShipIDs[] | GeneralShipTable | 1 → N |
GeneralGemstoneSkillTable | SkillID | GeneralSkillTable | 1 → 1 |
GeneralGemstoneCollectionTable | EffectTypes | PropertyType enum | 1 → N |
GeneralBuildingTable | iUpgradeBuildIDs[] | GeneralBuildingTable | 1 → N |