# Topology, Project Layout & Module Split

V5 is one Unreal Engine 5.5 LTS project that hosts an entire open-world
narrative-action _universe_ rather than a single game: six ruleset "cells" —
Urban Crime, Period Drama, Frontier, Monster Hunter, Sci-Fi, and the Brave New
World Steampunk Detective DLC — plus a cross-cell **Mind Palace** deduction
meta-layer, all under one shared roster, one shared AI-perception model, and one
online backbone. The architectural bet that makes that universe tractable is the
inverse of a fat monolith: **all of the frame-critical mechanics live in shared
C++ engine modules, and each playable mode-variant is a hot-swappable content
GameFeature plugin layered on top of them.** This is not slideware — it is wired
through the repository. The project at `V5/ue/V5.uproject` sets
`"DisableEnginePluginsByDefault": true`, declares **74 C++ modules** (69
`Runtime`, 5 `Editor`), and force-enables a curated set of 32 engine plugins;
under `V5/ue/Source/` those 74 module directories each carry a real `*.Build.cs`
and a `Public/`/`Private/` split, totalling **328 `.cpp` + 341 `.h`** (669
source files). Five `*.Target.cs` files define the runtime topology, and **29
`V5Mode_*` GameFeature plugins** under `V5/ue/Plugins/` carry the per-cell
content roots.

This page is the orientation map for how those pieces fit at runtime, on disk,
and by concern. As with the rest of this set, the reason to read the _code_
rather than the architecture monolith's prose is that the two have drifted in a
handful of load-bearing places — most importantly, the monolith's glossary lists
**48** engine modules where the disk has **74**, and it markets the cells as
code-bearing plugins where the disk ships them as **content-only** GameFeature
roots. Where the `.uproject`, the `Build.cs` files, and the on-disk plugin tree
disagree with the monolith, this page treats the compiler's view as
authoritative and labels the monolith as the aspirational spec. The full section
index for the catalogue is [../V5_ARCHITECTURE.md](../V5_ARCHITECTURE.md).

## What ships, honestly

**Real and on-disk (the compiler agrees).** All 74 module directories named in
the `.uproject` `Modules` array exist under `V5/ue/Source/`, each with a
`*.Build.cs`, a `Public/`/`Private/` split, and (in 73 of 74) a `Private/Tests/`
spec directory. The depth is concentrated where the universe needs narrative
reasoning: `V5MindPalace` is the deepest at 18 `.cpp`/18 `.h`, followed by
`V5Melee` and `V5Investigation` (11 each), `V5Interrogation` (10), and
`V5StarMap`, `V5Squad`, and `V5Combat` (9 each). Many modules are leaner —
roughly 3 `.cpp`/3 `.h` (a `<Module>.cpp` implement, a `<Module>Systems`, a
`<Module>Types.h`, and a `Tests/` spec) — but none is a bare three-file
`.cpp`/`.h`/`.Build.cs` stub. Testing is genuine and **distributed**: 73 modules
hold their own automation specs, and the dedicated `V5Tests` module adds a
**5,804-line** `V5TestsAutomation.cpp` carrying thousands of real UE
`IMPLEMENT_*_AUTOMATION_TEST` / `TestEqual` / `TestTrue` assertions. The
`EV5Cell` enum in `V5/ue/Source/V5Core/Public/V5Types.h` carries **7** values
(`Urban`, `Period`, `Frontier`, `Hunter`, `SciFi`, `Steampunk`, `MindPalace`),
exposed through `GetAllV5Cells()` — datasets and per-cell tests must size
against that call, not a literal 5 or 6.

**Modeled as data, not binary art.** Like V4, V5's content is a logic-and-data
skeleton: a tree-wide search finds **0 binary `.uasset`** and exactly **one**
`.umap` (`Content/V5Core/Maps/BootMap.umap`), against **393 `.json`**
descriptors under `ue/Content/` plus **62 `.json`** content manifests inside the
GameFeature plugin roots. So the logic and data of every cell are real and
version- controlled, while the hand-authored meshes, MetaHumans, audio, and
cooked levels are not in-tree. Where a claim depends on that art, this page says
so.

**Spec-only or mislabelled drift, found by reading the disk.** Six items are
worth naming up front because the deep pages reference these names:

1. **The glossary's "Engine Modules" table is incomplete.** It lists **48**
   modules; the disk has **74**. The 26 it omits are the thin `V5` composition
   root (which the Project Layout does name), three cross-cutting modules
   (`V5Accessibility`, `V5Localization`, `V5Compliance`), four editor authoring
   modules (`V5MissionEditor`, `V5HeistAuthor`, `V5CaseAuthor`,
   `V5WorkshopEditor`), and **eighteen per-cell-variant composition modules**
   (`V5UrbanHeistCity`, `V5HunterWitchersPath`, `V5FrontierOutlawTrail`, …).
2. **The cells are content-only plugins, not code plugins.** Every `V5Mode_*`
   `.uplugin` declares `"EnabledByDefault": false`, `"CanContainContent": true`,
   `"BuiltInInitialFeatureState": "Installed"`, and **zero source modules** (0
   `.cpp`/0 `.h`). This is the exact inverse of V4, whose ruleset plugins each
   shipped a runtime C++ module.
3. **The plugin count is off by one.** The monolith's Project Layout lists 28
   `V5Mode_*` plugins; the disk has **29** — the extra is
   `V5Mode_Steampunk_Detective`, the DLC cell.
4. **The `V5Mode_*` plugins are not force-enabled in the `.uproject`.** Its
   `Plugins` array enables 32 plugins, all of them engine plugins — none of the
   29 `V5Mode_*` features. They are discovered as project plugins and activated
   at runtime by `V5Modes` instead. One stray entry leaks across products:
   `V8_Ariadne_CaseClient` (a V8 plugin) is enabled in V5's `.uproject`.
5. **No determinism is stamped by the build.** No target or `Build.cs` sets
   `DETERMINISM`, `/fp:strict`, `-fno-fast-math`, or `bUseUnityBuild=false`;
   authority and determinism live one level down in `V5Netcode`. See
   [netcode, authority & determinism](./netcode-authority-and-determinism.md).
6. **No cross-language footprint.** There is no `libs/v5`, no
   `libs/contracts/src/v5`, and no `apps/v5`; V5 is self-contained under `V5/`,
   with contracts expressed in UE C++ types and in the TypeScript service
   structs.

Everything below is grounded in those files; where a claim is the monolith's
intent rather than shipped code, it is labelled.

## Runtime topology: five targets over one shared core

The monolith renders the runtime as a single "one shippable executable per
platform" block. In code the topology is richer: **five** `*.Target.cs` files,
two of which do real work the prose understates.

| Target (`*.Target.cs`) | Type     | What it stamps                                                                                       |
| ---------------------- | -------- | ---------------------------------------------------------------------------------------------------- |
| `V5`                   | `Game`   | `BuildSettingsVersion.V5`, `ExtraModuleNames.Add("V5")` — the baseline client                        |
| `V5ArcadeCabinet`      | `Game`   | adds `V5_ARCADE_CABINET=1`, `V5_LOCAL_COOP_CABINET=1`, `V5_CABINET_ONLINE_SERVICES=0`, `…COIN_OP=0`  |
| `V5DedicatedServer`    | `Server` | `V5_DEDICATED_SERVER=1` **and `DisablePlugins` of 29 client-only plugins** (render/audio/anim/Chaos) |
| `V5Editor`             | `Editor` | the editor + authoring build                                                                         |
| `V5ListenServer`       | `Game`   | `V5_LISTEN_SERVER=1` — peer-hosted sessions                                                          |

The honest contrast with V4 is the dedicated-server target. V4's tournament
server stripped nothing; V5's `V5DedicatedServer.Target.cs` actually
`DisablePlugins` the entire presentation stack — `Niagara`, `Metasound`,
`MetaHumanRuntime`, `CommonUI`, `ModelViewViewModel`, the animation set
(`MotionWarping`, `AnimationWarping`, `PoseSearch`, `Mover`, `Chooser`,
`IKRig`), the Chaos cloth/flesh/geometry set, `PCG`, and `WorldPartitionHLOD` —
producing a genuine headless build. That stripping is `.Target.cs`-driven, which
is the whole point of putting the rest of the genre stack behind force-enabled
engine plugins. What no target does is stamp determinism flags, so the per-cell
netcode story (dedicated-server authoritative vs. rollback-emulated vs. offline
deterministic) is realized inside the `V5Netcode` module, not by the targets.

```mermaid
flowchart TB
    subgraph CLIENTS["Game targets (TargetType.Game)"]
        Game["V5<br/><sub>baseline client · all cells mountable</sub>"]
        Cabinet["V5ArcadeCabinet<br/><sub>V5_ARCADE_CABINET · local-coop · no online</sub>"]
        Listen["V5ListenServer<br/><sub>V5_LISTEN_SERVER · peer-hosted</sub>"]
    end
    Server["V5DedicatedServer<br/><sub>TargetType.Server · strips 29 client plugins</sub>"]
    Editor["V5Editor<br/><sub>TargetType.Editor · + 4 author modules</sub>"]
    Core["Shared core — 74 C++ modules<br/><sub>+ 29 content-only V5Mode_* GameFeature plugins</sub>"]
    UE["Unreal Engine 5.5 LTS runtime<br/><sub>Lumen · Nanite · MetaHuman · Niagara · Mass · GAS · Iris</sub>"]
    subgraph BACK["Off-engine plane (apps/v5 — TypeScript)"]
        online["auth · friends · parties · matchmaking"]
        more["leaderboards · replays · telemetry · anti-cheat"]
        mp["mindpalace-cloud-sync · workshop · compliance-dsar"]
    end

    Game & Cabinet & Listen & Server & Editor --> Core --> UE
    Game -- inputs / replication --> Server
    Game -- login / MM / replay / telemetry --> BACK
    Server -- match results / telemetry --> BACK
```

The Mind Palace is, as the monolith puts it, a **side-car** to all cells: each
cell pushes evidence events into `V5MindPalace`, whose UI overlays the
cell-of-the-moment but operates on its own deduction graph and syncs through the
`mindpalace-cloud-sync` service.

## The cell-hosting model: content plugins over a shared core

The single most important structural fact about V5 — and its cleanest departure
from V4 — is _how a cell becomes active_. In V4 each ruleset plugin carried its
own runtime C++ module that composed a cell-mechanic module. In V5 the mechanics
all live in the 74 shared modules, and a mode-variant is expressed **twice**: as
a content-only GameFeature plugin (`V5Mode_Urban_HeistCity`, a `Content/` tree
of JSON manifests under a `.uplugin` with no source) _and_ as a C++
"cell-variant composition module" (`V5UrbanHeistCity`) whose `Build.cs` wires
the shared mechanic modules that variant needs. `V5FrontierOutlawTrail`, for
example, depends on `V5DeadEye`, `V5Honor`, `V5HorseAI`, `V5Hunting`, and
`V5Squad`; `V5HunterWitchersPath` on `V5Alchemy`, `V5Melee`, `V5MonsterHunt`,
`V5Signs`, and `V5Squad`; `V5SciFiGalacticSquad` on `V5Dialogue`, `V5Spaceship`,
`V5Squad`, and `V5StarMap`. Each such module is real code (a `*Systems.cpp` plus
a `*Types.h` with ten-plus `USTRUCT`s), not a stub.

The runtime that fuses content plugin to composition module is `V5Modes`. Its
public surface is a set of `UBlueprintFunctionLibrary` registries:
`UV5_Mode_Registry` (`DiscoverInstalledGameFeaturePlugins`,
`DiscoverEnabledGameFeaturePlugins`,
`EnumerateEnabledGameFeaturePlugins(... EV5ModeBuildTarget)`),
`UV5_Mode_PerCellHUDRouter` (`BuildHUDRoute(EV5Cell, FName ActiveModePlugin)`),
`UV5_Mode_RulesetGate`, `UV5_Mode_OnlineLobby_BureauHQ`, and
`UV5_Mode_ArcadeCabinet`. This is the concrete mechanism by which selecting a
cell discovers its installed GameFeature plugin and routes the correct per-cell
HUD — the monolith's "mode registry, per-cell ruleset gating" expressed as code.

Above that sits a deliberately empty root. The module named simply `V5`
(`V5/ue/Source/V5/`, **1 `.cpp`/1 `.h`**) is the only module all five targets
name via `ExtraModuleNames.Add("V5")`, yet its `Build.cs` depends on engine
modules only (`Core`, `CoreUObject`, `Engine`, `InputCore`) and its `V5.cpp` is
nothing but `IMPLEMENT_PRIMARY_GAME_MODULE(FV5Module, V5, "V5")` with empty
`StartupModule`/`ShutdownModule`. It hosts **no** subsystems at all — even
thinner than V4's bootstrap root. The fusing happens entirely through the
modular-plugin layer and `V5Modes`, never through a fat composition root.

## Project layout: where V5 actually lives

V5 is self-contained under `V5/`. The engine project and the off-engine planes
sit side by side.

- **`V5/ue/`** — the one UE5.5 project: 74 `Source/` modules, 5 targets, a
  `Config/` set, a `Content/` tree with per-cell roots (`V5Urban`, `V5Period`,
  `V5Frontier`, `V5Hunter`, `V5SciFi`, `V5MindPalace`, `V5Shared`, …) so a
  "no-frontier" SKU can ship without dragging that cell's asset budget, a
  `Platforms/` overrides tree, and `Plugins/` holding the **29** content-only
  `V5Mode_*` GameFeature roots. The 32 force-enabled engine plugins read like a
  bill of materials for a multi-genre universe: `GameplayAbilities`,
  `EnhancedInput`, `CommonUI` + `ModelViewViewModel`, the animation stack
  (`MotionWarping`, `AnimationWarping`, `PoseSearch`, `Mover`, `Chooser`,
  `IKRig`), `Niagara`, the Chaos set (`ChaosCloth`, `ChaosFlesh`,
  `GeometryCollectionPlugin`, `ChaosVehiclesPlugin`), `Metasound` +
  `AudioModulation` + `AudioGameplayVolume`, `MetaHumanRuntime`, `PCG`,
  `MassEntity`, the networking set (`Iris`, `NetworkPrediction`,
  `ReplicationGraph`), and `GameFeatures` + `ModularGameplay` (the basis of the
  whole cell-hosting model).
- **`apps/v5/`** — the online backbone, here a **TypeScript** tree (each service
  ships a `package.json`, `vitest.config.ts`, and `contract.test.ts`), with the
  directories the monolith promises: `auth`, `friends`, `parties`,
  `matchmaking`, `leaderboards`, `replays`, `telemetry`, `anti-cheat`,
  `crash-reporting`, `companion-app-bridge`, `mindpalace-cloud-sync`,
  `workshop`, `compliance-dsar`, `live-service-calendar`, `balance-ledger`,
  `faction-rep`, plus `service-shared`, `k8s`, and a `verify-services.mjs` gate.
  (Note the language contrast: V4's backend was a Rust workspace; V5's is
  Node/TS.)
- **Data-authoring & ops trees** — `balance/` (per-cell spreadsheets + a
  `period-auth/` era-bundle set), `loc/` (16 languages, source-of-truth),
  `tools/` (140 entries — far richer than the layout's seven categories),
  `legal/`, `docs/`, `release/`, `security/`, `audio/`, `cinematics/`,
  `companion/`, `crossplay/`, `community/`, and `live-service/` — all
  JSON/Markdown authoring and ops data, not compiled code.
- **`apps/v5/web/`** — the Next.js marketing surface.

## The module split, by concern

The 74 modules group into eight concerns. The dependency notes below are the
_verified_ `Build.cs` edges. `V5Core` is the universal sink — it depends on no
`V5*` module — and every edge points toward more-foundational code, so the graph
resolves cleanly into a directed acyclic graph. The cross-cell shared modules
forbid any per-cell dependency (one-way enforcement, declared in the `Build.cs`
files).

- **Foundation (2).** `V5Core` (engine subsystems, save game, the
  `EV5Cell`/`GetAllV5Cells` registry, dev cheats) and the thin `V5` bootstrap
  root. Both link engine modules only.
- **GAS spine & engine subsystems (~11).** `V5Gameplay` (→ `V5Core`) is the
  ability-system layer; `V5Animation`, `V5Input`, `V5Netcode`, `V5Modes`,
  `V5Persistence`, `V5Telemetry`, `V5Cinematics` sit beside it. `V5UI` (→
  `V5Core`, `V5Modes`) is the CommonUI/MVVM front-end; two presentation edges
  the monolith's split prose omits are real here: **`V5VFX → V5Signs`** (sign FX
  is first-class) and **`V5Audio → V5RadioTV`** (the in-world radio mix feeds
  the audio module).
- **AI stack (3).** `V5Perception` (the unified sight/hearing/suspicion model) →
  `V5Crowd` → `V5Schedules`, with the surprising real edge
  **`V5Crowd → V5Honor`** (civilian panic reads the honor/reputation axis).
  Every NPC in every cell reads stimuli through this one chain.
- **Shared cell-mechanic modules (~24).** The genre cores reused across cells:
  `V5Combat`, `V5Melee`, `V5Vehicles`, `V5Open`, `V5DeadEye`, `V5Honor`,
  `V5Hunting`, `V5Wanted` (→ `V5Honor`), `V5Heist` (→ `V5Combat`, `V5Vehicles`),
  `V5Alchemy`, `V5Signs`, `V5MonsterHunt`, `V5Spaceship`, `V5StarMap`,
  `V5Squad`, `V5FaceCapture`, `V5PeriodAuth` (→ `V5Crowd`), plus the engine-only
  leaf mechanics `V5CardGame`, `V5HorseAI`, `V5Karaoke`, `V5LockpickHack`,
  `V5Parkour`, and `V5RadioTV` (these six link no `V5*` module at all).
- **Cross-cell narrative layer (4).** `V5MindPalace` (the deepest module, →
  `V5Investigation`), `V5Investigation`, `V5Interrogation`, and `V5Dialogue` —
  the deduction/evidence/interrogation spine that every cell pushes into.
- **Cell-variant composition modules (18).** One per mode-variant, mirroring the
  GameFeature plugins: the urban trio (`V5UrbanHeistCity` → `V5Wanted`;
  `V5UrbanStreetTriad` → `V5Melee`, `V5Parkour`; `V5UrbanOnline`), the period
  pair (`V5PeriodMadeMan`, `V5PeriodViceSquad`), the frontier pair
  (`V5FrontierOutlawTrail`, `V5FrontierOnline`), the hunter trio
  (`V5HunterWitchersPath`; `V5HunterContractBoard` → `V5HunterWitchersPath`;
  `V5HunterCardGame` → `V5CardGame`), the sci-fi trio (`V5SciFiGalacticSquad`,
  `V5SciFiHardVacuum` → `V5Spaceship`, `V5SciFiPvP`), the two detective
  variants, and `V5SpecOpsCoop`/`V5HordeDefense`/`V5RoguelikeHunterRun`.
- **Online & data (4).** `V5OnlineServices` (→ `V5MindPalace` — the cloud-sync
  edge), `V5Persistence` (→ `V5MindPalace`), `V5Telemetry`, `V5Procgen`.
- **Editor, cross-cutting & tests (8).** Five `Editor`-type authoring modules
  (`V5Editor`, `V5MissionEditor`, `V5HeistAuthor`, `V5CaseAuthor`,
  `V5WorkshopEditor`), the cross-cutting `V5Accessibility`, `V5Localization`,
  `V5Compliance`, `V5Hub`, and the `V5Tests` harness atop everything.

```mermaid
flowchart TB
    subgraph VARIANTS["Cell-variant composition modules (18, mirror the 29 V5Mode_* plugins)"]
        direction LR
        FOT[V5FrontierOutlawTrail]
        HWP[V5HunterWitchersPath]
        SGS[V5SciFiGalacticSquad]
        UST[V5UrbanStreetTriad]
        PVS[V5PeriodViceSquad]
    end
    subgraph MECH["Shared cell-mechanic modules"]
        direction LR
        Combat[V5Combat]
        Melee[V5Melee]
        Veh[V5Vehicles]
        DeadEye[V5DeadEye]
        Honor[V5Honor]
        Hunt[V5Hunting]
        Alch[V5Alchemy]
        Signs[V5Signs]
        Ship[V5Spaceship]
        Squad[V5Squad]
        Star[V5StarMap]
    end
    subgraph NARR["Cross-cell narrative layer"]
        MP[V5MindPalace]
        Inv[V5Investigation]
        Dlg[V5Dialogue]
    end
    subgraph SPINE["GAS spine & subsystems"]
        GP[V5Gameplay]
        Modes[V5Modes]
        UI[V5UI]
        Net[V5Netcode]
        Persist[V5Persistence]
        Online[V5OnlineServices]
    end
    Core[V5Core · foundation sink]
    Boot[[V5 · empty bootstrap root]]

    FOT --> DeadEye & Honor & Hunt & Squad
    HWP --> Alch & Melee & Signs & Squad
    SGS --> Dlg & Ship & Squad & Star
    UST --> Melee
    PVS --> Inv
    Combat & Veh & DeadEye & Honor & Hunt & Alch & Signs & Ship --> GP
    MP --> Inv
    UI --> Modes
    Online --> MP
    Persist --> MP
    GP & Modes & Net & Inv & Dlg & Squad & Star & Melee --> Core
    Boot -.engine-only.-> Core
```

## Where to go next

This page is the orientation hub; three sibling pages take the topology apart:

- [Promise & glossary](./promise-and-glossary.md) — the fixed vocabulary, the
  full 74-module map, and the module/plugin/service reconciliation.
- [GAS, animation & input](./gas-animation-input.md) — how `V5Gameplay`,
  `V5Animation`, and `V5Input` carry the shared combat-and-traversal spine the
  cell modules ride on.
- [Netcode, authority & determinism](./netcode-authority-and-determinism.md) —
  why determinism lives in `V5Netcode` rather than the build targets, and how
  each cell selects its replication strategy.
- The full catalogue: [../V5_ARCHITECTURE.md](../V5_ARCHITECTURE.md).
