Skip to content

Loot System

Summary: Data-driven loot generation using weighted random selection from ULootTableDataAsset. Items are filtered by context (level, tags), generated with appropriate properties, and spawned as interactable AItemActor pickups. All generation is server-authoritative.

Table of Contents


Architecture Overview

ULootTableDataAsset (Design-Time)
│
├── FLootTableEntry[] (Item Drops)
│   ├── UItemManifestDataAsset
│   ├── DropWeight (probability distribution)
│   ├── DropChance (0.0 - 1.0)
│   └── Context Filters (tags, level range)
│
├── FCurrencyDropEntry[] (Currency)
│   ├── StackRange
│   └── DropWeight, DropChance
│
└── ParentTables[] (Inheritance)

ULootComponent (Runtime - on enemies/containers)
│
├── LootTable reference
├── SourceContextTags
├── QuantityMultiplier
└── BalanceConfig (area level + threat tier)
    │
    ▼
ULootGenerator::GenerateLoot(LootTable, Context, Seed)
    │
    ├── Filter valid entries (level, tags)
    ├── Weighted random selection
    ├── Item level (UBalanceSubsystem drop roll, seeded)
    └── FLootGenerationResult
        │
        ▼
UItemSpawner::SpawnNewItemAtLocation()
    │
    └── AItemActor (World Pickup)
        ├── UItemComponent
        └── UItemDropWidget

Key Design Principles

Principle Implementation
Data-Driven Loot tables as DataAssets, no hardcoded drops
Weighted Random Drop weights create probability distribution
Context Filtering Tags and level ranges filter valid entries
Server-Authoritative All generation on server only
World Pickups Items spawn as interactable actors

Core Concepts

Why Data-Driven?

Hardcoded loot: - Requires recompilation for balance changes - No designer autonomy - Difficult A/B testing

Data-driven loot: - Designers edit DataAssets directly - Hot-reloadable in editor - Easy to create themed loot tables (boss, treasure, trash)

Two-Phase Drop Chance

Each item has two chances to fail:

Roll 1: Base Drop Chance (LootTable.BaseDropChance)
    │
    ├─ [Fail] → No item this roll
    │
    └─ [Pass] → Select weighted entry
           │
           ▼
Roll 2: Entry Drop Chance (Entry.DropChance)
    │
    ├─ [Fail] → No item this roll
    │
    └─ [Pass] → Generate item

This allows: - Base chance: "Does anything drop?" - Entry chance: "If something drops, does THIS specific item drop?"

Guaranteed vs Random Items

Type Use Case
LootTable drops Random selection from pool
GuaranteedItemManifest Always drops (quest items, boss loot)

Which sources fire is gated per component by ELootDropMode (LootTableOnly, GuaranteedOnly, Both) — a container can be a pure treasure chest, a pure quest-item holder, or both at once.

A guaranteed equipment item is levelled like a table drop: its item level rolls from the source's area level and threat tier (ULootGenerator::LevelDrop), not from the level it was authored with. A source that was never given a level (LevelOverride 0) is the exception: it keeps the authored level, for a hand-placed reward with a fixed level.

A reward can also be handed to a source while the game runs. ULootComponent::AddGuaranteedItem adds an item that drops on top of whatever the drop mode yields, leaving the authored item and mode alone. An enemy spawner uses it: AEnemySpawner::GuaranteedDrop is dropped by the first enemy the spawner ever makes (see Spawning System).

An added item is one shared pickup unless it is added as one per player (AddGuaranteedItem(Item, true), set on a spawner with bGuaranteedDropPerPlayer). Then every player in the session when the source drops gets a copy only they see and may pick up, made exclusive with AItemActor::SetExclusiveTo like a private table entry. The copies share one item level, rolled once. A player who joins after the drop gets none, and with no player in the world one shared copy drops instead. Alone, the one copy is the player's own. The forest start's cultist drops the Totem Shear this way.

The shared table. Every encounter and container currently uses one table, /Game/DataAssets/Items/Loot/LootTable. A source makes one item roll (BaseDropChance 0.28) and, apart from it, one roll for each kind of fragment.

Entry Rolled as Chance per source
Vital Flask item roll, DropWeight 30 10.8%
Tempered Amulet, Emerald Ring item roll, DropWeight 20 each 7.2% each
Shard of Hemorrhage item roll, DropWeight 8 2.9%
Karka Fragments, Bone Fragments, Beast Fragments own roll each (CurrencyEntries, DropChance 0.1, one unit) 10% each, 27% for at least one

A source drops 0.58 items on average and nothing 52% of the time. The quest rock is an always-drop entry and takes no share.

The fragments have their own rolls so that their rate can be set without taking drops from gear. While they were weighted entries of the item roll (20 each, then 60 each for a day), raising them to 70% of drops halved the gear, flask and Shard rates. The item roll's chance went from 0.5 to 0.28 when they left it, which keeps gear, flask and Shard at the rates they had at weight 20.

Naming caveat: the Currency* names (FCurrencyDropEntry, CurrencyEntries, GeneratedCurrency) are legacy struct naming. The currency concept was removed from the item taxonomy — crafting materials are Cores and Fragments (GameItems.Types.Core / GameItems.Types.Fragment); these entries drop stackable material items, not money.


Loot Tables

ULootTableDataAsset Structure

LootTable: DA_Enemy_Skeleton
├── TableID: "skeleton_common"
├── BaseDropCountRange: (1, 3)
├── BaseDropChance: 0.8
│
├── ItemEntries:
│   ├── [0] Bone Shard    (Weight: 100, Chance: 1.0)
│   ├── [1] Rusty Sword   (Weight: 20,  Chance: 0.8)
│   └── [2] Gold Ring     (Weight: 5,   Chance: 0.5)
│
├── CurrencyEntries:
│   └── [0] Gold (Weight: 100, StackRange: 5-25)
│
└── ParentTables:
    └── DA_Common_Drops

FLootTableEntry Properties

Property Purpose
ItemManifest The item to drop
DropWeight Relative probability (higher = more common)
DropChance Additional roll after selection
bAlwaysDrops Drops once from every eligible source, outside the rolls (see below)
bPrivateToEachPlayer On an always-drop entry: one copy per player who needs it, seen by that player alone (see below)
RequiredContextTags Must have these tags to appear
ForbiddenContextTags Cannot appear with these tags
MinSourceLevel Minimum source level
MaxSourceLevel Maximum source level (0 = no limit)
RequiredPlayerQuestTags Eligible only while some connected player holds one of these quest tags (quest items start dropping after a beat)
ForbiddenPlayerQuestTags Skipped when any connected player holds one of these (quest items stop dropping once found / turned in)

Quest-tag filters are deliberately any-player, not killer-attributed: loot is a shared world event and enemy death drops carry no instigator. They need FLootSourceContext::WorldContextObject (set by ULootComponent::BuildLootContext) to reach UPlayerQuestComponent::AnyPlayerHasQuestTag; without a world context the entry fails closed.

Always-drop entries. An entry with bAlwaysDrops is for an item the player must find to move a quest on. Every source it is eligible for drops it once, before the table's rolls: BaseDropChance, DropWeight and DropChance are ignored, and the entry is left out of the weighted pick, so it takes no share from ordinary loot. Its filters still apply, and they are the only thing that stops it. Give it a RequiredPlayerQuestTags tag for the beat that starts the hunt and a ForbiddenPlayerQuestTags tag that the pickup grants. The loot table validator fails an always-drop entry with no forbidden quest tag. The quest rock in the shared table is the first use.

An always-drop entry chooses who it is for with bPrivateToEachPlayer:

Shared (off) Private (on)
Copies One, seen by everyone One per player who still needs it, seen by that player alone
Quest tags asked of Any connected player That player alone (ULootTableDataAsset::QuestTagsAllow)
Who gets the pickup's quest tag Whoever reaches it first Each player, from their own copy
Two sources die before the pickup Both drop a copy The second is skipped while the player's copy still lies in the world

A private copy is an ordinary pickup made exclusive with AItemActor::SetExclusiveTo, the same mechanism the fallen bearer's Remnant uses (see Remnant System). ULootGenerator::GenerateLoot returns private drops in FLootGenerationResult::PrivateItems, each with its player; ULootComponent spawns them. Only an always-drop entry can be private: a weighted roll is one shared event, and the validator fails the flag anywhere else.

Table Inheritance

Parent tables allow shared drop pools:

DA_Common_Drops (Parent)
├── Health Potion
└── Mana Potion

DA_Enemy_Skeleton
├── ParentTables: [DA_Common_Drops]
├── Bone Shard
└── Rusty Sword

Result: Skeleton can drop Health/Mana Potions + Bone/Sword

FLootSourceContext

Context passed to generation:

Property Purpose
SourceLevel Level of drop source (enemy/chest); gates entries by MinSourceLevel/MaxSourceLevel only
QuantityModifier Multiplier for drop count
ContextTags Tags for filtering (e.g., "boss", "elite")
bGuaranteedDrop Declared, but GenerateLoot does not read it yet: it has no effect
InstigatingPlayer Player who triggered drop
WorldContextObject World access: its game instance's UBalanceSubsystem for the item level, and the player-quest-tag filters
BalanceConfig FEnemyBalanceConfig: the area level and threat tier the item level rolls from

Generation Algorithm

Selection Process

GenerateLoot(LootTable, Context)
    │
    ├─ 1. Collect all valid entries
    │   └─ Include parent table entries
    │
    ├─ 2. Filter by context
    │   ├─ Level within MinSourceLevel..MaxSourceLevel
    │   ├─ RequiredContextTags present
    │   └─ ForbiddenContextTags absent
    │
    ├─ 3. Calculate drop count
    │   ├─ BaseCount = RNG(BaseDropCountRange.X, BaseDropCountRange.Y)
    │   └─ FinalCount = BaseCount * Context.QuantityModifier
    │
    ├─ 4. For each drop roll:
    │   ├─ Check base drop chance (skip if guaranteed)
    │   ├─ Select weighted random entry
    │   ├─ Check entry drop chance
    │   ├─ Calculate item level
    │   └─ Add to result
    │
    └─ 5. Generate currency drops separately

Weighted Selection

Entries with weights: [Bone: 100, Sword: 20, Ring: 5]
Total weight: 125

Roll random 0-124:
├── 0-99   → Bone    (80% chance)
├── 100-119 → Sword  (16% chance)
└── 120-124 → Ring   (4% chance)

Item Level Calculation

Every equipment drop rolls its item level from the balance data: the area level plus the source threat tier's offset range (GDD §2.4.2).

BalanceConfig: AreaLevel 10, ThreatTier Normal
Normal tier (Config/Balance/ThreatTiers.json): itemLevelBonus 0, variance -1..+2

ItemLevel = AreaLevel + ItemLevelBonus + RNG(ItemLevelVarianceMin, ItemLevelVarianceMax)
ItemLevel = Max(1, ItemLevel)  ← Clamp to minimum 1

Possible levels: 9, 10, 11, 12
  • The roll is UBalanceSubsystem::CalculateItemDropLevelSeeded, drawing the variance from GenerateLoot's stream, so the same seed repeats every item level. CalculateItemDropLevel is the same roll on the global RNG.
  • The subsystem is the one on Context.WorldContextObject's game instance. Without a world (the editor Loot Simulator has none) the item level is the area level, with no variance.
  • SourceLevel takes no part in the roll; it only filters entries. A drop source sets BalanceConfig.AreaLevel for its drops to follow depth.
  • Entries carry no item level offset of their own: the threat tier's range is the only one, so every drop of a tier at an area level falls in one range that can be worked out from the balance data alone.

World Pickups

AItemActor Purpose

  • Represents item in world
  • Displays item name widget
  • Handles player interaction
  • Replicates to all clients

Spawn Flow

FItemManifest::SpawnPickupActor(World, Location, Rotation)
    │
    ├─ Spawn AItemActor from PickupActorClass
    │
    ├─ Get UItemComponent from actor
    │
    ├─ InitItemManifest(Manifest) on component
    │
    └─ SetInteractText(ItemName)  (replicated; OnRep wires the nameplate, late joiners included)

UItemSpawner Batching

Multiple items spawn with spacing to prevent overlap:

SpawnLootInWorld(LootResult)
    │
    ├─ Create UItemSpawner
    │
    ├─ For each item:
    │   ├─ FindValidSpawnLocation(BaseLocation, Radius, ExistingLocations, Spacing)
    │   ├─ Add to ExistingLocations
    │   └─ SpawnPickupActor at valid location
    │
    └─ Destroy spawner

Pickup Interaction

World items carry a PickupSphere (AItemActor::PickupRadius, 250 uu). Overlapping local players register the item with their ULootFocusComponent (on the AEternalPlayer PlayerController), which owns the client-side notion of focus. It re-evaluates on a 0.1 s poll (nothing else re-triggers as the pawn walks a pile); the right-stick browse cone is CycleConeHalfAngle = 60°, and the pure pickers PickNearestWithHysteresis / PickInScreenDirection are static so specs can drive them. Focus is pad-gated by IsLocalGamepadPlayer().

Device Focus rule Pickup verb
Mouse hovered nameplate (no hover = no focus; plates look as before) click the nameplate or just beside it (see below), or Interact
Gamepad nearest item in range, 40 uu hysteresis; right-stick flick (no lock) browses in that direction, sticky until the item goes or the pawn walks 150 uu Interact (d-pad up); plate prefixes the key while focused

The focused item's tooltip docks bottom-right (ULootTooltipDockWidget, hosted by UHUDController).

Nameplates and stacking

AItemActor::ItemWidgetComponent is a UItemNameplateComponent (screen-space UWidgetComponent, bDrawAtDesiredSize, pivot (0.5, 1) so the plate stands on the item's ground point). The pad glyph + gold border show on gamepad only; mouse hover keeps the authored button tint. Name text joins CommonUI text scaling.

Piles would overprint, so ULootLabelLayoutSubsystem (client-local UTickableWorldSubsystem; never created on a dedicated server, Game/PIE worlds only) projects every registered nameplate each frame and ResolveOverlaps() pushes overlapping plates upward only — the plate lowest on screen keeps its spot, the ones behind climb, so a pile reads as a column. Purely screen-space: items and widgets never move. Nameplates self-register in OnRegister/OnUnregister and apply the resolved pixel offset via ModifyProjectedLocalPosition.

CVar Default Purpose
Eternal.Loot.LabelGap 2 Vertical gap (viewport units) between stacked plates
Eternal.Loot.ClickSlop 16 How far outside a plate a primary press still picks the item up

A plate is one line of text tall, so a primary press that just misses one would swing at the item. On mouse, the combat input handler asks the layout for the plate nearest the cursor (FindNameplateNear, last frame's resolved rects, pure picker PickLabelAt). If one lies within ClickSlop, the press picks it up through the plate's own click (UItemDropWidget::PickUp) instead of attacking, and its release is swallowed. Stacked plates never overlap, so the nearer edge decides between them. Plates hidden behind a modal take no press, and none does while a gameplay panel is open.

Player in PickupRadius / hovering plate
    │
    ├─ ULootFocusComponent picks focus → nameplate glyph (pad) + corner tooltip
    │
    ▼
Click plate / Interact key (loot focus wins over NPC interactables;
    │                          `TryInteract` is a no-op while any gameplay panel is open — client courtesy behind the input gate)
    │
    ├─ Server_TryAddItem(ItemComponent)
    │
    ├─ [Server] reject if pawn outside PickupRadius + slack
    │
    ├─ [Server] Manifest item → add to inventory
    │
    ├─ [Success?] ItemComponent->PickedUp() → destroy actor → next nearest item focuses
    │
    └─ [Fail?] Item remains in world

LootComponent Integration

Purpose

ULootComponent attaches to actors that drop loot: - Enemies (drop on death) - Chests (drop on open) - Destructibles (drop on break)

Configuration

Property Purpose
DropMode ELootDropMode: which sources fire (table / guaranteed / both)
LootTable Primary drop table
LevelOverride Source level for entry filtering (0 = level 1)
BalanceConfig Area level + threat tier the item level rolls from
SourceContextTags Additional context tags
QuantityMultiplier Scale drop count
bGuaranteedDrop Meant to skip the base chance; not read yet, so it has no effect
GuaranteedItemManifest Always drops this specific item

Drop Source Levels

Each source sets both levels before it drops, from the area level the dungeon was entered at (UDungeonSubsystem::GetCurrentAreaLevel):

Source Set in LevelOverride BalanceConfig
Enemy AEternalEnemy::InitializeWithLevel (with or without an encounter) area level area level + the enemy's threat tier
Container (ALootContainer) ALootContainer::Open area level area level + Normal

A container counts as a Normal-tier source, so a chest's drops fall in the same range as the room's ordinary enemies'.

Enemy Death Integration

AEternalEnemy::Multicast_HandleDeath()
    │
    ├─ [HasAuthority()?]
    │   └─ LootComponent->DropLoot(InstigatingController)
    │
    └─ SetLifeSpan(5.f)  ← Corpse cleanup

DropLoot Flow

DropLoot(InstigatingController)
    │
    ├─ Build FLootSourceContext
    │   ├─ SourceLevel = GetSourceLevel()
    │   ├─ BalanceConfig = BalanceConfig
    │   ├─ ContextTags = SourceContextTags
    │   ├─ WorldContextObject = owner
    │   └─ InstigatingPlayer = InstigatingController
    │
    ├─ [LootTable?]
    │   ├─ GenerateLoot(LootTable, Context)
    │   └─ SpawnLootInWorld(Result)
    │
    └─ [GuaranteedItemManifest?]
        └─ SpawnGuaranteedItem()

Public Contracts

ULootTableDataAsset

Property Purpose
TableID Unique identifier
TableName Display name
BaseDropCountRange Min/max drops per roll
BaseDropChance Probability of any drop
ItemEntries Item drop definitions
CurrencyEntries Currency drop definitions
ParentTables Inherited loot tables
Method Purpose
GetAllEntries() All entries including parents
GetValidEntries(Context) Filtered by context
GetTotalWeight(Entries) Sum of weights

ULootGenerator

Method Parameters Returns
GenerateLoot (LootTable, Context, Seed) FLootGenerationResult; a non-zero Seed repeats every pick and item level
LevelDrop (Manifest, Context, Seed) Sets an equipment item's level the way a table drop gets it; for an item dropped outside a table

FLootGenerationResult

Property Purpose
GeneratedItems Array of generated FItemManifest
GeneratedCurrency Array of currency FItemManifest
TotalRolls Number of drop attempts
bSuccess Generation completed

ULootComponent

Property Purpose
LootTable Drop table reference
LevelOverride Source level for entry filtering
BalanceConfig Item level inputs (area level, threat tier)
SourceContextTags Context tag container
QuantityMultiplier Drop count multiplier
bGuaranteedDrop Not read yet (no effect)
GuaranteedItemManifest Always-drop item
Method Purpose
DropLoot(Controller) Trigger loot generation and spawn. Server only: a call without authority does nothing
AddGuaranteedItem(Item, bOnePerPlayer) Add an item dropped on top of the drop mode's own yield; with bOnePerPlayer, one exclusive copy for each player present

UItemSpawner

Method Purpose
SpawnNewItem(Manifest, Count, Controller) Spawn near player
SpawnNewItemAtLocation(Manifest, Count, Location) Spawn at position
SpawnExistingItem(Manifest, Count, Controller) Spawn dropped item

AItemActor

Property Purpose
ItemComponent Holds item manifest
ItemWidgetComponent UItemNameplateComponent — screen-space nameplate, self-registers for stacking
PickupSphere / PickupRadius USphereComponent, 250 uu; registers overlapping local players' loot focus; server re-checks on pickup
InteractText Display name (replicated)
Method Purpose
GetItemComponent() Access item data
SetLootFocused(bool) Client-side focus cue on the nameplate
SetInteractText(Text) Server-only; InteractText is ReplicatedUsing, OnRep wires the nameplate on every client (late joiners included)

Source Reference

Core Classes

File Location Purpose
LootTableDataAsset.h Loot/LootTableDataAsset.h Drop table definition
LootGenerator.h Loot/LootGenerator.h Generation algorithm
LootComponent.h Loot/Components/LootComponent.h Actor attachment
LootContainer.h Loot/Actors/LootContainer.h Chest / container actor (drops on Open)
BalanceSubsystem.h Balance/BalanceSubsystem.h Item level drop roll (CalculateItemDropLevelSeeded)
ItemSpawner.h Inventory/Items/ItemSpawner.h World spawning
ItemActor.h Inventory/Items/ItemActor.h World pickup actor
ItemComponent.h Inventory/Items/ItemComponent.h Item data on actor
ItemNameplateComponent.h Inventory/Items/Components/ItemNameplateComponent.h Screen-space nameplate widget component
LootFocusComponent.h Loot/Components/LootFocusComponent.h Client-side pickup focus (PlayerController)
LootLabelLayoutSubsystem.h Loot/Subsystems/LootLabelLayoutSubsystem.h Nameplate de-overlap (client-only world subsystem)

Key Functions

Function File Purpose
GenerateLoot() LootGenerator.cpp Main generation
SelectWeightedEntry() LootGenerator.cpp Weighted selection
DetermineItemLevel() LootGenerator.cpp Item level from the context's balance data, on the generation stream
Open() LootContainer.cpp Sets the container's source level + balance config, then drops
GetValidEntries() LootTableDataAsset.cpp Context filtering
DropLoot() LootComponent.cpp Trigger drops
SpawnLootInWorld() LootComponent.cpp Batch spawning
SpawnPickupActor() ItemManifest.cpp Single item spawn


Recent Changes

Date Change Impact
2026-11-16 A guaranteed item added at runtime can be one per player (bGuaranteedDropPerPlayer on the spawner); the three fragments leave the item roll for a roll of their own (0.1 each), and the item roll goes from 0.5 to 0.28 Each player in a co-op session gets their own Totem Shear from the forest start's cultist; crafting fragments are 70% of drops, up from 43%
2026-11-14 Guaranteed items take the source's level; AddGuaranteedItem; DropLoot checks authority; shared table at 0.5 A chest's or enemy's guaranteed item no longer drops at its authored level; a spawner can hand its first enemy a reward; drops are rarer
2026-11-06 Click slop around nameplates A primary press within Eternal.Loot.ClickSlop of a plate picks it up instead of attacking (mouse only)
2026-10-18 Item level from the drop source, seeded Containers set BalanceConfig (area level, Normal tier), so chests no longer drop at area level 1 at any depth; DetermineItemLevel rolls on the generation stream (CalculateItemDropLevelSeeded) and reads the balance data from Context.WorldContextObject; the dead FLootTableEntry::ItemLevelOffsetRange is removed (Loot Manager spinners + validator check with it)
2026-08-20 Nameplate stacking + quest-tag loot gating documented UItemNameplateComponent + ULootLabelLayoutSubsystem (Eternal.Loot.LabelGap); Required/ForbiddenPlayerQuestTags any-player filter; AItemActor pickup sphere / focus API
2026-08 FItemManifest.bNotifyOnPickup Notable items drive a persistent unseen-item badge on the inventory button
2026-07 Era registry reward pools UEraRegistryDataAsset maps Era tag → Remnant reward pool; HoldGround events resolve drops through it
2026-07 Currency taxonomy removed Material drops are Cores/Fragments; Currency* struct names are legacy
2026-03 ELootDropMode Per-container gating of table vs guaranteed drops
- Initial weighted loot system Data-driven drop tables
- Context filtering Level and tag-based entry filtering
- Currency drops Separate currency generation
- Table inheritance Shared drop pools via ParentTables
- Guaranteed items Always-drop items alongside random