How UMI Handles Items Internally
Every item in UMI exists as an Item Instance (FItemInstance) which contains:
- Item ID
- Reference to its
UItemDataAsset - Stack quantity
- Quality / durability / custom fields
- Crafter name (optional)
- Any additional metadata
Overview of Item Flow
1. Adding Items
You can add items to an inventory in several ways:- By Data Asset (e.g., adding “5 Health Potions”)
- By Item Instance (customized items with durability, crafter name, etc.)
- With Overflow Handling (e.g., generate world drops when inventory is full)
- Finds valid slots
- Merges stacks when possible
- Respects slot/container restrictions
- Respects weight / encumbrance limits
- Returns overflow if items do not fit
2. Removing Items
Items can be removed:- By Item ID
- By Data Asset
- By slot index
- By taking an item instance directly
3. Using Items
The inventory can execute an item’s use behavior, such as:- Consuming food / potions
- Triggering abilities
- Reducing stack count
- Destroying or replacing the instance
4. Weight & Encumbrance
UMI supports weight-based carry limits. When enabled:- Items contribute to total weight
- Adding items may fail if too heavy
- Designers may impose movement penalties
5. Container & Slot Restrictions
UMI allows fine-grained control over what items can be placed in:- Entire inventories (containers)
- Individual slots (e.g., weapon-only slots)
- Gameplay tags
- Whitelists / blacklists
- Custom Blueprint logic
6. Sorting & Compacting
Inventories can be automatically or manually sorted by:- Name
- Rarity
- Quantity
- Category
- Value
- Custom sorting logic
7. Transferring Items Between Inventories
Items can be transferred:- Between player inventories
- Between containers
- Into equipment slots
- From hotbar → inventory or vice-versa
8. Splitting Stacks
Stacks can be split either:- Automatically (half split)
- With custom logic in Blueprint or UI
- During drag-drop operations
9. Dropping Items into the World
Items can be spawned as physical world objects using:- Drop by slot
- Drop by instance
- Drop at target location
- Overflow drop during AddItem operations
When to Use Each Function
| Action | When to Use It |
|---|---|
| AddItem | Standard item grants, pickups, crafting outputs |
| AddItemInstance | Items with durability, quality, custom metadata |
| TryAddItem | Adding items when space/weight restrictions may block placement |
| RemoveItem / TakeItem | Consuming items, moving items to UI widgets or equipment |
| UseItem | Potions, food, consumables, abilities |
| TransferItem | Looting containers, trading, stash systems |
| SplitStack | Drag/drop UIs, inventory management |
| DropItem / SpawnWorldItem | Throwing items, world pickups, death drop behaviors |
System Responsibilities Summary
UMI handles:- Slot searching and stack merging
- Quantity validation
- Weight and capacity checks
- Restriction enforcement
- Overflow handling
- Instance creation and replication
- UI event broadcasting