Faction field — dead config
What this is
ShipDef.faction is a typed field on every ship entry in src/starship-survivors/data/ships.ts. It exists on the ShipDef interface, has its own union type Faction, and is written to every one of the 300 generated ship entries (60 hull classes × 5 stars in code; 37 hulls present in the rarity table at this commit). Despite being typed and populated, the value is never branched on, never read by gameplay, and does not describe the ship’s actual faction.
The Faction union is declared as:
| Type member |
|---|
angel_corp |
crystal_casino |
solaris |
wrongsiders |
The actual grouping
Real faction grouping comes from the hull-key prefix in SHIPS_V4_RARITY (defined in src/starship-survivors/data/ships-v4-rarity.ts). Each hull key is Faction_Name with the faction prefix preserved verbatim. The wiki, UI, and displayHullName() (which strips everything before the first underscore) all key off this prefix.
Six real factions are present at this commit:
| Faction prefix | Hull count |
|---|---|
Solaris_ | 9 |
Industria_ | 8 |
Junkrats_ | 8 |
Prism_ | 6 |
Backwater_ | 4 |
Ancients_ | 2 |
| Total | 37 |
None of these prefix names appear in the Faction union type. The union still references angel_corp, crystal_casino, and wrongsiders — none of which are present as hull prefixes.
Where the false faction shows up
The generator loop assigns the baseline value to every ship regardless of hull:
| Location | Value written |
|---|---|
BASELINE_STATS.faction | 'solaris' |
Generator loop faction: BASELINE_STATS.faction | 'solaris' (every entry) |
| Per-hull override | none |
Result: every ShipDef.faction field in the roster reads 'solaris'. A Backwater_Lizard reports faction: 'solaris'. An Ancients_Rune reports faction: 'solaris'. A Junkrats_Pierre reports faction: 'solaris'.
Why this is dead
| Property | State |
|---|---|
Field declared on ShipDef | yes |
| Field written for all ships | yes, always 'solaris' |
| Per-hull override | none |
| Read by gameplay | no |
| Read by UI | no |
| Used for matchmaking, spawn pools, missions, art selection | no |
| Source of truth for actual faction | hull-key prefix (hull_class.split('_')[0]) |
Faction union matches real factions | no — three of four members never appear; six real prefixes are missing |
The field is dead config. Two clean migrations:
| Option | Action |
|---|---|
| Remove | Delete faction from ShipDef, BASELINE_STATS, the generator loop, and the Faction type union. |
| Populate correctly | Replace the union with the six real prefix names, derive each ship’s faction from its hull_class prefix in the generator loop, and remove the baseline default. |