I am working on a project where I have a fairly large inventory system including generic items, potions, weapons, armors etc…
Originally, I was thinking of using DataAssets but turning them into an array structure.
You’d start with a generic DA_Item data asset that would have common values all items have and then custom values as an inherited child such as DA_Potion or DA_Weapon.
I found out quickly - inheritance does not work well for arrays with DataAssets.
While I have found a way around this using an Enum and restrictions based on what item type it is. I am starting to suspect this is at the very least going to be very visually cumbersome on a design perspective even with structures hidden / omitted if the relevant item type is not selected. It has been recommended I look into data tables. Which from what I understand are basically structs that you can import from CSV - which in itself is very handy.
I think writing this out I may go over to data tables, but I really would like some veteran advice on this situation. Thank you!
Looks like you have encountered some limitations with using DataAssets for your project.
In this case, I would recommend exploring the use of data tables, since they can provide a more efficient and flexible solution for managing data in your game.
DataTables are essentially a type of data asset that allows you to store structured data in a tabular format.
Each row in the table represents an individual data record, and each column represents a field or property of that record. You can define the structure of the table using a custom struct in Unreal, and you can import data into the table from a CSV file.
One advantage of using data tables is that they allow you to easily manage large amounts of data without having to create individual assets for each record. This can be particularly useful for managing items or other game objects that have a lot of properties and variations. Additionally, data tables provide a centralized location for managing your game data, which can make it easier to maintain and update your game over time.
That being said, there are some considerations to keep in mind when using data tables. For example, you will need to ensure that your data is properly formatted and structured in the CSV file in order to be imported correctly. You may also need to write custom code to read and write data to and from the table, depending on your specific use case.
TLDR: Data tables can be a powerful tool for managing game data, and I would recommend exploring this option further to see if it is a good fit for your project.
While I am by no means a “veteran” in the game dev world I have been coding professionally and designing web applications for around 20 years now.
Anyone stumbling upon this; I would highly recommend checking out the use of SQL. I am not 100% sure on when/why/what makes it worth it… but I know I will need this eventually so my high scores for a time trial game are going in. It really probably makes sense for any Relational Data to go in SQL.
For me it’s about;
Scale
Sorting
Complex query operations made simple
(optionally) decoupling from the client
I am personally following this series, which looks well made and complete.
I’m starting to go down the path of Data Tables. Trying to find some help regarding this.
Can I automatically (but setting up some things first) populate an object with all my data into the variables of an object?
I’m creating an inventory.
I’ve got 60 items that have a number of variables to them.
3 catergories, 20 in each.
Then most of the items there are 2 objects of the same in each, some are just 1. Have a location to spawn at and a number value.
I have all this detail in a spreadsheet, that I have exported into a CSV and have imported into UE.
Thing I’m trying to do is stream line all this csv info into being automatically populated into 60 object’s with a texture. Can this be done or do I manually have to input all the specific info into each variable?