Skip to content

Step 4: Loot System Guide

Can TATAR edited this page Jun 11, 2026 · 3 revisions

URF Loot System Guide

Overview

URF provides a flexible loot and XP reward system with:

  • Direct XP rewards
  • XP pickup rewards
  • Hybrid rewards
  • Guaranteed pickup drops
  • Random loot tables
  • Pickup pooling support

For production enemies, use URFEnemyLogicComponent together with URFHealthComponent.

AURFTestEnemy is still supported for quick prototyping and backward compatibility, but production enemies should use their own ACharacter or APawn with URF components.


Required Production Enemy Setup

Create your own enemy Blueprint from ACharacter or APawn.

Recommended setup:

BP_ProductionEnemy +-- CapsuleComponent or custom collision +-- SkeletalMesh or StaticMesh +-- URFHealthComponent +-- URFEnemyLogicComponent

For enemies spawned outside URFGameDirector, enable URFEnemyLogicComponent -> Auto Register With Director if you want the director to track alive enemy count and unregister them on death.

Optional:

+-- URFSeparationComponent

Health And Death Setup

In URFHealthComponent:

Max Health -> 50
Destroy On Death -> true
Destroy Delay -> 0.1

Recommended production setup:

URFHealthComponent -> Destroy On Death -> true
URFEnemyLogicComponent -> Handle Actor Destruction -> false

This keeps actor destruction in the health component, while URFEnemyLogicComponent handles XP, loot, and Game Director unregistering. URFEnemyLogicComponent listens to the owner's URFHealthComponent death event. When the enemy dies, it processes rewards once, unregisters from the director, and then leaves destruction to the selected destruction owner.


Enemy Reward Settings

In URFEnemyLogicComponent:

XP Reward -> 10
Reward Method -> Direct On Kill
Guaranteed Pickup Class -> None
Enable Random Loot -> false

Reward Method

Reward Method controls how XP is awarded.

Available modes:

  • Direct On Kill - XP is added directly to the killer's URFExperienceComponent
  • Pickup Only - XP is spawned as a pickup
  • Hybrid - Part of the XP is awarded directly, the rest is spawned as a pickup

Reward Examples

Direct XP Enemy

Use this for enemies that immediately give XP when killed.

XP Reward -> 10
Reward Method -> Direct On Kill
Guaranteed Pickup Class -> None
Enable Random Loot -> false

Result:

Player receives 10 XP immediately.
No XP pickup is spawned.

XP Pickup Enemy

Use this for enemies that drop XP pickups.

XP Reward -> 20
Reward Method -> Pickup Only
Guaranteed Pickup Class -> BP_XPPickup
Enable Random Loot -> false

Result:

Enemy drops one XP pickup worth 20 XP.
Player must collect it.

Hybrid XP Enemy

Use this for enemies that give some XP directly and drop the rest.

XP Reward -> 100
Reward Method -> Hybrid
Hybrid Direct XP Percentage -> 0.3
Guaranteed Pickup Class -> BP_XPPickup
Enable Random Loot -> false

Result:

Player receives 30 XP directly.
Enemy drops one XP pickup worth 70 XP.

Enemy With Random Loot

Use this for enemies that give XP and also roll bonus loot.

XP Reward -> 10
Reward Method -> Direct On Kill
Enable Random Loot -> true
Random Loot Tables
+-- DA_CommonEnemyLoot

Result:

Player receives 10 XP directly.
Enemy also rolls DA_CommonEnemyLoot.

Boss Loot Setup

Example boss setup:

XP Reward -> 500
Reward Method -> Pickup Only
Guaranteed Pickup Class -> BP_XPPickup_Large
Enable Random Loot -> true
Random Loot Tables
+-- DA_BossLoot
+-- DA_RareLoot
+-- DA_PowerupLoot

Result:

Boss drops one large XP pickup.
Boss rolls multiple loot tables.

Loot Drop Data Asset

URFLootDropDataAsset defines random loot drops.

Each loot entry contains:

  • PickupClass - What pickup actor to spawn
  • DropChance - Chance to drop, from 0.0 to 1.0
  • MinXPAmount - Minimum value passed to the pickup
  • MaxXPAmount - Maximum value passed to the pickup
  • Use Random XP Amount - If true, randomizes between min and max

Creating A Loot Table

  1. Right-click in Content Browser
  2. Create a loot drop data asset
  3. Name it, for example DA_CommonEnemyLoot
  4. Add loot entries
  5. Assign it to URFEnemyLogicComponent -> Random Loot Tables

Drop Modes

Allow Multiple Drops: false

Only one item can drop per roll, or nothing drops.

Example:

Gold Coin -> 0.6
Health Potion -> 0.3

Result:

60% chance for Gold Coin
30% chance for Health Potion
10% chance for nothing

Allow Multiple Drops: true

Each entry rolls independently.

Example:

Gold Coin -> 0.6
Health Potion -> 0.3
Rare Chest -> 0.05

Result:

Gold can drop independently.
Health can drop independently.
Rare Chest can drop independently.
Multiple items can drop at once.

Example Loot Tables

Common Enemy Loot

Name -> DA_CommonEnemyLoot
Allow Multiple Drops -> false

Entries:
Gold Coin
Drop Chance -> 0.6
Pickup Class -> BP_GoldPickup
Min Value -> 5
Max Value -> 10

Health Potion
Drop Chance -> 0.3
Pickup Class -> BP_HealthPickup
Min Value -> 15
Max Value -> 25

Result:

60% gold
30% health
10% nothing

Boss Loot

Name -> DA_BossLoot
Allow Multiple Drops -> true

Entries:
Large Gold
Drop Chance -> 1.0
Pickup Class -> BP_GoldPickup_Large

Rare Item
Drop Chance -> 1.0
Pickup Class -> BP_RareItem

Bonus Chest
Drop Chance -> 0.5
Pickup Class -> BP_Chest

Result:

Large Gold always drops.
Rare Item always drops.
Bonus Chest has a 50% chance to drop.

Blueprint Events

URFEnemyLogicComponent exposes:

OnRewardsProcessed(AActor* Killer, int32 XPAwarded, bool bPickupSpawned)

Use this event for:

  • Death effects
  • Reward sounds
  • Floating text
  • Analytics
  • Custom Blueprint reactions after rewards are processed

Example:

OnRewardsProcessed
-> Spawn reward VFX
-> Play reward sound

Manual Reward Processing

You can manually process rewards with:

HandleXPReward(AActor* Killer)

This processes XP and loot rewards only.

It does not:

  • Destroy the actor
  • Mark the enemy as dying
  • Unregister from Game Director

This is useful for custom death flows where you want full Blueprint control.


Best Practices

Direct XP

Use Direct On Kill for fast arcade-style XP.

Reward Method -> Direct On Kill

XP Pickups

Use Pickup Only when you want XP to appear in the world.

Reward Method -> Pickup Only
Guaranteed Pickup Class -> BP_XPPickup

Hybrid Rewards

Use Hybrid for bosses or special enemies.

Reward Method -> Hybrid
Hybrid Direct XP Percentage -> 0.3
Guaranteed Pickup Class -> BP_XPPickup

Random Loot

Use random loot tables for gold, health pickups, chests, powerups, and rare drops.

Enable Random Loot -> true
Random Loot Tables -> DA_CommonEnemyLoot

Multiple Loot Tables

Separate loot categories into different tables:

DA_CommonLoot
DA_RareLoot
DA_BossLoot
DA_PowerupLoot

This makes balancing easier.


Troubleshooting

Enemy Drops Loot But Does Not Disappear

Contact Damage Does Not Fire

Contact damage uses overlap events.

Check:

  1. URFEnemyLogicComponent -> Enable Contact Damage is true
  2. Contact Damage Component Name matches the exact primitive component name
  3. The contact damage component has Generate Overlap Events enabled
  4. The contact damage component uses Pawn -> Overlap
  5. The player collision also allows overlap with the enemy contact component

If the enemy blocks the player capsule instead of overlapping it, contact damage will not fire.

Check destruction settings.

Recommended:

URFHealthComponent -> Destroy On Death -> true
URFEnemyLogicComponent -> Handle Actor Destruction -> false

Alternative:

URFEnemyLogicComponent -> Handle Actor Destruction -> true

Use one destruction owner, not both.


No XP Is Awarded

Check:

  1. Enemy has URFEnemyLogicComponent
  2. Enemy has URFHealthComponent
  3. Player has URFExperienceComponent
  4. XP Reward is greater than 0
  5. Reward Method is configured correctly
  6. The enemy actually reaches zero health
  7. For Direct On Kill or Hybrid, the killer/player actor has URFExperienceComponent

XP Pickup Does Not Spawn

Check:

  1. Reward Method is Pickup Only or Hybrid
  2. Guaranteed Pickup Class is set
  3. Pickup class is valid
  4. Enemy has a valid world location
  5. Pickup collision is not blocking spawn

Random Loot Does Not Spawn

Check:

  1. Enable Random Loot is true
  2. Random Loot Tables contains at least one valid loot table
  3. Loot table has valid entries
  4. Entry PickupClass is valid
  5. Drop chances are high enough for testing

For testing, temporarily set:

Drop Chance -> 1.0

OnRewardsProcessed Does Not Fire

Check:

  1. Rewards were not already processed
  2. Enemy has URFEnemyLogicComponent
  3. Enemy death is routed through URFHealthComponent
  4. HandleXPReward or health death event is actually called

Summary

For production enemies:

Enemy Blueprint
+-- URFHealthComponent
+-- URFEnemyLogicComponent

Use URFEnemyLogicComponent for:

  • XP reward setup
  • XP pickup spawning
  • Random loot tables
  • Game Director registration
  • Reward events

Use URFHealthComponent for:

  • Health
  • Death detection
  • Optional actor destruction
  • Optional contact damage

Clone this wiki locally