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.

4 relationship chains 12 tables involved v1.1.79

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.

Ships (iAttackID, iSkillEventID[]) Skills

Admirals → Ships

Admirals are bound to specific ship types via iMatchShipID. This determines which mothership an admiral can command.

Admirals (iMatchShipID) Ships

Admirals → Skills

Admirals also carry their own skill arrays, granting additional abilities beyond what the ship itself provides.

Admirals (SkillIDs[]) Skills

Bosses → Skills

Boss entries reference a single skill ID that defines the boss's attack pattern and special abilities.

Bosses (iSkillID) Skills
Summary

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 (sector/world/stage) Waves (ShipIDs[]) Ships

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.

Stages (eType) Bosses (same StageType key)
Summary

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 Skills (SkillID) Skills

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.

Gemstone Collections (EffectTypes) PropertyType enum
Summary

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.

Building (iUpgradeBuildIDs[]) Building (prerequisite chain)
Summary

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
GeneralShipTableiAttackIDGeneralSkillTable1 → 1
GeneralShipTableiSkillEventID[]GeneralSkillTable1 → N
GeneralAdmiralTableiMatchShipIDGeneralShipTable1 → 1
GeneralAdmiralTableSkillIDs[]GeneralSkillTable1 → N
GeneralContentsBossTableiSkillIDGeneralSkillTable1 → 1
GeneralStageTablesector/world/stageGeneralWaveTable1 → N
GeneralStageTableeTypeGeneralContentsBossTable1 → 1
GeneralWaveTableShipIDs[]GeneralShipTable1 → N
GeneralGemstoneSkillTableSkillIDGeneralSkillTable1 → 1
GeneralGemstoneCollectionTableEffectTypesPropertyType enum1 → N
GeneralBuildingTableiUpgradeBuildIDs[]GeneralBuildingTable1 → N