Item Allocator #
We also have a tutorial in our Udemy course within our survival framework on how to setup a basic version of a simular system from scratch.
We do have this very old video, it is about the same process. Its ont the list to update this video.
Core Principles of the Item Allocator #
Prerequisites #
Read the inventory documentation first to understand the container system and item data structure.
Overview #
The Item Allocator component is responsible for populating inventory containers with items based on loot tables or vendor lists. It handles the random generation of items, restocking of inventory over time, and complete inventory resets. This is the system used for respawning loot chests and dynamically filling containers with items.

Key Features
- Generates items based on loot tables or vendor lists
- Per-item chance and quantity configuration
- Category-based item spawning
- Automatic restocking over time
- Complete inventory reset on timer
- Integration with vendor component for trading
- Gameplay tag support for flexible item selection
The item allocator is used in two main scenarios:
- Loot Chests – Generate random loot based on quality tiers
- Vendors – Populate vendor inventory with items for sale
The component works alongside the inventory component to manage what items appear in containers and when they refresh.
Loot Chest System #
A loot chest is an inventory component combined with an item allocator component. The actor does not have a vendor component, so the item allocator uses the loot list to generate items.

Loot Chest Setup
- Actor with AC_Inventory_Advanced component
- Add AC_ItemAllocator component
- Configure which loot list to use
- Set restock and reset timers if desired
- No vendor component (differentiates from vendor chests)
Loot Quality Tiers
The system supports predefined quality tiers:
- Low Quality Loot
- Medium Quality Loot
- High Quality Loot

Each tier references a different loot list data table that defines what items can spawn and their probabilities.
Item Allocator Component #
The item allocator component manages the spawning, restocking, and resetting of items in an inventory.
Component Settings
- Has Reallocation: Enable/disable periodic restocking
- Has Reset: Enable/disable complete inventory reset
- Reallocation Time: Interval between restocks (seconds)
- Reset Time: Interval between full resets (seconds)
- Allocation List: Reference to the loot table data table to use
- Never Allocate These Items: Array of items to exclude from allocation

Initialization
When the owning actor spawns (BeginPlay):
- Check if actor has a vendor component
- If yes, use trade list from the vendor component
- If no, use loot list from the item allocator component
- Generate initial items based on the selected list
- Add items to the inventory container
List Selection Logic
The item allocator automatically determines which list to use:
- Has Vendor Component: Use trade list from vendor component
- No Vendor Component: Use loot list from item allocator component
This allows the same component to work for both loot chests and vendors with different data sources.
Loot Table Structure #
Data Table Format #
The loot table uses a data table structure where each row defines an item and its allocation rules.
Data Table Structure
Each row in DT_Loot_Lists contains:
- Item Row: Reference to item in DT_Items (row name selection)
- Loot Table Info: Allocation data struct with spawn rules

Item and Allocation Data #
Item Row
- Row name reference to an item in DT_Items
- Simple dropdown selection
- No duplication of item data
Loot Table Info Struct
The allocation data contains the rules for how this item spawns:
Chance of spawning in vendor inventory (0-1)
- Decimal value from 0.0 to 1.0
- 1.0 = always spawns (100%)
- 0.5 = 50% chance to spawn
- 0.1 = 10% chance (rare spawn)
Minimal Amount to restock – Minimum quantity to add when restocking
Maximum Amount to restock – Maximum quantity to add when restocking; works with minimum to create a range
Maximum Stock
- Upper limit for this item in the container
- Restocking will not exceed this amount
- Prevents infinite accumulation
Example Configuration
- Item Row: HealthPotion
- Chance: 0.75 (75% chance)
- Minimal Amount: 2
- Maximum Amount: 5
- Maximum Stock: 10
Result: 75% chance to spawn 2-5 potions initially, restocks 2-5 at a time up to max of 10.
Category-Based Selection #
The loot system uses the Category Enum to organize and filter items.
Category Enum – Items in DT_Items have a category property (Weapons, Consumables, Resources, etc.) defined by an enum. The loot system uses these categories for organization and filtering.
Specific Items vs Categories – The loot table specifies individual items by their row name. Categories are used within the item data itself for organizational purposes and filtering within the inventory system (like the Allowed Items setting on containers).
Item Generation Process #
When the item allocator generates items, it follows a specific process:
Generation Steps
- Get the loot list (from vendor or allocator component)
- For each entry in the loot list:
- Roll for spawn chance (0-1 value)
- If successful, determine quantity (random between min and max)
- Create item struct with proper data
- Add to a temporary list
- Add all generated items to the inventory container
Item Struct Creation
When creating items from the loot list: 1. Get item data from DT_Items using the row name 2. Set the amount based on rolled quantity 3. Initialize properties (durability, decay timer, etc.) 4. Item is ready to be added to the container
Vendor Integration #
The item allocator works differently when the owning actor has a vendor component.
Vendor Detection
On initialization, the item allocator: 1. Checks if the owner has AC_Vendor_Advanced component 2. If yes, operates in vendor mode 3. If no, operates in loot mode
Vendor Mode Differences
When in vendor mode:
- Uses trade list from vendor component instead of loot list
- Items are for sale (prices apply)
- Restocking follows vendor-specific rules
- “Not Interested” categories apply
- Buy/sell price multipliers apply
See the Vendor documentation (07-Vendor.md) for detailed information on vendor-specific features.
Shared Logic – Vendor and loot modes share item generation process, chance and quantity rolling, maximum inventory limits, restock mechanics, and reset mechanics.
The main difference is the data source (trade list vs loot list) and whether pricing applies.
Restocking and Reset Logic #
Restocking System #
Restocking allows containers to gradually refill with items over time.
Restock Configuration
- Has Reallocation: Enable/disable restocking
- Reallocation Time: Interval between restocks (seconds)
Restock Process
- Wait for reallocation time to elapse
- For each item in the loot/trade list:
- Roll for spawn chance
- If successful, determine restock quantity (min/max)
- Check that adding won’t exceed Maximum Stock for that item
- Add items to inventory
- Start next restock interval
Maximum Stock Enforcement – Example: Max = 10, current = 7, roll = 5 → only 3 added.
Reset System #
The reset system completely clears and refills the inventory after a set time.
Reset Configuration
- Has Reset: Enable/disable reset
- Reset Time: How long until reset triggers (seconds)
Reset Process
- Wait for reset time to elapse
- Clear all existing items from inventory
- Run the full initialization process (same as actor spawn)
- Generate items from loot/trade list as if container is new
- Start next reset timer
Reset vs Restock
How-To Guides #
How to Create Loot Tables #
This guide explains how to create loot tables.
Step 1: Create Loot Table Data Table #
- Right-click in Content Browser
- Create Data Table
- Choose the loot table struct as the row structure
- Name it descriptively (e.g., DT_LootTable_ForestChest)
Step 2: Add Items to Loot Table #
For each item in the loot pool:
- Add a new row
- Set Item Row: Select the item row name from DT_Items
- Configure Loot Table Info:
- Chance of spawning in vendor inventory: 0.0 to 1.0 (e.g., 0.75 for 75% chance)
- Minimal Amount to restock: Minimum quantity
- Maximum Amount to restock: Maximum quantity
- Maximum Stock: Upper limit in inventory
Step 3: Test the Loot Table #
- Create or place an actor with AC_Inventory_Advanced and AC_ItemAllocator
- Assign your loot table to the Allocation List
- Spawn the actor multiple times to verify variety
- Adjust probabilities and quantities as needed
How to Configure Restocking (Tiered Loot Setup) #
Step 1: Plan Your Tiers #
Decide on tier structure:
- Tier 1 (Common): Basic items, small value
- Tier 2 (Uncommon): Better items, medium value
- Tier 3 (Rare): Good items, high value
- Tier 4 (Epic): Excellent items, very high value
- Tier 5 (Legendary): Best items, exceptional value
Step 2: Create Loot Tables for Each Tier #
For each tier, create a separate loot table data table:
- DT_LootTable_Tier1
- DT_LootTable_Tier2
- DT_LootTable_Tier3
- etc.
Step 3: Populate Tier-Specific Items #
Tier 1 (Common): – Wooden weapons – Basic consumables – Small quantities – High spawn chances
Tier 2 (Uncommon): – Iron weapons – Better consumables – Medium quantities – Medium spawn chances
Tier 3 (Rare): – Steel weapons – Rare consumables – Larger quantities – Lower spawn chances
Step 4: Adjust Value Progression #
Ensure each tier is noticeably better:
- Item quality increases
- Quantities increase
- Rare items become more common in higher tiers
- Value approximately doubles per tier
Step 5: Create Loot Chest Variants #
Create chest blueprints for each tier:
- BP_LootChest_Common
- BP_LootChest_Uncommon
- BP_LootChest_Rare
- etc.
Each references its corresponding loot table.
Step 6: Place in World Based on Difficulty #
Place chests appropriately:
- Common: Starting areas, easy locations
- Uncommon: Mid-game areas, moderate difficulty
- Rare: Late-game areas, high difficulty
- Epic/Legendary: Secret locations, endgame content
Step 7: Test Tier Progression #
Play through the game and verify:
- Tiers feel appropriately rewarding
- Progression feels satisfying
- No tier is too weak or too strong
- Higher tiers justify the effort to reach them
How to Configure Container Restocking #
This guide explains how to set up container restocking.
Step 1: Add Item Allocator Component #
If not already present: 1. Open the container actor blueprint 2. Add AC_ItemAllocator component 3. Configure the Allocation List (loot or trade table)
Step 2: Enable Restocking #
In the AC_ItemAllocator component: 1. Enable Has Reallocation 2. Set Reallocation Time (interval in seconds)
Step 3: Configure Loot Table #
In your loot table data table, for each item: 1. Set Minimal Amount to restock 2. Set Maximum Amount to restock 3. Set Maximum Stock (upper limit in inventory)
Restocking will not add items beyond the Maximum Stock limit.
Step 4: Test Restocking #
- Empty the container partially
- Wait for reallocation time to elapse
- Verify items are added correctly
- Check that Maximum Stock is respected
