Memory palace¶
The hub the player teleports to via memory orbs. Holds a permanent home slot for every rune they've discovered, plus a per-rune definition. Orbs handle the in/out fade.
AMemoryPalace¶
Level-placed actor. One per palace level.
Components:
PalaceRoot— root scene component.
Auth fields:
PalaceSlots(TArray<ARuneSlot*>) — slot inventory. Designers either drop slots in via this array, or setbAutoCreateSlotsto have the actor spawn them.NumSlots(default 50) — auto-create count.CircleRadius(default 1000),NumRings(default 3),RingSpacing(default 300),SlotHeightOffset(default 50) — auto-layout knobs.SlotClass— what to spawn (typicallyAMemoryPalaceSlot).SlotDefinitionWidgetClass— widget assigned to auto-generated slots.RuneHeightAboveSlot(default 200) — vertical offset of the rune above the slot.bAutoCreateSlots— toggle.
State:
PlayerKnowledge(UPlayerRuneKnowledge*) — handle to the save game.SlotIndexToRuneMap— quick lookup, slot index to rune data.
API:
OnPlayerEnter(Player)— refresh slots, spawn newly discovered runes.AssignNewRunesToSlots()— assign pending runes to next empty slots, persist to save.RefreshAllSlots()— wipe and respawn all assigned runes.FindNextEmptySlot()— first slot index without a rune.CreateSlots()— auto-layout in concentric rings.SpawnRune(RuneData)— spawn anARunefrom a data asset.GetPlayerKnowledge()— load or create the save game on demand.ReturnRuneToSlot(RuneData)— used when the player borrows a palace rune and then takes a different one elsewhere; the original goes home.
AMemoryOrb¶
Teleporter actor. Two flavors gated by bIsInPalace:
- World orb (
bIsInPalace = false): teleports the player to the palace. StoresPalaceSpawnTransformfor entry, capturesReturnTransformfrom the player at teleport time so the palace orb can send them back. - Palace orb (
bIsInPalace = true): teleports the player back to the world. Looks up the most recent world orb at runtime viaFindWorldOrb().
Components: OrbMesh (visible), implements IInteractableInterface.
Auth fields:
MemoryPalace— the palace this orb is paired with.FadeDuration(default 1),FadeColor(default Black) — transition.NormalMaterial/NearbyMaterial+SwapMaterialIndex— material swap when player approaches.bShouldRotate+RotationSpeed— visual flair.
Interaction flow (OnInteract → TeleportToPalace / TeleportToWorld):
- Player presses interact while overlapping.
- Orb begins fade-out via
PlayFadeTransition(Player, true). UpdateFadeticks the alpha each frame.- On fade complete,
OnFadeCompleteruns the actual teleport (set actor location/rotation), then fades back in.
The fade is camera-managed (alpha applied via ApplyFadeToCamera), not a UI overlay, so it works regardless of HUD state.
UPlayerRuneKnowledge (USaveGame)¶
The player's discovery and palace progress. Persists across sessions. This is the only actively-used save game class today.
State (all SaveGame flagged):
DiscoveredRunes(TSet<URuneDataAsset*>) — every rune the player has encountered.RuneToSlotMap— permanent palace slot assignment.bHasVisitedPalace— first-visit gate.bHasUsedWorldOrb— gates palace orb interaction (don't let the player palace-out before they've palace-in'd from the world).PendingPalaceRunes— discovered since last palace visit; not persisted (rebuilt on entry).
Static slot/index:
API:
DiscoverRune(Rune)— adds to discovered set and pending set; returns true on first discovery (caller plays the discovery VFX).IsRuneDiscovered(Rune),ShouldShowInPalace(Rune).AssignRuneToSlot(Rune, SlotIndex)/GetSlotForRune(Rune).ClearPendingRunes()— called after the palace has consumed them.GetPendingRunes()— array view.SaveKnowledge()/LoadKnowledge()(static) — disk I/O.ResetKnowledge()— for new game / debug.
AMemoryPalace::GetPlayerKnowledge calls LoadKnowledge lazily and persists with SaveKnowledge after assignment changes.
How discovery flows¶
- Player interacts with a slot containing a never-seen rune.
ARuneSlot(or the rune itself) callsDiscoverRuneon the knowledge save game.- Knowledge: adds to
DiscoveredRunes, adds toPendingPalaceRunes, persists. - Slot fires
Rune::PlayDiscoveryVFX. - Next time the player enters the palace,
OnPlayerEntertriggersAssignNewRunesToSlots, which pulls pending runes, assigns each toFindNextEmptySlot, and persists. RefreshAllSlotspopulates every assigned slot with a runtimeARune.
Source files¶
Source/Rephrased_Demo/MemoryPalace.hSource/Rephrased_Demo/MemoryOrb.hSource/Rephrased_Demo/PlayerRuneKnowledge.hSource/Rephrased_Demo/MemoryPalaceSlot.h(the per-slot subclass; documented in Rune actors and placement)
Known constraints¶
- The palace is referenced by name from the TDD as "WIP for rework." The current implementation works but the visual layout (concentric rings) is a placeholder — designers will iterate on the topology before Gate 4.
PendingPalaceRunesis rebuilt at entry by diffingDiscoveredRunesagainstRuneToSlotMap. This works as long as the diff is cheap (set count is bounded by total rune count).- No multi-save-slot support today.
SaveSlotNameis a single string. New game wipes the existing save. - No autosave timer. Save fires explicitly on knowledge mutation.
Change history¶
- 2026-05-08 — Gabriel Li — Added baseline change history section for weekly wiki maintenance.