World Item Decay & Spoilage
Note:
The decay system is part of the broader item framework.
This section focuses on how it relates to dropped loot / world items.
Overview
World-spawned items (loot on the ground) can:- Decay over time (durability loss)
- Despawn after a configured time
- Optionally be converted to a spoiled variant (e.g., fresh meat → spoiled meat)
Configuration
OnItemDataAsset:
-
Can Decay:true/false -
Decay Rate:0.1(example)- Interpreted as durability loss per second (or per tick depending on your implementation)
WorldItemActor:
-
Despawn Time: e.g.300.0(seconds)- How long an item can exist in the world before auto-despawn
0or negative can be used to disable timed despawn if desired
How It Works (Conceptual)
- A world item is spawned (loot drop, dropped item, etc.)
-
Over time:
- Durability is reduced using the item’s decay rate
- Or a lifetime countdown runs based on
Despawn Time
-
When:
- Durability reaches
0or - The item’s lifetime expires
Then one of the following happens: - The item is destroyed
- Or replaced with a “spoiled” variant (e.g., fresh → spoiled food)
- Durability reaches
Spoiled Items (Example Pattern)
For food or other perishable items, you can implement a “spoiled” variant. Example Blueprint logic insideBP_WorldItemActor:
Important:
The exact implementation (Tick vs Timer vs central manager) is up to your project.
UMI provides the data hooks (durability, decay rate, world item actor), but you can tailor the behavior to your genre and performance needs.