# Best practices for inventories and items using Data Assets and Objects or Structs

**URL:** <https://forums.unrealengine.com/t/best-practices-for-inventories-and-items-using-data-assets-and-objects-or-structs/2293775>\
**Category:** C++\
**Tags:** data, inventory, unreal-engine, Blueprint, CPP, question\
**Created:** [January 20, 2025, 6:01pm UTC](https://forums.unrealengine.com/t/best-practices-for-inventories-and-items-using-data-assets-and-objects-or-structs/2293775 "2025-01-20T18:01:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tengo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tengo/32/1019615_2.png) [@Tengo](https://forums.unrealengine.com/u/Tengo)\
**Post date:** [January 20, 2025, 6:01pm UTC](https://forums.unrealengine.com/t/best-practices-for-inventories-and-items-using-data-assets-and-objects-or-structs/2293775/1 "2025-01-20T18:01:45Z")

</div>

**Hey everyone! Hope all is well.**

I wanted to reach out to see if anyone is familiar with what I’m considering for my project. Recently, I’ve been planning to create an inventory system, and through most of my research, I found that the best solution for me would be to use Data Assets along with either Structs or UObjects.

For my game, I’m planning to have several item types and classes, including, but not limited to, base items, consumables, weapons, equipment, etc.

**My question is:** When it comes to saving data that changes during runtime such as ammo, attachments, durability, or quantity what do you think is the better approach: UObjects or Structs?

I’ve considered using Structs, but I’m concerned that having all the information (such as weapon details) in a Struct might be wasteful since I will have different types of items with unique data for themselves, especially since a consumable wouldn’t need this data, and a weapon class wouldn’t need the consumable details.

So, am I missing something here? Is it possible to use inheritance with UStructs? For example, could I create a base struct like `FItemBase`, and then derive other structs from it, such as `FWeaponBase`, which I could use in my inventory component’s array of item variables?

Alternatively, should I just use UObjects to store and manage this data?

Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![DragonRelt](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dragonrelt/32/1075747_2.png) [@DragonRelt](https://forums.unrealengine.com/u/DragonRelt)\
**Post date:** [January 20, 2025, 10:25pm UTC](https://forums.unrealengine.com/t/best-practices-for-inventories-and-items-using-data-assets-and-objects-or-structs/2293775/2 "2025-01-20T22:25:08Z")

</div>

Since Structs are used to keep the same data and it doesnt change other then yes no for boolean and numbers change +1 -1, you can save the data pretty easy if you run with structs. if you need objects to save that are bps then i would recommend using guid’s the work pretty good.  
In short I would recommend structs only because they tend to be easy to grab when you need em

---

<div class="post-metadata">

**Author:** ![Tengo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tengo/32/1019615_2.png) [@Tengo](https://forums.unrealengine.com/u/Tengo)\
**Post date:** [January 28, 2025, 7:20am UTC](https://forums.unrealengine.com/t/best-practices-for-inventories-and-items-using-data-assets-and-objects-or-structs/2293775/3 "2025-01-28T07:20:53Z")

</div>

> [@DragonRelt](#):
>
> guid’s

I see, thanks for your reply! I was also thinking about using Structs, but do you think its possible to use it with several types of items? Weapons might need to store data for things like ammo, attachments etc. While other items will not need such data, so it seems inefficient to have one struct that has all the properties for all items. But like I had said in the original post, from what i’ve read It seems inheritance might not be possible, but Im not sure is that something you’re familiar with maybe structs do support inheritance?

---

<div class="post-metadata">

**Author:** ![xenofsnstudios](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xenofsnstudios/32/1194578_2.png) [@xenofsnstudios](https://forums.unrealengine.com/u/xenofsnstudios)\
**Post date:** [January 28, 2025, 7:42am UTC](https://forums.unrealengine.com/t/best-practices-for-inventories-and-items-using-data-assets-and-objects-or-structs/2293775/4 "2025-01-28T07:42:12Z")

</div>

Yes, structs support inheritance, as long as they are defined as USTRUCTs. You can also use nested structs.

However, if you are creating a complex inventory system and are worried about redundant data, then I would look into using a database like SQLite.

Data tables work for simple inventories, but don’t very well with many-to-many relationships.

---

<div class="post-metadata">

**Author:** ![Tengo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tengo/32/1019615_2.png) [@Tengo](https://forums.unrealengine.com/u/Tengo)\
**Post date:** [January 30, 2025, 3:02am UTC](https://forums.unrealengine.com/t/best-practices-for-inventories-and-items-using-data-assets-and-objects-or-structs/2293775/5 "2025-01-30T03:02:27Z")

</div>

> [@xenofsnstudios](#):
>
> nested structs

Thanks! I’ll look into the nested structs and the inherited structs, I thought the same for the inventory system, I wasn’t really planning to use data tables but the primary data asset type to have the static data, then save the list of structs in someway. Probably using SQL. Thanks again :).

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [March 1, 2025, 3:02am UTC](https://forums.unrealengine.com/t/best-practices-for-inventories-and-items-using-data-assets-and-objects-or-structs/2293775/6 "2025-03-01T03:02:42Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
