# The Sci-Fi Galactic-Squad Cell

This is V5's space opera. The Galactic-Squad cell is the Mass Effect surface —
the genre where you build a commander, crew a ship, and spend fifty-plus hours
deciding _who you are_ one dialogue-wheel choice at a time, then learn at the
finale that every one of those choices quietly decided _who lives_. The
moment-to-moment loop is **talk, recruit, build a power, plot an FTL jump, land,
fight, and come home to a ship full of people who remember what you said** — the
genre that lives or dies on whether a squadmate's loyalty feels earned, whether
a Paragon interrupt lands on the exact frame the scene gives you, whether a
biotic combo detonates because two characters' powers actually chained, and
whether the "all hands" suicide run at the end of the campaign turns your roster
decisions into a body count you have to own. It is the most narratively
ambitious of the five ruleset cells, and the one that most clearly proves V5's
thesis from the _story_ side: that a single engine can carry a modern crime
sandbox and a trilogy-scale branching squad-RPG on the same spine.

The cell is one of two sub-rulesets in V5's Sci-Fi cell. Galactic Squad is the
third-person squad-RPG campaign (`V5Mode_SciFi_GalacticSquad`); its sibling, the
Expanse-style **Hard Vacuum** ship-sim, shares the same galaxy geography and
faction map but flies a Newtonian spaceship instead of commanding a squad on
foot — that surface is documented at
[./scifi-hard-vacuum.md](./scifi-hard-vacuum.md). This page inventories what the
Galactic-Squad stack actually does on the player's side of the screen, and
points at the exact Unreal C++ behind each feature. For the full mode taxonomy,
roster, and the scope this slots into, start at the hub:
[../V5_features.md](../V5_features.md).

## What ships, honestly

**The cell's systems are real, compiled, and tested.** The campaign module and
every shared core it composes exist under `V5/ue/Source/` with a
`Public/`/`Private/` split, a `*.Build.cs`, and a `Private/Tests/` automation
spec, and the linker has been through them on this box:
`libUnrealEditor-V5SciFiGalacticSquad.so`, `-V5Squad.so`, `-V5StarMap.so`,
`-V5Dialogue.so`, and `-V5Spaceship.so` all sit in `V5/ue/Binaries/Linux/`,
built by the `ueagent` user (the Squad, StarMap, and Dialogue cores carry 55,
55, and 49 `.o` objects in the build tree). The signature logic is real
domain-specific code — a Dijkstra FTL router, a frame-exact interrupt window, a
rank-scaled combo-damage formula, a loyalty-gated survival classifier, a bounded
trait-vector persona — and each is pinned by UE
`IMPLEMENT_SIMPLE_AUTOMATION_TEST` assertions
(`V5.SciFiGalacticSquad.CampaignInventory`, `.CreationDialoguePowers`,
`.SquadGalaxyEndgame`, `.AIPersonaCompanion`, plus `V5.Squad.LoyaltySurvival`)
that check _values_, not truthiness.

**"Cell" means a thin campaign module composing shared cores.** Exactly like the
urban-crime cell, V5 puts the frame-critical verbs in shared modules and makes
the playable sub-ruleset a content-and-validation module.
`V5SciFiGalacticSquad.Build.cs` declares dependencies on precisely `V5Core`,
`V5Dialogue`, `V5Spaceship`, `V5Squad`, and `V5StarMap` — its job is to _author
and validate_ the campaign catalog (78 missions, six endings, the power tree,
the eight companions, the opening dialogue tree, the VO plan, the persona) and
to _compose_ the shared narrative and locomotion cores into a Mass Effect shape.
The novel per-frame algorithms live one layer down in those cores. Both facts
are true at once, and the sections below keep them distinct.

**The data is C++/JSON catalogs; the art and the in-world shooter are not in
this module.** Consistent with V5's 0-binary-`.uasset` accounting, the eight
companions are a real validated JSON roster
(`Content/V5Squad/Data/squad_roster.json`, 68 companions across all cells), the
systems and bodies are catalog structs, and the VO is a _line-count plan_
(`FV5GSCVoiceOverPlan`), not recorded audio — the MetaHuman protagonists,
alien-species heads, environment meshes, and the ~98,000 recorded line variants
those catalogs reference are _described_ by `FName`/`FSoftObjectPath`/manifest
path, not cooked. And two honest seams matter: **the third-person cover-shooter
tick is not in `V5SciFiGalacticSquad`** — the module is the
campaign/creation/dialogue/galaxy/squad-coordination _brain_, and the real-time
biotic-and-gunfire combat runs on the shared combat/GAS stack it feeds. Where a
claim depends on art, audio, or the in-world runtime, this page says so.

## The galactic-squad experience — what the cell plays like

Strip the campaign down and you get three interlocking authoring spines: a
character you build, a galaxy you cross, and a crew you keep. All three are
validator-enforced catalogs, and all three feed the same Paragon/Renegade
identity that the cross-cell Bureau reads back.

### Protagonist, class, and the 105-node power tree

`UV5_GalacticSquad_Catalog::BuildCampaignCatalog`
(`V5/ue/Source/V5SciFiGalacticSquad/Private/V5SciFiGalacticSquadSystems.cpp`) is
the content spine, and `ValidateCampaignCatalog` (line 1144) refuses anything
but the authored shape. Creation offers **three backgrounds** (Military /
Colonist / Outlaw, each stamping a `BackgroundFlag`), **24 face presets**, and
**six classes** — three base (Soldier / Adept / Engineer) plus three hybrids
whose primary/secondary power domains are real data: Vanguard fuses
Biotic+Combat, Sentinel Biotic+Tech, Infiltrator Tech+Combat.
`BuildProtagonistProfile` validates the whole selection (gender tag in-set, face
index in range, background and class authored) and copies the class's starting
power tags onto the profile before it returns true — a bad combination returns
false, it does not silently coerce.

The power tree is **105 nodes — exactly 35 each across Biotic, Tech, and
Combat** (`PowerNodesPerDomain = 35`, `TotalPowerNodeCount = 105`), each node
carrying a tier, a rank, a class gate, and an upgrade cost of `1 + Tier`.
`GetAvailablePowerNodes` filters by class: the
`V5.SciFiGalacticSquad.CreationDialoguePowers` spec creates a Sentinel and
asserts it sees **70 nodes** (the Biotic and Tech trees, not Combat) — the class
restriction is computed, not cosmetic. Three authored combos sit on top
(`BuildPowerCombos`): biotic **Lift→Warp** detonates a Biotic Explosion, tech
**Overload→Incinerate** a Tech Burst, combat **Armor-break→Killshot** a Combat
Shatter — the same primer/detonator grammar the squad uses cooperatively below.

### The dialogue wheel and Paragon/Renegade

The signature Mass Effect verb is real and lives in the shared `V5Dialogue`
core. `UV5_Dialogue_Wheel::BuildWheelState` (`V5DialogueWheel.cpp`) lays out
**six spokes at fixed clock angles** — upper-left 135°, upper-right 45°, left
180°, right 0°, lower-left 225°, lower-right 315° — tinting Paragon/Charm
options with the cell's blue flavor and Renegade/Intimidate with its red, and
flagging `bHasCharmOrIntimidate` when a rep-gated spoke is present. The opening
command tree (`BuildOpeningDialogueTree`) authors all six: a Paragon "evacuate
the colony" (+8 Paragon), a Renegade "cut the relay and hit them now" (+8
Renegade), and a **Charm spoke gated at Paragon ≥ 25** plus an **Intimidate
spoke gated at Renegade ≥ 25**. That gate is enforced by
`UV5_Dialogue_CharmIntimidate::IsOptionUnlocked`, which checks
`RequiredParagon`/`RequiredRenegade`/`RequiredReputation` and any
`RequiredStateFlag` against the running `FV5DialogueRuntimeState` — accumulating
scores genuinely unlock downstream options.

The cinematic **interrupt** is the most precise piece:
`UV5_Dialogue_Interrupt::EvaluateInterrupt` (`V5DialogueInterrupt.cpp`) fires
only when `bPressedThisFrame && CurrentFrame == Window.TriggerFrame` — a literal
single-frame window, exactly the "press now or miss it" beat the design
promises. And the whole branching record is stateful: choosing an option grants
a state flag (`opt.paragon.rescue.chosen`) that the spec confirms downstream
blackboard reads can gate on. Crucially, the accumulated Paragon/Renegade pair
is _not_ a local score — it is one of the per-cell inputs that
`UV5_Honor_KarmaParagonBridge::ComputeMoralCompass` folds into the
cross-continuum `MoralCompass [−1,1]`, the same spine the
[urban-crime cell](./urban-crime-cell.md) and the rest of V5 share, detailed in
[../architecture/hunter-period-systems-and-bureau-spine.md](../architecture/hunter-period-systems-and-bureau-spine.md).

## The squad and starship systems

The crew is the cell's emotional anchor, and the `V5Squad` core is where its
real algorithms live — the campaign module mostly delegates to it. The diagram
below is the honest composition: a thin campaign catalog wiring four shared
cores, with two of them (Dialogue's morality, Spaceship's boarding clamp)
reaching outward to the rest of V5.

```mermaid
flowchart TB
    subgraph MODE["V5SciFiGalacticSquad — catalog + validate + compose"]
        GSC["UV5_GalacticSquad_Catalog<br/><sub>78 missions · 3 acts · 6 endings · 105-node power tree</sub>"]
    end
    subgraph CORES["Shared narrative + locomotion cores"]
        Squad["V5Squad<br/><sub>8 companions · loyalty · romance · death-state · combos</sub>"]
        Dlg["V5Dialogue<br/><sub>6-spoke wheel · Paragon/Renegade · 1-frame interrupt</sub>"]
        Star["V5StarMap<br/><sub>32 systems · Dijkstra FTL · orbital scan</sub>"]
        Ship["V5Spaceship<br/><sub>Newtonian solver · boarding clamp</sub>"]
    end
    GSC --> Squad & Dlg & Star & Ship
    Dlg -->|Paragon/Renegade| Bridge["UV5_Honor_KarmaParagonBridge<br/><sub>→ MoralCompass [-1,1]</sub>"]
    Squad -->|loyalty complete| Survival["all-hands finale<br/><sub>SurvivedEndgame / Killed / Wounded</sub>"]
    Ship -. boarding clamp .-> HV([Hard-Vacuum cell])
    Bridge --> Ledger["FV5BureauXPLedger<br/><sub>cross-cell unlocks</sub>"]
```

### Eight companions, loyalty, and romance

The roster is real, authored data. `UV5_Squad_RosterLibrary::LoadRoster` parses
`squad_roster.json` and the validator (`V5.Squad.RosterCatalog`) insists on
**eight Sci-Fi squad companions — four human and four distinct alien species**
(the JSON authors Asterian, Keth, Orison, and Virell alongside the four humans),
**six of the eight romanceable**, and **at least five loyalty chapters each**.
The eight ids are stable (`scifi.kade.roe`, `scifi.mira.vale`,
`scifi.juno.hart`, `scifi.silas.crete`, `scifi.ara.vonn`, `scifi.talak.ren`,
`scifi.nema.quill`, `scifi.vek.soro`).

**Loyalty** is a real gated state machine.
`UV5_Squad_LoyaltyArc::EvaluateAvailability` moves a companion from Recruited →
TrustBuilding → MissionAvailable only when _both_ the relationship score clears
the arc threshold **and** the critical-path beat is complete; below half the
threshold it falls back to Recruited. `CompleteArc` then walks every authored
chapter, each with its own beat-and-relationship gate, and only the final
chapter flips the arc to `MissionComplete` — the state the finale reads.

**Romance** is its own gate. `UV5_Squad_RomanceGate::EvaluateRomanceGate`
checks, in order: the companion is romanceable, the orientation matches the
player identity (`Flexible` accepts anyone; `MalePlayer`/`FemalePlayer` match
masc/femme tags), the relationship and chapter thresholds are met, the critical
beat is done, and no exclusivity conflict is active. The squad spec proves all
three branches: a Flexible companion (Kade) unlocks for a nonbinary player at
relationship 90 / chapter 4; a gender-locked companion (Mira) _rejects_ a
mismatched identity; and pursuing two arcs in the same `ConflictGroup` surfaces
`bConflict` with an `Ended` state — the chapter-4 confrontation the design calls
for.

### The all-hands finale — who lives, who dies

This is the cell's payoff, and it is a strict classifier, not a cutscene flag.
`UV5_Squad_DeathState::ResolveEndgameSurvival` (`V5SquadDeathState.cpp`) walks
every Sci-Fi mission companion against an `FV5SquadEndgameAssignment` (who runs
the diversion, who pilots the escape, who holds the chokepoint) and resolves
each one: a **loyalty-complete** companion is `SurvivedEndgame` ("survival
branch locked in"); a companion **assigned to a critical role without loyalty
completion** is `Killed` ("assigned to an all-hands critical role without
loyalty completion"); everyone else is `Wounded` — alive but out of the epilogue
defense. `bPerfectSurvival` is true only when every squadmate survives and the
death list is empty. The `V5.Squad.LoyaltySurvival` spec drives both outcomes:
with all eight arcs complete, perfect survival, zero deaths; demote Kade to
TrustBuilding while keeping him on the chokepoint, and the report names him a
death. Loyalty is mechanically _the_ survival currency.

### Squad power combos

Out in the field, the combo grammar goes cooperative.
`UV5_Squad_PowerCombo::EvaluatePowerCombo` requires **two distinct companions**,
each genuinely exposing the requested primer/detonator tag, then matches the
pair against the authored combo table (lift+warp → Biotic Explosion,
overload+incinerate → Tech Burst, armor-break+killshot → Combat Shatter, plus a
cross-cell takedown for frontier/hunter/urban tag pairs). The damage is
rank-scaled, not a constant:
`DamageMultiplier = 1.5 + (clamp(PrimerRank,1,5) + clamp(DetonatorRank,1,5)) · 0.15`
— **3.0×** at twin rank-5 powers (the `SquadGalaxyEndgame` spec's case),
**1.8×** at the rank-1 floor. The campaign module's `CoordinatePowerCombo` wraps
this with a "Squad combo synchronized." tactical callout and an ordered
two-power queue, every failure path returning a human-readable reason rather
than a silent no-op.

### Kade Roe — the adaptive persona, labeled honestly

The "Full-Vision AI-persona companion" is sci-fi-cell-only, and it is worth
being exact about what it _is_: **not a generative model or an LLM, but a
deterministic, privacy-bounded trait-vector accumulator.**
`BuildAIPersonaCompanion` authors Kade with **five trait vectors** (Empathy
0.62, Resolve 0.58, Caution 0.50, Curiosity 0.66, Candor 0.54), **six learning
signals**, and **six memory slots**. `ApplyPlayerChoiceSignal` only mutates
state when the signal is one of the six _authored_ signals (matched by id and
choice tag) **and** the cell-guard passes — the persona must be
`EV5Cell::SciFi`, `bSciFiCellOnly`, `bLocalProfileOnly`, and
`bNoCrossCellTraining`, or the call returns the input state unchanged. When it
does apply, it bumps `ObservedChoiceCount`, clamps trust into `[0,100]`
(starting at 50), shifts Paragon/Renegade affinity, retains the choice and
memory tags, and nudges each named trait by its authored delta — every delta
validated to be **≤ 0.10** so the persona drifts gradually. The
`AIPersonaCompanion` spec confirms a rescue choice raises trust and Paragon
affinity by 8 while leaving Renegade at 0, and that flipping the cell to Urban
**blocks all learning**. Release-gate data lives at
`fullvision_scifi_ai_persona_companion_manifest.json`. It is a transparent,
save-local, auditable state machine — the honest opposite of a black-box model.

### The galaxy map and FTL

Travel is the shared `V5StarMap` core, and its routing is genuine graph search.
`UV5_StarMap_FTLPlot::PlotFTLRoute` runs **Dijkstra's algorithm over the route
graph weighted by fuel cost**, returning a typed status — `UnknownSystem`,
`SameSystem`, `NoRoute`, `InsufficientFuel`, or `Valid` — and reconstructing the
system-and-route path by back-walking predecessors. Unknown routes are skipped
unless the request explicitly allows them, and a plotted path is re-checked for
missing route ids before it validates. The campaign's galaxy is the **32-system,
120-body** map the catalog asserts; arriving plays a **15-second FTL cinematic**
(`BuildTransitCinematic`) with five keyframes at 0 / 2.25 / 7.5 / 12.75 / 15 s,
lerping the camera between system coordinates and pulsing a `sin(α·π)`
star-stretch at mid-transit. At a body, the orbital-scan minigame
(`UV5_StarMap_OrbitalScan`) computes a clamped reveal:
`gain = clamp(accuracy·52 + scannerGrade·13 − scanDifficulty·4.5, 5, 60)`, and
only at 100% does it surface the body's minerals, anomalies, and any derelict
signal — a real formula over pulse accuracy, scanner grade, and authored
difficulty.

### Ship-hub and the corvette — the seam to Hard Vacuum

Between missions the player's ship is the hub. `BuildShipHubState` authors a
five-room interior (Bridge, Mess, Wardroom, Engineering, Bunks) and schedules
all eight companions through
`UV5_Squad_HubInteraction::BuildShipWalkingSchedule`, which roams each companion
along their authored route and carries their banter tags — the "walk the
Normandy and talk to your crew" loop, as data. The starship _flight_ itself is
the shared `V5Spaceship` Newtonian solver, which this cell touches at exactly
one seam: **boarding**. The Year-1 privateer corvette is an
`FV5GSCCorvetteVariantDefinition` whose validator requires an
`EV5ShipClass::Corvette` tuned for 3–6 crew and a `hardpoint.boarding_clamp` —
and boarding hands off to the squad-combat ruleset described here. The
deterministic Newtonian integrator, the magnetic clamp gate, and the
PDC/railgun/torpedo intercept math belong to the
[Hard Vacuum cell](./scifi-hard-vacuum.md) and are documented in full, with line
citations, in the architecture companion
[../architecture/spaceship-vehicles-and-mounts.md](../architecture/spaceship-vehicles-and-mounts.md).

## Endings and Year-1 expansions

The campaign resolves into **six endings** — three factions (Alliance, Colonial
Assembly, Black Star Syndicate) each in an Aligned or Independent state.
`BuildEndings` makes the Independent branches _cost_ more: a required faction
score of **75 and perfect squad survival**, versus **65** for Aligned — so the
cleanest ending demands both the political capital and the loyalty work. Three
validator-gated expansions extend the galaxy without drift. The Year-1 **Pirate
Coast** DLC authors **12 missions totalling 10 hours**, the low-security Nereid
Reach system (five bodies, security 0.18), a fully-authored new companion (Lyra
Voss, five loyalty chapters), and the privateer corvette — with
`EvaluateMissionAccess` gating later missions on _both_ Lyra being active and
the corvette equipped. The Year-1 **Helio Verge** sector adds six systems,
fifteen bodies, and one new faction (Helio Forge Compact), its validator
demanding every body type and at least two derelict signals. The Full-Vision
**Long Tomorrow** DLC adds four systems, twenty bodies, and six FTL routes
behind a real **BFS reachability proof** — `IsLongTomorrowRouteGraphConnected`
confirms every new system connects back to the Maia Shoal anchor before the
catalog validates, with two hidden late-sector routes. These are authored
catalogs with id-drift guards; the playable geometry behind them is described,
not cooked.

## Where this connects

The Galactic-Squad cell is one face of a single game, and it hands off at
well-defined seams:

- **Its own sibling.** The Expanse-style Hard Vacuum ship-sim shares this cell's
  galaxy, factions, and the `V5Spaceship` boarding seam, but flies a Newtonian
  spaceship instead of commanding a squad — see
  [./scifi-hard-vacuum.md](./scifi-hard-vacuum.md).
- **The other expert-RPG cell.** The Monster-Hunter cell shares the companion
  roster library, the dialogue core, and the cross-cell honor bridge but spends
  them on a Witcher-style contract hunt — see
  [./monster-hunter-cell.md](./monster-hunter-cell.md).
- **Architecture companion.** The deterministic ship solver, the boarding clamp,
  and the PDC/railgun/torpedo intercept math the corvette plugs into are
  documented with line citations in
  [../architecture/spaceship-vehicles-and-mounts.md](../architecture/spaceship-vehicles-and-mounts.md),
  and the Paragon/Renegade → MoralCompass → Bureau-XP spine in
  [../architecture/hunter-period-systems-and-bureau-spine.md](../architecture/hunter-period-systems-and-bureau-spine.md).
- The feature hub: [../V5_features.md](../V5_features.md). </content> </invoke>
