Dungeon System¶
Summary: The Dungeon System uses topology-based procedural generation to create deterministic dungeon layouts.
UDungeonSubsystemmanages runtime state whileUEternalDungeonGeneratorproducesFDungeonInstancefromUDomainDungeonConfig. The plugin bridge (AEternalDungeonActor) extends the ProceduralDungeon plugin to handle spatial room placement from our abstract topology.
Table of Contents¶
- Why Topology-Based Generation
- Architecture Overview
- Core Concepts
- Topology Templates
- Room Configuration
- Landmark / POI (Sub-Dungeons)
- Remnant Realm Room Injection
- Environment Tiles / Forest Domain Generation
- Generation Pipeline
- Plugin Bridge
- Runtime State Management
- Encounter Gates
- Boss Room Fill
- Start Portal
- Debugging
- WorldMap Integration
- Public Contracts
- Source References
- Related Systems
- Recent Changes
Why Topology-Based Generation¶
Design Philosophy¶
Our dungeon system separates what rooms exist from where they are placed:
| Concern | Our System | Plugin System |
|---|---|---|
| Room roles, slots, count | Topology template | N/A |
| Room connections | Topology edges | Door matching |
| Physical placement | N/A | Spatial algorithm |
| Level streaming | N/A | Built-in |
Key Benefits¶
- Determinism - Same seed + config = identical dungeon (critical for multiplayer)
- Designer Control - Topologies define critical path, branching, boss placement
- Domain Identity - Each domain has distinct room pools and topology options
- Clean Separation - Our topology logic, plugin's spatial logic
Standard vs HQ Dungeons¶
| Aspect | Standard Dungeon | HQ Dungeon |
|---|---|---|
| Terminal Room | Exit | Boss |
| Cleared When | Exit reached | Boss defeated |
| Triggers | Node cleared | Node cleared + Domain liberated |
| Topologies | StandardTopologies |
HQTopologies |
Architecture Overview¶
┌──────────────────────────────────────────────────────────────────┐
│ UDomainDungeonConfig │
│ (Data Asset - Per Domain) │
│ ┌────────────────────┐ ┌────────────────────┐ │
│ │ StandardTopologies │ │ HQTopologies │ │
│ │ (Exit endings) │ │ (Boss endings) │ │
│ └─────────┬──────────┘ └─────────┬──────────┘ │
│ │ │ │
│ ┌─────────┴───────────────────────┴──────────┐ │
│ │ RoomPools: TMap<FGameplayTag, Pool> │ │
│ │ (Room.Start, Room.Combat, Room.Boss, ...) │ │
│ └────────────────────────────────────────────┘ │
└───────────────────────────┬──────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────┐
│ UEternalDungeonGenerator │
│ (Pure Function Object) │
│ GenerateDungeon(Config, Seed, bIsHQ) → FDungeonInstance │
└───────────────────────────┬──────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────┐
│ UDungeonSubsystem │
│ (GameInstance Subsystem - Runtime Manager) │
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ FDungeonInstance CurrentDungeon │ │
│ │ • TArray<FDungeonFloor> Floors │ │
│ │ • FGuid StartRoomID, BossRoomID, ExitRoomID │ │
│ │ • FGuid CurrentRoomID │ │
│ └────────────────────────────────────────────────────────────┘ │
└───────────────────────────┬──────────────────────────────────────┘
│ OnDungeonGenerated
▼
┌──────────────────────────────────────────────────────────────────┐
│ AEternalDungeonActor │
│ (Plugin Bridge - Extends ADungeonGenerator) │
│ • ChooseFirstRoomData() → Start room from topology │
│ • ChooseNextRoomData() → Next room based on connections │
│ • OnPostGeneration() → Register room mappings │
└──────────────────────────────────────────────────────────────────┘
Component Ownership¶
| Component | Owner | Why |
|---|---|---|
UDungeonSubsystem |
GameInstance | Persists across level transitions |
UEternalDungeonGenerator |
DungeonSubsystem | Stateless generation logic |
AEternalDungeonActor |
World | Plugin-spawned, per-dungeon |
Core Concepts¶
FDungeonRoom¶
A single room instance within a generated dungeon.
| Field | Type | Purpose |
|---|---|---|
RoomID |
FGuid | Unique identifier |
TopologyNodeIndex |
int32 | Link to source topology node |
Role |
ERoomRole | Structural role: Start, Normal, Terminal |
SlotTag |
FGameplayTag | Content slot (Room.*), selects the room pool |
State |
ERoomState | Locked, Available, Current, Cleared |
RoomSeed |
int32 | Deterministic content generation |
ConnectedRoomIDs |
TArray\<FGuid> | Adjacent rooms |
RoomLevel |
TSoftObjectPtr\<UWorld> | Level to load |
MapPosition |
FVector2D | UI display position |
FloorIndex |
int32 | Vertical organization |
ERoomRole + SlotTag (Content Model)¶
The content model separates structure from content. ERoomRole describes only where a node sits in the
graph; what fills the node is a FGameplayTag slot (Room.*) resolved against the domain config's tag-addressed
pool map. Adding a new content kind is a data change (new tag + new pool entry), not a code change.
| Role | Description |
|---|---|
Start |
Entry room — exactly one per topology, no input pin |
Normal |
Everything in between |
Terminal |
Boss (HQ) or exit (standard) — no output pin |
Junction and Optional are not roles: junction is derived (>= 3 connections), optional is
bOnCriticalPath == false.
Well-known slot tags currently in use (Room.Start, Room.Combat, Room.Treasure, Room.Junction,
Room.Exit, Room.Boss, Room.Optional, Room.RemnantRealm, Room.Landmark) are just tags — the generator
does an exact-match lookup into UDomainDungeonConfig::RoomPools and attaches no code meaning to them, with
three exceptions: Room.Boss terminal validation, Room.Landmark placement constraints, and
Room.RemnantRealm (injected rather than authored — see
Remnant Realm Room Injection).
ERoomState¶
┌──────────────────┐
│ Locked │ Cannot enter, doors sealed
└────────┬─────────┘
│ Connected room cleared
▼
┌──────────────────┐
│ Available │ Can be entered
└────────┬─────────┘
│ Player enters
▼
┌──────────────────┐
│ Current │ Player is inside
└────────┬─────────┘
│ Objectives complete
▼
┌──────────────────┐
│ Cleared │ Completed, can revisit — TERMINAL
└──────────────────┘
Cleared is terminal. UDungeonSubsystem::SetRoomState refuses any transition out of Cleared. Gates and
other progression listeners latch on a room reaching Cleared, so movement transitions (re-entering or leaving a
cleared room) must never demote it. Where the player is lives in FDungeonInstance::CurrentRoomID, not in room
state — TryEnterRoom still sets Current on rooms that are not yet cleared, and still drops a left-but-uncleared
room back to Available, but a cleared room stays Cleared while you stand in it. (This fixed a shroud-gate
soft-lock: backtracking through a cleared room demoted it to Current, and the gate waiting on it never saw
Cleared again.)
FDungeonFloor¶
Groups rooms by vertical position (depth from start).
| Field | Type | Purpose |
|---|---|---|
FloorIndex |
int32 | 0 = top/start |
Rooms |
TArray\<FDungeonRoom> | Rooms at this depth |
DomainTag |
FGameplayTag | Theming tag |
FDungeonInstance¶
Complete generated dungeon state.
| Field | Type | Purpose |
|---|---|---|
DungeonID |
FGuid | Unique run identifier |
DungeonSeed |
int32 | Generation seed |
Floors |
TArray\<FDungeonFloor> | All floors |
StartRoomID |
FGuid | Entry room |
BossRoomID |
FGuid | HQ dungeons only |
ExitRoomID |
FGuid | Standard dungeons only |
bIsDomainHQ |
bool | Has boss vs exit |
CurrentRoomID |
FGuid | Player's current room |
Topology Templates¶
FTopologyNode¶
A single node in an abstract topology graph.
| Field | Type | Purpose |
|---|---|---|
NodeIndex |
int32 | Unique index (0, 1, 2...) |
Role |
ERoomRole | Structural role (Start/Normal/Terminal) |
SlotTag |
FGameplayTag | Content slot (Room.*) — which domain pool fills this node |
ConnectedNodeIndices |
TArray\<int32> | Edges to other nodes |
Depth |
int32 | BFS distance from start |
bOnCriticalPath |
bool | Required to reach terminal |
FDungeonTopology¶
Complete topology template.
| Field | Type | Purpose |
|---|---|---|
TopologyName |
FName | Debug identifier |
Nodes |
TArray\<FTopologyNode> | All graph nodes |
StartNodeIndex |
int32 | Entry point (default: 0) |
bIsHQTopology |
bool | Has boss vs exit |
BossNodeIndex |
int32 | HQ only, terminal |
ExitNodeIndex |
int32 | Standard only, terminal |
Example Topology¶
Standard Dungeon (Linear with Branch):
[Start] Node 0: Start / Room.Start
│ Node 1: Normal / Room.Combat (critical)
▼ Node 2: Normal / Room.Combat (critical)
[Combat] Node 3: Normal / Room.Treasure (optional)
│ Node 4: Normal / Room.Junction (critical)
▼ Node 5: Normal / Room.Combat (critical)
[Combat]──────[Treasure] Node 6: Terminal / Room.Exit (critical)
│
▼
[Junction]
│
▼
[Combat]
│
▼
[Exit]
Connections:
0 → 1, 1 → 2, 2 → 3, 2 → 4, 4 → 5, 5 → 6
Topology Validation¶
| Check | Purpose |
|---|---|
IsValid() |
Basic structure validation |
AreAllNodesReachable() |
No orphaned nodes |
CalculateDepths() |
BFS depth assignment |
GetMaxDepth() |
Floor count calculation |
Room Configuration¶
UDomainDungeonConfig¶
Per-domain configuration combining topologies and room pools.
| Category | Fields |
|---|---|
| Identity | DomainTag, DomainName |
| Topologies | StandardTopologies, HQTopologies |
| Room Pools | RoomPools — TMap<FGameplayTag, FEternalRoomPool> keyed by content slot tag (Room.*); LandmarkMinCellsFromStart |
| Remnant Realm | RemnantRealmChance (0..1, default 0 — rolled off the dungeon seed, overridable per world-map node), RemnantMinCellsFromStart, RemnantMaxCellsFromStart (0 = no maximum) |
| Encounters | DefaultEncounter, SlotEncounters (per-slot-tag overrides), BossEncounter (the boss an HQ boss room spawns when its level places none, see Boss Room Fill), DefaultContainerLootTable |
| Modifiers | ModifierPool (UDungeonModifierPoolDataAsset) |
| Tiers | TierRules — TArray<FDomainTierRule>, index 0 = Tier II: AreaLevelBonus (added to the node's depth at that tier) and an optional ModifierPool (the tier's pool; a node's own override still wins). Read from the domain's default config only; empty = the domain plays Tier I alone. See World Map System §Tiers |
FEternalRoomPool is currently just a room array; the struct is the seam where per-entry weight and
min/max-occurrence knobs land later. Adding a content kind = adding a RoomPools entry — no code change.
Room Pool Resolution¶
SelectRoomTemplate(SlotTag, Config, Random)
│
├─ Get pool: Config->GetRoomsBySlot(SlotTag) (exact tag match into RoomPools)
│
├─ Pool empty?
│ └─ Return nullptr (generation fails)
│
└─ Return Random selection from pool
Encounters resolve the same way: GetEncounterForSlot(SlotTag) checks SlotEncounters, falling back to
DefaultEncounter when the slot has no override.
UEternalRoomData¶
Extends plugin's URoomData with our metadata. Each room in a pool is a data asset containing:
- Level reference
- Door socket configuration
- SlotTag (self-identification + editor validation; resolves the spawner's encounter)
- Sub-dungeon entrance config (Landmark rooms only — see Landmark / POI)
- Visual theming
Room Resolution Helper¶
UEternalRoomData::GetRoomDataForActor(const AActor* Actor) is the canonical way to resolve which room an
actor is standing in. It walks from the actor to its owning ARoomLevel (the plugin's room-level script) and
returns that level's UEternalRoomData, or nullptr if the actor is not inside a generated room. Prefer this
over manual level/room lookups so encounter, portal, and gate actors bind to a room consistently.
Room culling¶
ProceduralDungeon's occlusion culling shows and hides a room by setting Actor Hidden In Game on each non-replicated
actor in its level (ARoomLevel::SetActorsVisible). Actors already hidden the first time it does so (trigger boxes,
target points, anything hidden in the level) are left hidden from then on, so showing a room never reveals them; the
fix lives in the plugin submodule. An actor that needs its own visibility rules takes the Ignore Room Culling tag.
Landmark / POI (Sub-Dungeons)¶
A Landmark is an off-path POI room (Room.Landmark slot tag) whose entrance descends into its own
sub-dungeon — a full dungeon generated from a separate UDomainDungeonConfig. It is Option A (run-ender):
the sub-dungeon's AEndPortalActor returns the player to the world map and marks the current (parent) node
cleared; there is no return trip up through the parent dungeon.
Authoring Model¶
"What's behind this entrance" is authored on the room data, not the placed actor. The Landmark room's
UEternalRoomData carries the sub-dungeon configuration:
| Field | Type | Purpose |
|---|---|---|
SubDungeonConfig |
UDomainDungeonConfig | The dungeon this entrance descends into |
bSubDungeonIsHQ |
bool | Sub-dungeon ends in a boss (HQ topology) vs exit |
bSubDungeonRequiresKey |
bool | Descent consumes a key item |
SubDungeonKeyItemId |
FPrimaryAssetId | Key item consumed on descent |
ASubDungeonEntrance¶
An interactable actor (cave mouth, castle gate, stairs, portal) placed inside the Landmark room level. It needs no per-instance config — it reads its owning room:
Player interacts (server-only)
│
├─ GetOwningRoomData() — resolve UEternalRoomData via GetRoomDataForActor
│
├─ TryConsumeKey() — no key required, or key found and consumed from interactor's inventory
│
└─ WorldMapSubsystem->EnterSubDungeon(SubDungeonConfig, bSubDungeonIsHQ)
│ reuses the dungeon-entry flow (transition + generate)
│ WITHOUT changing the current world-map node
▼
Sub-dungeon's AEndPortalActor → back to world map, parent node marked cleared
Placement Constraint¶
UDomainDungeonConfig::LandmarkMinCellsFromStart sets a minimum cell distance between the Room.Start room
and any Room.Landmark room. During generation the server rejects and retries layouts that place a landmark
closer than this (0 = no constraint).
Reference: ImplementationDocs/archive/LandmarkPOI.plan.md.
Remnant Realm Room Injection¶
Room.RemnantRealm is the one content slot that no topology template authors. It is injected into the
topology-derived room set after Step 3, so a domain can grow an optional Remnant portal room on any of its
existing topologies without forking them.
Roll¶
UDungeonSubsystem::ResolveRemnantRealmChance resolves the chance before generation (node override →
domain RemnantRealmChance), and UEternalDungeonGenerator::TryInjectRemnantRealmRoom rolls it.
The roll runs on its own FRandomStream, salted off the dungeon seed with the hash of the slot tag's
string (never the FGameplayTag/FName, whose hash varies per process and would break seed replay).
Because the stream is separate, the roll neither consumes nor perturbs the layout stream — a domain that
turns Remnants on does not reshuffle its existing dungeons — and the same seed always answers the same way.
Host Selection and Retag¶
The injected room hangs off a host road room, not a free field cell:
| Step | Rule |
|---|---|
| Pool guard | Both Room.RemnantRealm and Room.Junction pools must be non-empty, or injection is skipped entirely (no remnant beats a dungeon that retries itself to death) |
| Host candidates | ERoomRole::Normal rooms with slot Room.Combat and exactly 2 connections — plain road segments. Critical-path candidates preferred; off-path road rooms are the fallback so a guaranteed chance still lands on all-optional topologies |
| Pick | Deterministic — topology node order, indexed by the Remnant stream |
| Injection | New FDungeonRoom on the host's floor, TopologyNodeIndex = INDEX_NONE, bidirectionally connected to the host |
| Host retag | The host becomes 3-way, so its slot is retagged to Room.Junction — only the junction pool has a third door socket and fork art. Side effect: the host's encounter now resolves through the junction slot |
Never hosted by Start, Terminal, an existing junction, or any slot carrying its own authored content (Landmark, Treasure, …) — the retag would silently erase that content and change its encounter.
Distance Band¶
AEternalDungeonActor::SatisfiesRemnantPlacement gates the spatial result the same way landmarks are
gated: after the plugin places rooms, the Manhattan distance from the Start room to each placed
Room.RemnantRealm room must sit inside [RemnantMinCellsFromStart, RemnantMaxCellsFromStart]. Layouts
outside the band are rejected and retried, not relaxed.
Keep the band generous. The remnant's graph host is fixed per seed, so a band the layout cannot reach fails the whole dungeon once the plugin exhausts its retry budget.
Realm World Placement¶
The room hosts an ARemnantPortalActor; the realm itself is a sub-level streamed into the persistent world
at URemnantRealmSubsystem's reserved world offset (0, 500000, 0) — lateral and far beyond any generated
dungeon's extent, at the same Z so height-dependent sky/fog reads as authored. A portal that leaves
RealmSpawnLocation at zero resolves to that offset, which is why procedurally placed portals need no
hand-authored world position. A future multi-realm allocator hands out reserved-offset + N × stride slots
from the same origin. See Remnant System.
The realm's finale lives inside that streamed sub-level, not in the dungeon: ARemnantBossEventActor
(replicated ERemnantBossEventPhase: Armed → Summoning → Fighting → Collapsing → Ended) is the interactable obelisk
that summons the boss from a wired AEnemySpawner, and on boss death collapses the realm — the
ARemnantSplineBoundsActor darkness polygon shrinks toward the obelisk (client-local MPC animation driven off a
replicated collapse start time) before the end-of-demo screen. Quest completion rides the boss data asset's
kill-credit tags; nothing quest-side lives on the actor. If the tracked player dies mid-event the fight resets in
place (the tear in is one-shot, so leaving would strand the run). Details in
Remnant System.
Environment Tiles / Forest Domain Generation¶
Dungeon generation runs as a two-phase pipeline. The same pipeline serves sealed dungeons and open D3/PoE-style zones (first target: a Forest domain); "open vs closed" is authored tile content plus a fill policy, not a separate algorithm.
| Phase | What | Where |
|---|---|---|
| A — Content placement | Plugin door-walks the topology graph and places designer-authored CONTENT rooms (Start, Combat, Treasure, Boss, Exit …), collision-checked and streamed. Unchanged. | ChooseFirstRoomData / ChooseNextRoomData |
| B — Space fill | Places doorless environment tiles (Filler interior, Edge border) into empty grid cells around the content footprint so the world reads as one continuous place instead of floating slabs. | AEternalDungeonActor fill pass |
Fill runs server-only during generation, before the Load state (invoked from the generator's
OnStateEnd(Generation) hook, once). Tiles are placed as first-class plugin Graph rooms, so they ride the
existing Graph subobject replication and clients stream them from the replicated list — determinism is by
construction, not by re-rolling a seed.
UEternalEnvironmentTile¶
A doorless space tile, subclassed from the plugin's URoomData so it rides AddRoomToDungeon natively, but
kept conceptually separate from content rooms (own pools, own canvas node, never a Room.* content slot).
| Field | Type | Purpose |
|---|---|---|
TileKind |
ETileKind |
Filler (interior walkable ground), Edge (blocking border) or Rise (ground whose bank climbs to a higher neighbour) |
EdgeShape |
EEdgeTileShape |
Edge and Rise tiles: Straight / CornerInner / CornerOuter, authored at North rotation |
RiseLevels |
int32 | Rise tiles and banked Edge tiles: height levels the bank climbs (1 = a bank, 2 = a cliff) |
RiseSide |
EEdgeRiseSide |
Straight Edge tiles: East / West side where the border climbs RiseLevels to a higher border neighbour, carried through the wall or river; None = flat |
EdgeStyle / EdgeStyleEast |
EEdgeStyle |
Edge tiles: border look along the side continuing from North (and East, for corners) |
DisplayName |
FText | Editor/UI label |
EdgeKeyNorth/East/South/West |
FGameplayTag | Reserved for future edge-key matching / WFC (coherent rivers, coastlines); unused in v1 |
ETileKind = { Filler, Edge, Rise }; EEdgeStyle = { Treeline, Cliff, Water } selects which authored edge
variant a border prefers. The tile overrides IsDataValid to drop the plugin's >=1-door requirement
(environment tiles are intentionally doorless) while keeping the other validations.
The exemption is environment tiles only. Content rooms — Room.RemnantRealm included — are
door-connected and validate normally; UEternalRoomData::IsDataValid adds only a SlotTag-is-set check on
top of the plugin's.
FFillPolicy (config knobs)¶
The per-domain policy for Phase B — the "field generator" knobs. Global scalars only; no spatial/directional rules (those belong to edge keys / future WFC).
| Field | Default | Purpose |
|---|---|---|
bFillEnclosedGaps |
true | Always fill cells fully enclosed by occupied neighbors (fixes self-fold voids), regardless of FillRadius |
FillRadius |
0 | Cells within this many tiles of any content room become walkable Filler (0 = enclosed gaps only; 1-2 = road shoulders; large = open wander-field) |
BorderThickness |
1 | Tiles of blocking Edge placed as a ring beyond the filled field |
EdgeStyle |
Treeline | Border look on the sides away from the camera (a tall wall makes a backdrop) |
NearEdgeStyle |
Treeline | Border look on the sides between the camera and the field; keep it low (water, a drop) |
FillRadius + BorderThickness span the whole spectrum: tight corridor -> road shoulders -> open field with
a guiding road (PoE model), with one placement strategy.
UDomainDungeonConfig Environment Fields¶
| Field | Type | Purpose |
|---|---|---|
FillerTiles |
TArray\<UEternalEnvironmentTile*> | Interior walkable ground pool |
EdgeTiles |
TArray\<UEternalEnvironmentTile*> | Blocking border pool (becomes the playable bounds) |
FillPolicy |
FFillPolicy | Fill radius / border / edge style |
GetEnvironmentTiles(Kind) |
accessor | Returns the Filler or Edge pool for a given ETileKind |
Fill Data Flow¶
AEternalDungeonActor (server) generates
│
├─ Phase A: plugin door-walks CONTENT rooms (ChooseFirst/NextRoomData)
│
└─ OnStateEnd(Generation): FillEnvironmentTiles()
│ build Occupied from CONTENT rooms only (Cast-skip env tiles)
│
├─ Pass 1 (Filler): dilate(Occupied, FillRadius) + enclosed gaps
│
└─ Pass 2 (Edge): ring around (content ∪ filler), BorderThickness deep
│ each placed via CreateRoomInstance + AddRoomToDungeon(bFailIfNotConnected=false)
▼
plugin replicates Graph subobject → clients SynchronizeRooms / LoadAllRooms
▼
Load state → nav build (content + edge tiles included)
Reference: ImplementationDocs/ForestDomainGeneration.plan.md.
Height Levels¶
The plugin's grid is 3D (RoomUnit 1000 x 1000 x 400): a door has a height, so a room whose exit door sits a cell up
puts every room after it 4 m higher. A climb room is a content room two or three cells tall with its North door
one or two cells up. The fill pass gives every cell a level (a content room's level is its plugin Z cell) and places
the cell's tile at that height. Where a fill cell borders higher ground it takes a Rise tile: the shape comes from
the same classifier as the border (EEdgeTileShape, higher ground in place of the field) and RiseLevels matches
the step. Where the field steps up along a straight border, the lower border cell takes a banked edge tile
(RiseSide), so the bank runs on through the wall or the river.
Solved fill levels. The fill and border levels are solved, not copied. DungeonGround::LayGround
(Dungeon/DungeonGroundPlan.h) lays the plan; IsValidDungeon and FillEnvironmentTiles both reach it through
PlanGround, so validation rejects exactly the layouts the fill could not level. Each cell starts from the nearest
content level: fill ties to the lower level, border to the higher, and no cell stands above what any content tile
around it shows it. A small search then adjusts fill and border levels until every cell's surround matches a tile the
config has:
- a fill cell below a neighbour matches a rise shape whose RiseLevels is the step;
- a border cell below a neighbour is straight, and only its neighbour along the border (plus the field cell beside
that one) is higher, with a banked tile authored for that side, style and step;
- no cell stands below two different heights, because no tile climbs two amounts.
The search expands the most constrained cell first and prunes neighbour levels after each choice. On the test kit it finished in roughly 50-70 steps and proved a layout had no answer in under 20; it gives up after 5000. A config without rise tiles skips the search and keeps the nearest levels. The fill log reports solve steps and what the kit couldn't express: fill steps no rise shape fits and edge tiles below a neighbour with no banked tile (both 0 on a solved layout), plus banks seen from behind (a face pointing up-screen hides the ground at its foot).
Rooms bigger than one tile. The fill and the height check read every tile under a content room's rotated bounds.
A room whose ground steps inside it lists each tile's level in UEternalRoomData::TileLevels (key: tile offset from
the tile holding the room's origin, at authoring rotation; missing = 0). Its origin must sit at a tile's centre and
its doors on tile centre lines, so the rooms after it stay on the lattice. Each tile's outer sides sit at its level
along their whole length; a step inside the room reaches its outer side as the fill's bank profile, inside the lower
tile, so the fill's Rise tiles beside it line up. Such a lower tile counts as a climb toward its higher neighbour:
its outer side there slopes, so only fill may border it, and its corner on the high side stands at the upper level.
With this camera (yaw 50) the one line of the tile grid that faces the camera is a tile's diagonal, so a set piece
with a wall turned to the camera raises one corner tile of a 2x2 room and runs the wall along that tile's diagonal.
Entry doors. A room composed to be walked one way lists its entry door in UEternalRoomData::EntryDoors;
ChooseNextRoomData then places it only through that door, and an entry door never leads on. Paired with a rotation
constraint, the room fits only where the run already heads its way. The plugin never turns the first room, and the
forest start's only door faces South (toward the camera), so a run must turn twice before it heads North.
Rooms placed without a draw. A room with UEternalRoomData::bPlaceWithoutDraw set, alone in its slot's pool, with
one entry door and RandomDoor off, is placed without drawing from the layout stream: ChooseNextRoomData takes it
without a pool pick, the single entry door needs no door pick, and its one exit leads to its one neighbour without a
draw. Insert such a room into a topology's road and every room after it is placed as the same seed placed it before,
moved along the road by the room's length. The Chasm's start node uses this for its tutorial room
(RD_Forest_Tutorial, slot Room.Tutorial, between the start and the first junction through
Topology_Forest_Start). Fill and border tiles around the new room still change. IsDataValid reports the flag set without
that door setup.
More doors instead of rotation. Rooms whose look depends on the camera (starts, exits, landmarks, composed rooms)
keep their authored rotation and offer several doors instead. The plugin offers every free door of a placed room to
ChooseNextRoomData; each door leads only to one of that room's own unplaced topology neighbours
(ChooseTopologyRoomForDoor), never to the next room of another branch. PickWaitingNeighbour decides:
- a door with nothing left to lead to stays closed;
- when a room has more free exits than neighbours left, the spare ones close at random, at odds that make every exit
equally likely, so a fixed room still sends runs off different ways;
- with several neighbours waiting (a side room beside the route) the door takes one of them at random, so the route
too leaves by any exit. With one neighbour waiting nothing is drawn, so linear topologies keep their layouts per
seed.
A topology room counts as placed only once the plugin adds it (OnRoomAdded), so a room that doesn't fit at one door
stays free for the parent's next.
Height limit. UDomainDungeonConfig::MaxHeightLevels caps the spread between the lowest and highest content
ground of a run. ChooseNextRoomData keeps a room only through a door that holds its ground (door heights and
TileLevels) inside the window around the rooms placed so far, and picks that door (RandomDoor off).
Void plane. Lighting levels lay a black plane (SM_VoidPlane) under the world at the start room's height. After
generation, and whenever a lighting level finishes loading, the dungeon actor drops every actor showing that mesh by
as far as the lowest room floor lies below the start room, on every machine. The floor is a room's lowest bound
(FirstPoint.Z), so a room whose ground dips below its floor (a gorge) extends its bounds that deep, or the plane
covers the dip when the room sits on the run's lowest level.
Camera rules (Camera/EternalCameraRig.h holds the fixed yaw and pitch):
- Climbs carry a URoomConstraint_Direction (North, East) so their high side faces up-screen. The plugin checks
room constraints only when it picks rooms itself; ChooseNextRoomData filters the pool by them and picks the entry
door (the room data needs RandomDoor off, or the plugin replaces that choice). A climb entered by its high door is
a descent, which keeps the same camera-facing bank.
- Borders take FFillPolicy::NearEdgeStyle on sides whose field lies up-screen of them (between camera and
player) and EdgeStyle elsewhere; edge tiles are picked by shape and side styles.
IsValidDungeon also rejects layouts where two content rooms share a ground tile (the voxel overlap test lets a road
pass over itself a level up) or where neighbouring tiles of two content rooms, edge or corner, show each other
different ground. A one-tile climb shows its top on its high side (its highest door's side) and a slope on its flanks,
which no flat room can meet. Fill and border cells likewise stand no higher than what any content tile around them
shows them, corners included. Last, it rejects layouts whose fill levels can't be solved. These are layouts where
rooms of three heights come within a tile of each other, or where a step reaches the border at a corner. The plugin
retries (MaxGenerationTry 500), and in the kit sweep about half the raw layouts needed another try.
Test kit. Tools/Python/build_height_steps_kit.py builds greybox climb, rise, cliff and border tiles (cliff walls
far, a river near, banked variants of both), the 2x2-tile Outcrop set piece (low ground, a ledge up a sheer cliff, a
plateau two levels up), configs (MaxHeightLevels 4) and the map /Game/Developers/HeightSteps/Maps/L_HeightSteps
(git-ignored, rebuilt by the script). Every border style comes back to the river's far-bank height at its outer rim
(the cliff's back drops behind the wall). The ring between two lobes of the field puts border tiles back to back, and
their rims must meet whatever their styles. Measure a run with height_steps_sweep.py (editor open on the map) and
height_steps_seams.py (seams between tiles, from the height functions). Known gap: the void plane is found by its
mesh.
Generation Pipeline¶
5-Step Process¶
GenerateDungeon(Config, Seed, bIsHQ)
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Step 1: SelectTopology │
│ • Pick from Config->StandardTopologies or HQTopologies │
│ • Random selection using FRandomStream(Seed) │
│ • Call CalculateDepths() for floor assignment │
└────────────────────────────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Step 2: CreateRoomsFromTopology │
│ • For each FTopologyNode: │
│ • Create FDungeonRoom with new FGuid │
│ • Copy Role + SlotTag from node │
│ • SelectRoomTemplate(Node.SlotTag, Config, Random) │
│ • Assign RoomSeed = Random.RandHelper() │
│ • Set FloorIndex from Node.Depth │
│ • Group into FDungeonFloor by depth │
└────────────────────────────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Step 3: BuildRoomConnections │
│ • For each topology edge (NodeA → NodeB): │
│ • Get RoomA.RoomID, RoomB.RoomID │
│ • Add bidirectional connection │
└────────────────────────────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Step 4: CalculateMapPositions │
│ • Assign FVector2D positions for UI display │
│ • X: Distribute rooms horizontally within floor │
│ • Y: Based on FloorIndex │
└────────────────────────────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Step 5: InitializeRoomStates │
│ • StartRoom → Available │
│ • All other rooms → Locked │
│ • Set CurrentRoomID = InvalidGuid (player not yet inside) │
└─────────────────────────────────────────────────────────────────┘
Topology override. FWorldMapNode::TopologyOverride names one topology the node always builds; Step 1 then skips
the pick and uses it. Rooms, fill and encounters still come from the node's config. An override that is invalid or
ends the other way (exit vs boss) is ignored with a warning. UDungeonSubsystem keeps it so a regeneration replays it.
Determinism Guarantee¶
Same inputs always produce identical output:
| Input | Effect |
|---|---|
Seed |
Initializes FRandomStream: the entry's layout seed (FWorldMapNode::GetLayoutSeed(), node identity + entry count, or the node's pin), recorded in UWorldMapSubsystem::GetActiveEntry(). A sub-dungeon seeds from the same entry seed plus its config tag |
Config |
Provides topology + room pools |
bIsHQ |
Selects Standard vs HQ topologies |
For multiplayer: only the server generates. Clients never regenerate — they receive the plugin's
replicated UDungeonGraph (room instances, positions, connections) and stream the same levels the
server placed. The seed matters for reproducibility (each entry into a node draws a new layout; the node's
modifiers come from a separate seed, node identity + its domain's tier, so they hold across entries), not for client
sync. A preset's StartLayoutSeed builds the same layout on every entry into its start node during that preset's
session; Content.Dungeon.GenerationRegression pins each such layout room by room (room data, grid cell, rotation, fill
included), so a generator change that moves one fails the suite.
Plugin Bridge¶
AEternalDungeonActor¶
Extends ADungeonGenerator from ProceduralDungeon plugin to use our topology.
Our System Plugin System
┌────────────────────┐ ┌────────────────────┐
│ FDungeonInstance │ │ ADungeonGenerator │
│ • FDungeonRoom │──────────────│ • URoom (spatial) │
│ • Connections │ Bridged by │ • Doors │
│ • Roles/SlotTags │ EternalDung │ • Level Streaming │
└────────────────────┘ eonActor └────────────────────┘
Key Overrides¶
| Override | Purpose |
|---|---|
ChooseFirstRoomData() |
Return Start room's UEternalRoomData |
ChooseNextRoomData() |
Return one of the door's own room's unplaced topology neighbours (or close the door); honours entry doors, room placement constraints and MaxHeightLevels (picks the entry door) |
IsValidDungeon() |
All topology rooms placed; landmark/remnant bands; height steps (see Height Levels) |
ContinueToAddRoom() |
Topology rooms not yet added to the graph |
ChooseDoor() |
Spawn AEternalDoor between rooms |
OnPostGeneration() |
Register URoom ↔ FGuid mappings |
Room Mapping Flow¶
OnDungeonGenerated(Topology)
│
▼
InitializeFromTopology()
│ Reset placement tracking
▼
Plugin calls ChooseFirstRoomData() / ChooseNextRoomData() per free door
│ Each door leads to one of its room's unplaced topology neighbours, or stays closed
│ We return URoomData from our pools
│ Plugin handles spatial placement
▼
OnPostGeneration()
│
▼
For each placed URoom:
│
▼
DungeonSubsystem->RegisterPluginRoom(URoom, FGuid)
│
▼
OnDungeonReady broadcast
Bidirectional Mapping¶
| Direction | Map | Use Case |
|---|---|---|
PluginRoomToRoomID |
URoom* → FGuid | Door transitions |
RoomIDToPluginRoom |
FGuid → URoom* | State queries |
Runtime State Management¶
Room State Transitions¶
TryEnterRoom(RoomID)
│
├─ CanEnterRoom(RoomID)?
│ ├─ Room.State == Available or Cleared → YES
│ └─ Otherwise → NO, return false
│
├─ Previous room was Current (not Cleared)?
│ └─ SetRoomState(Available) (Cleared rooms are never demoted)
│
├─ CurrentRoomID = RoomID
├─ SetRoomState(RoomID, Current) (no-op if the room is already Cleared)
│
└─ OnCurrentRoomChanged broadcast
MarkRoomCleared(RoomID)
│
├─ SetRoomState(RoomID, Cleared)
│
├─ UnlockConnectedRooms(RoomID)
│ │
│ └─ For each connected room:
│ If Locked → SetRoomState(Available)
│
└─ Is terminal room (Boss/Exit)?
└─ OnDungeonCleared broadcast
Encounter Gates¶
AEncounterGateActor is a replicated blocking gate placed in a room level; the server evaluates the lift
condition and sets GateState, clients render open/close via OnRep. EGateMode picks the condition:
| Mode | Lift condition | Wiring |
|---|---|---|
SingleEncounter |
The wired ARoomEncounterActor (same level) completes |
EncounterActor reference set in the level editor |
AdjacentRoomsCleared |
Every neighbouring content room that has a real encounter reaches Cleared |
None — resolves its own room via GetRoomIDForLevel(GetLevel()) |
AdjacentRoomsCleared exists to seal the injected Remnant tile. Its neighbour set is the topology edges
(GetConnectedRoomIDs) unioned with UDungeonSubsystem::GetSpatiallyAdjacentRoomIDs — injected rooms carry a
single graph edge but physically border other tiles, and the shroud must hold on every side. Rooms without a spawned
encounter can never reach Cleared, so they are exempt: only rooms in the encounter registry
(RegisterRoomEncounter, self-registered by ARoomEncounterActor once it has >=1 enemy) are required. An enemy that
idles by lurking is never counted (it may never be met), so a room holding only lurkers has no encounter. An empty
required set opens the gate immediately (logged as a warning). In this mode the gate is a hollow perimeter shell:
four invisible ShroudWalls sized from the BlockingVolume extent (ShroudWallThickness) carry collision, and the
volume itself is only the authoring bounds.
Shared by both modes: GrantOnOpenTag (a quest tag granted to every player on an announced open — silent
initialization opens, such as an already-cleared restore, skip it so nothing grants on load) and an optional
BannerTitle / BannerSubtitle / BannerIcon event banner through UEventBannerController.
Boss Room Fill¶
An HQ dungeon's boss room is fought and left through three things: a boss, an ARoomEncounterActor the boss belongs to,
and an AEndPortalActor that opens when that encounter clears the room (the terminal room, so OnDungeonCleared). A boss
room level may author all three. Where it lacks any, the server adds them from the domain config:
AEternalDungeonActor::FillBossRoom runs once every room's level is in, right before MarkRoomsReady, through
FBossRoomFill (Dungeon/BossRoomFill.h).
What the level holds always wins; the fill only adds what is missing and never changes an authored actor.
| The level holds | The fill adds |
|---|---|
No spawner whose EnemyDataOverride is a UBossDataAsset (encounter pools hold no bosses) |
An AEnemySpawner named BossRoomFill_Spawner: the config's BossEncounter, SpawnCountRange (1, 1). With no BossEncounter either, or one with no EnemyBlueprint (also a validator error), nothing at all |
A boss to fight but no ARoomEncounterActor |
BossRoomFill_Encounter, its RoomID set to the boss room |
A boss to fight but no AEndPortalActor |
BossRoomFill_Portal, of BossRoomPortalClass (BP_EndPortalActor) |
The boss joins the level's encounter whichever of them made it (ARoomEncounterActor::TrackSpawner). Everything is
spawned into the boss room's own level instance (OverrideLevel, as spawners place their enemies), so a death reload
unloads it with the level and the fill runs again on the regenerated rooms. The spawner registers for the dungeon's spawn
pass like any placed spawner: its draws are seeded from the room cell and its fixed name, it fires before OnDungeonReady,
and the room is in the encounter registry when gates look. A portal whose level holds no encounter waits for
OnDungeonReady inside a generated dungeon before opening, so an encounter the fill adds still holds an authored portal.
Placement. An actor in the room level tagged BossSpot or BossPortalSpot gives that spot exactly. Otherwise
FBossRoomFill::PlanLocalSpots works from room data alone: the entrance is the boss room's first connected door; both
spots lie on the line through the room's bounds centre along the way in, the boss at 0.6 and the portal at 0.85 of the
room's depth from the entrance's wall, at the entrance's floor height, both facing out through that wall. The room's
transform in the dungeon moves them into the world; each is then projected onto the navmesh (300 cm across, the room's
height up and down; where the navmesh does not reach, onto the room level's own ground through FindRoomGround, a trace
that passes through anything not of the room's level) and lifted, the spawner by the boss's capsule half height (authored
height × the capsule's relative scale, never the class default's scaled height, which reads differently from one moment to
the next). The portal is not lifted: every portal stands itself on the floor below it as it begins play (see The
portal's look). Nothing random goes in, and the
navmesh is the one the plugin builds, blocking, as the load ends (ADungeonGeneratorBase::OnStateEnd(Load) with
bRebuildNavmesh), so the same seed gives the same transforms after every reload, solo or after a co-op wipe under lag; a
nav build still running at the fill is logged as a warning. A room whose computed spot falls badly places a BossSpot /
BossPortalSpot hint. In L_Room_Vorath_Boss_01 (door on the −Y wall of the −X column) the boss stands 1200 cm in on the
room's centre line and the portal 1700 cm in.
Clients receive the boss and the portal through ordinary replication; the encounter stays on the server. A guest never
fills: the client's own OnPostGeneration reaches SignalRoomsReady without authority.
Start Portal¶
Every generated dungeon, and every node that streams a fixed level and is not a safe zone, has a portal where the party
arrives as well as its exit, so the party can open the map for travel from there. What the map does with it is in World Map System. It is
the same AEndPortalActor and Blueprint (BP_EndPortalActor) in another role:
EEndPortalRole |
Opens | Taking it |
|---|---|---|
Exit (default) |
When the dungeon, or its level's encounter, is cleared | Clears the node (MarkNodeCleared), then opens the taker's map for travel. A playtest preset with bNoExitPortalAtStart removes it from its start node on the host as it begins play |
Entrance |
At once, as it begins play: no cleared, ready or encounter wait | Opens the taker's map for travel; clears and counts nothing |
The role is set through SetPortalRole before the portal begins play and replicates COND_InitialOnly, so a spawned
entrance reads Entrance on clients too. FBossRoomFill::Survey counts only exit portals, so an entrance never stands in
for a boss room's way out. The Blueprint event OnPortalActivated fires from OnRep_PortalState on clients and from
ActivatePortal on the server, never from a multicast: a portal that opens as it spawns does so before any client has a
channel to it, so the multicast would never reach guests or late joiners.
Placement (FStartPortal, Dungeon/StartPortal.h, pure statics like FBossRoomFill). Both cases run
FStartPortal::Place on the server, which checks the node, then the level, then picks the spot:
- A generated dungeon:
AEternalDungeonActor::PlaceStartPortalruns inSignalRoomsReadyright afterFillBossRoomand beforeMarkRoomsReady, so the portal stands before anyone spawns. The arrival is the start room level's own highest-priorityAEternalPlayerStartthat matchesDungeonStart; the room's bounds and doors come from its room data (RoomOutline). - A fixed level:
AEternalDungeonActor::OnFixedLevelStreamingCompleteruns when the server'sUWorldMapSubsystem::OnFixedLevelStreamingCompletefires for the node's level. The arrival is the player start the spawn manager brings the party to (FindSpawnPointForContextwith its late-join context and the node), and only if that start stands in the streamed level. A fixed level has no room data: its whole extent (ALevelBounds::CalculateLevelBounds) stands in for the room and it has no doors to keep clear. A reload or a new arrival streams the level afresh, so each arrival gets one portal; a second completion for a level that is already in adds nothing (HoldsEntrance).
An actor in the level tagged StartPortalSpot gives the spot exactly. Otherwise the portal takes the first of eight
spots relative to the arrival (yaw only): 1.5 m in and 4 m to the right,
then the left; 4.5 m in, either side; 6 m to either side; 2 m behind, either side. A spot must lie in the room's bounds at
least 1.5 m off its walls and at least 4 m from every door of the room (connected or not), and pass IsClearInRoom: the
room level's ground under it within 1.5 m of the arrival's floor, and nothing of the room's level between the two at 1 m
height. The eight candidates also keep 2.5 m from each of the nine spots the spawn manager spreads a party on, but by
construction: the spec checks the offsets (FStartPortal::PartyClearance), nothing tests it at runtime. The spot faces
the arrival and is grounded as the boss room's portal is; the portal then stands itself on the floor. StartPortalClass
(soft, default BP_EndPortalActor_C) is separate from the boss room's BossRoomPortalClass, so either can change alone.
Nothing random goes in. A level that holds an entrance portal of its own gets none added (HoldsEntrance); a start level with
neither a tag nor a player start, or with no spot that fits, gets none and logs a warning.
Where it goes. Every node a dungeon is generated for, sub-dungeons included, since they generate through the same
SignalRoomsReady, and every node that streams a FixedLevel, whatever its type: the Chasm's two story (Event) nodes
included, story (L_Room_Forest_Start, from its StartPortalSpot) and buriedSteps (L_Room_Crimson_Desert, beside
its player start). Not in a safe zone (FStartPortal::IsWanted, on the node: the Hub and the Camps, whose map opens for
travel anyway), and not in a Remnant Realm (an in-world teleport into a streamed sublevel, neither a generated dungeon
nor a node's fixed level). The exit is unchanged: a fixed level's own exit portal, if it has one, opens by the usual
rule (its level's encounter cleared, or at once with none), and a story node is a hub-type node, so leaving it by either
portal marks it cleared.
The server spawns it into the arrival's level instance as StartRoom_Portal, replicated and always relevant, as the
boss fill spawns its portal: guests and late joiners receive it through ordinary replication, and a node reload respawns it
under the same name.
How to place a StartPortalSpot. Put any actor (a TargetPoint is enough) in the start room's own level and give it
the actor tag StartPortalSpot. It wins over the planned spots and skips every check above (walls, doors, the party's
spread, IsClearInRoom), so make sure the spot is open floor the camera sees. The actor's yaw turns the portal but does
not pick which face shows the seal: the stone turns itself so the seal faces the camera. The portal grounds itself from
up to 60 cm above the spot to 400 cm below it, so put the spot on or a little above the floor. Example:
L_Room_Forest_Start at (295, -76, 10).
The portal's look¶
Every portal, start and exit, is the same stone milestone (BP_EndPortalActor):
- Mesh:
SM_PortalMilestoneon theStoneMeshcomponent, materialMI_PortalMilestone(M_PortalMilestone). The seal is carved on the stone's +X face. Every stone draws the same mark today;M_PortalMilestonehas aSealTex/UseSealTexslot for per-node seals that nothing sets yet. - Facing: as it begins play the stone turns in quarter turns so its seal face is the side most toward the fixed game
camera (
AEndPortalActor::FaceSealToCamera). Quarter turns keep the square footprint and collision where they were placed, and every machine lands on the same turn. - Grounding:
GroundToFloortraces from 60 cm above the actor to 400 cm below it and stands it on the first surface that blocks sight. A miss leaves it where it is. Every portal does this, placed or spawned. - Open state: custom primitive data on the stone: 0 = Open (0 to 1; the seal draws itself in), 1 = Breath (the slow dip
of the glow). The effect
NS_PortalMilestone(rising motes) readsUser.Open. Opening fades overOpenFadeTime(1.5 s) on every machine, late joiners included; a 30 Hz timer runs only while a stone fades or is lit, never on a dedicated server. - Light:
PortalLight, a point light 150 cm over the stone's centre: deep blue, intensity 9, attenuation radius 500 cm, exponent falloff, no volumetric scattering. It scales with Open and breathes byBreathDepth(0.05). A light toward the camera side would paint the foliage in front, so it hangs over the stone. Its intensity is read inPostInitializeComponents, before a client applies the replicated state. - Shadows:
Eternal.Portal.LightShadows(default 1) sets whether the light casts shadows; read as a portal begins play. The Steam Deck profile sets it to 0.
Area Context¶
When entering a dungeon node, WorldMapSubsystem sets context:
| Property | Source | Used By |
|---|---|---|
CurrentAreaLevel |
UWorldMapSubsystem::GetNodeAreaLevel(Node): the node's effective depth (DepthOverride, else Depth), plus the domain's tier bonus above Tier I, or a preset's StartAreaLevel on its start node; at least 1 |
Enemy scaling, the item level of drops |
CurrentEncounter |
WorldMapData resolution | Spawners |
CurrentAreaModifiers |
Node.RolledModifiers | DungeonModifierComponent |
Area modifiers are applied to each player via UDungeonModifierComponent during the spawn flow. The modifier pool is also registered with ModifierSubsystem so that GetDefinition() works for both item and dungeon modifiers.
Debugging¶
Cheats on UEternalCheatManager (authority only — PIE listen host):
| Cheat | Purpose |
|---|---|
ListDungeonRooms |
Log every placed content room/tile (environment filler skipped) with plugin room ID, slot tag, room-data asset name and world center |
TeleportToRoom <Query> |
Teleport the pawn to a placed room. Query is a substring of the slot tag or room-data asset name (Remnant, Exit, Landmark) or a numeric plugin room ID from ListDungeonRooms / the Cog DungeonMap window. Lands on the navmesh nearest the tile center |
Both share GetDungeonRoomTargets with the Cog DungeonMap window so IDs always agree.
WorldMap Integration¶
Entry Flow¶
WorldMapSubsystem::TravelToNode(DungeonNode)
│
├─ Node.GeneratesDungeon() → true
│
├─ EnterNode records the entry: ++EntryCount, ActiveEntry.LayoutSeed
│
├─ GetEffectiveDungeonConfig(Node)
│
├─ SetAreaContext(GetNodeAreaLevel(Node), Encounter, RolledModifiers)
│ └─ Registers modifier pool with ModifierSubsystem
│
└─ DungeonSubsystem->GenerateDungeonWithSeed(Config, ActiveEntry.LayoutSeed, bIsHQ)
│
▼
OnDungeonGenerated → AEternalDungeonActor starts generation
│
▼
OnDungeonReady → Player can enter Start room
Exit Flow¶
Player clears Exit/Boss room (its encounter completes)
│
▼
MarkRoomCleared(TerminalRoomID)
│
▼
OnDungeonCleared broadcast → AEndPortalActor (role Exit) activates
│
▼
A player takes the portal (server)
│
▼
WorldMapSubsystem->MarkNodeCleared(CurrentNodeID)
│
├─ UpdateUnlockedNodes() → adjacent nodes become Available
│
└─ (If HQ) LiberateDomain(DomainTag)
Fixed Level Unloading¶
When traveling to a Hub/Camp, dungeons are unloaded:
AEternalDungeonActor::OnFixedLevelEntered(NodeID, Level)
│
▼
Destroy generated dungeon
│
▼
DungeonSubsystem->ClearDungeon()
Public Contracts¶
Methods¶
| Method | Parameters | Purpose |
|---|---|---|
GenerateDungeon |
Config, bIsHQ |
Generate with random seed |
GenerateDungeonWithSeed |
Config, Seed, bIsHQ |
Generate with specific seed |
ClearDungeon |
- | Clear current dungeon |
SetAreaContext |
AreaLevel, Encounter, AreaModifiers |
Set spawner/modifier context |
ApplyAreaModifiersToPlayer |
AEternalPlayerCharacter* |
Apply current modifiers via DungeonModifierComponent |
RemoveAreaModifiersFromAllPlayers |
- | Clear modifiers from all players |
HasActiveDungeon |
- | Check if dungeon exists |
GetDungeon |
- | Get current FDungeonInstance |
GetCurrentRoom |
- | Get player's current room |
GetRoom |
RoomID |
Get room by ID |
GetAccessibleRoomIDs |
- | Get enterable room IDs |
CanEnterRoom |
RoomID |
Check if room is accessible |
TryEnterRoom |
RoomID |
Attempt room transition |
MarkRoomCleared |
RoomID |
Complete a room |
IsDungeonCleared |
- | Check if terminal reached |
RegisterPluginRoom |
URoom*, FGuid |
Map plugin room to our ID |
GetRoomIDFromPluginRoom |
URoom* |
Lookup our ID from plugin room |
GetPluginRoomFromRoomID |
FGuid |
Lookup plugin room from our ID |
OnPlayerEnteredPluginRoom |
URoom* |
Handle door transition |
GetRoomIDForLevel |
ULevel* |
Resolve RoomID from streaming level instance |
Delegates¶
| Delegate | Payload | When Fired |
|---|---|---|
OnDungeonGenerated |
FDungeonInstance& |
Topology created, rooms not streamed |
OnDungeonReady |
- | All rooms loaded, ready to play |
OnRoomStateChanged |
FGuid, ERoomState |
Any room state changes |
OnCurrentRoomChanged |
FGuid |
Player entered new room |
OnDungeonCleared |
- | Terminal room (Exit/Boss) cleared |
Source References¶
Core Types¶
FDungeonRoom- Source/ProjectEternal/Public/Dungeon/DungeonTypes.h:39FDungeonFloor- Source/ProjectEternal/Public/Dungeon/DungeonTypes.h:102FDungeonInstance- Source/ProjectEternal/Public/Dungeon/DungeonTypes.h:127ERoomRole- Source/ProjectEternal/Public/Dungeon/DungeonTypes.h:15ERoomState- Source/ProjectEternal/Public/Dungeon/DungeonTypes.h:26
Topology¶
FTopologyNode- Source/ProjectEternal/Public/Dungeon/DungeonTopology.h:13FDungeonTopology- Source/ProjectEternal/Public/Dungeon/DungeonTopology.h:49
Subsystem & Generator¶
UDungeonSubsystem- Source/ProjectEternal/Public/Dungeon/DungeonSubsystem.h:27UEternalDungeonGenerator- Source/ProjectEternal/Public/Dungeon/EternalDungeonGenerator.h:19
Plugin Bridge¶
AEternalDungeonActor- Source/ProjectEternal/Public/Dungeon/EternalDungeonActor.h:27AEternalDungeonActor::PickWaitingNeighbour(door choice) - Source/ProjectEternal/Public/Dungeon/EternalDungeonActor.hDungeonGround::LayGround/FGroundPlan/ClassifyCell(ground planning, level solver) - Source/ProjectEternal/Private/Dungeon/DungeonGroundPlan.hEternalCameraRig(fixed camera angles) - Source/ProjectEternal/Public/Camera/EternalCameraRig.h
Configuration¶
UDomainDungeonConfig- Source/ProjectEternal/Public/Dungeon/DataAssets/DomainDungeonConfig.h:20UDungeonModifierPoolDataAsset- Source/ProjectEternal/Public/Dungeon/DataAssets/DungeonModifierPoolDataAsset.hRemnantRealmChance/RemnantMinCellsFromStart/RemnantMaxCellsFromStart- Source/ProjectEternal/Public/Dungeon/DataAssets/DomainDungeonConfig.h:112
Remnant Realm Injection¶
UEternalDungeonGenerator::TryInjectRemnantRealmRoom- Source/ProjectEternal/Private/Dungeon/EternalDungeonGenerator.cpp:243UDungeonSubsystem::ResolveRemnantRealmChance- Source/ProjectEternal/Private/Dungeon/DungeonSubsystem.cpp:97AEternalDungeonActor::SatisfiesRemnantPlacement- Source/ProjectEternal/Private/Dungeon/EternalDungeonActor.cpp:617URemnantRealmSubsystemreserved offset - Source/ProjectEternal/Private/Remnant/Subsystems/RemnantRealmSubsystem.cpp:17
Room & Environment Tiles¶
UEternalRoomData(+GetRoomDataForActor) - Source/ProjectEternal/Public/Dungeon/DataAssets/EternalRoomData.hUEternalEnvironmentTile/ETileKind/EEdgeStyle/FFillPolicy- Source/ProjectEternal/Public/Dungeon/DataAssets/EternalEnvironmentTile.hFillerTiles/EdgeTiles/RiseTiles/FillPolicy/MaxHeightLevels/GetEnvironmentTiles- Source/ProjectEternal/Public/Dungeon/DataAssets/DomainDungeonConfig.h
Dungeon Actors¶
FBossRoomFill(boss room survey, rule, spots, spawn) - Source/ProjectEternal/Public/Dungeon/BossRoomFill.h; run byAEternalDungeonActor::FillBossRoomARoomEncounterActor- Source/ProjectEternal/Public/Dungeon/Actors/RoomEncounterActor.hAEndPortalActor(EEndPortalRole:Exit,Entrance) - Source/ProjectEternal/Public/Dungeon/Actors/EndPortalActor.hFStartPortal(start portal spots and spawn) - Source/ProjectEternal/Public/Dungeon/StartPortal.h; run byAEternalDungeonActor::PlaceStartPortal(a start room) andAEternalDungeonActor::OnFixedLevelStreamingComplete(a fixed level)AEncounterGateActor(EGateMode) - Source/ProjectEternal/Public/Dungeon/Actors/EncounterGateActor.hARemnantBossEventActor- Source/ProjectEternal/Public/Remnant/Actors/RemnantBossEventActor.hARemnantSplineBoundsActor- Source/ProjectEternal/Public/Dungeon/Actors/RemnantSplineBoundsActor.hUEternalCheatManager::TeleportToRoom/ListDungeonRooms- Source/ProjectEternal/Public/Debug/EternalCheatManager.hASubDungeonEntrance- Source/ProjectEternal/Public/Dungeon/Actors/SubDungeonEntrance.h
Area Modifiers¶
UDungeonModifierComponent- Source/ProjectEternal/Public/Dungeon/Components/DungeonModifierComponent.h
Related Systems¶
- World Map System - Triggers dungeon generation from node travel
- Spawning System - Uses encounter data for enemy spawning
- Enemy AI - AI behavior in dungeon rooms
- Replication Overview - Seed-based multiplayer sync
Recent Changes¶
| Date | Change | Impact |
|---|---|---|
| 2026-11-25 | Lurkers don't hold up a clear | ARoomEncounterActor skips enemies whose idle is to lurk: one nobody walks near never dies, and its room would never clear for an AdjacentRoomsCleared gate |
| 2026-11-08 | Exit portal withheld for a playtest | A preset's bNoExitPortalAtStart removes the start node's exit portal during that preset's session; the demo presets set it |
| 2026-11-08 | Tutorial room on the Chasm start | FWorldMapNode::TopologyOverride makes a node build one topology; the Chasm combat node builds Topology_Forest_Start, whose new Room.Tutorial node puts RD_Forest_Tutorial (a copy of the straight room, L_Room_Forest_Tutorial) between the start and the first junction. bPlaceWithoutDraw keeps the rest of the pinned layout as it was, one room further along (Rooms placed without a draw) |
| 2026-10-20 | Start portal in fixed levels | A node that streams a fixed level and is not a safe zone gets the start portal too, from the server's fixed-level streaming completion, beside the spawn manager's arrival or at a StartPortalSpot (Start Portal). Both Chasm story nodes now have a way to the map besides Return to Camp. FStartPortal::Place / PlanBeside / RoomOutline hold the shared placement. Spec Content.Dungeon.StartPortal ("in a node's fixed level") |
| 2026-10-20 | Portal look; grounding; review fixes | Every portal is the stone milestone (The portal's look) and grounds itself, so BossRoomPortalHeight and StartPortalHeight are gone. An exit portal clears only the node it began play in, and the server refuses interactions while a transition runs. How to place a StartPortalSpot. Eternal.Portal.LightShadows is 0 on the Deck. Spec Content.Dungeon.EndPortal |
| 2026-10-19 | Start portal; portal roles | Every generated dungeon's start room gets an always-open portal beside the arrival: AEndPortalActor in its new Entrance role (EEndPortalRole), placed by FStartPortal from a StartPortalSpot tag or the level's player start (Start Portal). OnPortalActivated now fires from the portal's OnRep; Multicast_ActivatePortal is gone. Specs Unit.Dungeon.StartPortal, Content.Dungeon.StartPortal |
| 2026-10-18 | Area level and entry seed in the docs | "Area Context" and "Entry Flow" now show what travel does: the area level is GetNodeAreaLevel (effective depth, tier bonus, a preset's start level), and the dungeon generates through GenerateDungeonWithSeed with the entry's layout seed |
| 2026-10-17 | Boss room fill | An HQ boss room whose level lacks a boss, an encounter or an end portal gets them from the config (BossEncounter is now read) when its rooms are in, spawned into its level, placed from room data and the navmesh; an authored actor always wins (Boss Room Fill). A portal with no encounter in its level waits for OnDungeonReady in a generated dungeon. Specs Unit.Dungeon.BossRoomFill, Content.Dungeon.BossRoomFill |
| 2026-10-17 | Preset start seeds in the fingerprint; the Ashwoods HQ | GenerationRegression fingerprints each preset's start layout (<map>/<node>@<seed>) beside node pins; DungeonConfig_Forest gained an HQ topology (Topology_HQ_Linear), a boss room pool and BossEncounter, so the Ashwoods Lord is fought in a forest HQ |
| 2026-10-17 | Tier rules on the domain config | TierRules (FDomainTierRule: AreaLevelBonus, optional ModifierPool) set a domain's tiers above the first; the world map raises a liberated domain through them. Shipped configs define none yet |
| 2026-10-17 | Layout seed per entry, modifiers per tier | The dungeon seed is FWorldMapNode::GetLayoutSeed() (node + EntryCount, salted; or the pin), recorded per travel in UWorldMapSubsystem::GetActiveEntry(), which also seeds sub-dungeons; the modifier roll uses GetModifierSeed(Tier) and no longer moves with clears. GenerationRegression gained a room-for-room fingerprint of every pinned layout, built through the real travel and plugin-bridge path in a standalone game world |
| 2026-10-15 | Height levels in generated dungeons | Climb rooms step the road a level or two through raised doors; fill cells take solved levels and Rise tiles, borders banked tiles (RiseSide) and a camera-facing style (NearEdgeStyle); rooms bigger than one tile (TileLevels), EntryDoors, MaxHeightLevels; layouts whose ground can't be levelled are rejected and retried; the void plane drops under the lowest floor. A door now leads only to its own room's unplaced neighbours (it used to take the next room of a global queue, so a spare door could take another branch's room), picking at random when several wait. Ground planning moved to DungeonGroundPlan with specs (Unit.Dungeon.GroundPlan, Unit.Dungeon.DoorChoice). Kit sweeps: 12 seeds, 0 seams; the forest config still generates |
| 2026-08-20 | Cleared is terminal; AdjacentRoomsCleared gate mode; room cheats; realm finale actors documented |
SetRoomState refuses transitions out of Cleared (player location = CurrentRoomID) — fixed a shroud-gate soft-lock on backtracking. AEncounterGateActor gained EGateMode::AdjacentRoomsCleared (unwired, topology + GetSpatiallyAdjacentRoomIDs neighbours, encounter-registry exemption, perimeter shell), GrantOnOpenTag and banner fields. TeleportToRoom / ListDungeonRooms cheats. ARemnantBossEventActor + ARemnantSplineBoundsActor drive the realm collapse |
| 2026-08-06 | Remnant Realm rooms are injected, door-connected content | TryInjectRemnantRealmRoom hangs a Room.RemnantRealm room off a 2-edge road host (host retagged to Room.Junction), rolled on its own descent-seed stream; SatisfiesRemnantPlacement rejects and retries layouts outside RemnantMin/MaxCellsFromStart. Supersedes the 2026-07-29 row below: there is no door-count exemption for Room.RemnantRealm — only UEternalEnvironmentTile is exempt |
| 2026-07-29 | Enemy density policy on DomainDungeonConfig | FEnemyDensityPolicy (EnvironmentSpawnerChance + MaxEnvironmentEnemies) gates environment-tile spawners in MarkRoomsReady; content-room spawners exempt. See Enemy Performance |
| 2026-07-29 | Room.RemnantRealm exempt from ≥1-door validation | Remnant realm rooms are space-fill tiles placed without doors; the door-count validator now skips them |
| 2026-07-03 | Content model: ERoomRole + SlotTag | ERoomType/GetRoomsByType removed; structure = ERoomRole (Start/Normal/Terminal), content = FGameplayTag slot (Room.*) resolved via tag-addressed RoomPools map (GetRoomsBySlot); per-slot encounter overrides (SlotEncounters) |
| 2026-07-03 | Landmark / POI sub-dungeons | Room.Landmark slot rooms host ASubDungeonEntrance descending into room-data-authored SubDungeonConfig via EnterSubDungeon (run-ender, optional key consumption); LandmarkMinCellsFromStart placement constraint |
| 2026-06-29 | Two-phase generation (Forest domain) | Phase B space-fill places doorless UEternalEnvironmentTile (Filler/Edge) as server-authored plugin Graph rooms around the content footprint; open vs closed zones are data (FFillPolicy + tile pools), one pipeline |
| 2026-06-29 | Environment-tile config knobs | FillerTiles/EdgeTiles/FillPolicy + GetEnvironmentTiles() on UDomainDungeonConfig; FillRadius+BorderThickness span tight corridor → open field-with-road |
| 2026-06-29 | GetRoomDataForActor | Canonical room-resolution helper on UEternalRoomData (actor → owning ARoomLevel → room data) |
| 2026-03 | Encounter gate actor | AEncounterGateActor blocks room exits until encounter clears, designer-wired to ARoomEncounterActor (SingleEncounter mode today; see Encounter Gates) |
| 2026-03 | Custom shader directory | /ProjectEternal/ virtual shader path registered in FProjectEternalModule for custom material functions |
| 2026-03 | Dungeon completion actors | ARoomEncounterActor tracks encounter, AEndPortalActor handles exit interaction |
| 2026-03 | GetRoomIDForLevel | Resolve RoomID from streaming level instance for encounter/portal room binding |
| 2026-02 | Area modifier system | ModifierPool on config, DungeonModifierComponent applies GAS effects to players |
| 2026-02 | SetAreaContext expanded | Now accepts AreaModifiers, registers pool with ModifierSubsystem |
| 2025-01-17 | Initial documentation | Document dungeon system architecture |