One single datatable for all or several for each item category?

Would it be a good idea to have one large datatable that contains all items and their variables or is it better to have one for each type of item (Weapon, Armour, Consumable, Resource, etc…)

My thinking was that only needing to access 1 table might give me more flexibility. Or is it too rigid?

Hi Althaen,

On table would be the simplest way but not flexible way, because you Weapon/Armour/Consumable/ etc… won’t have the same properties… Your uniq table should have all of the fields required for all of your object type…

Unless you serialize the characteristics of each in single string your table might look like this : Id, name, type, description

Hope that could help you !

XuruDragon

It honestly depends on just how different all your items are and how you are using them.

I have a project I am working on which I started working with a separate table for weapons, armor, consumables, ect. I have since converted it all to 1 table. There would be bloat because of this, but it led to an interesting mechanic of technically having statistics for wearing a cheese wheel for a helmet or a potion as a melee weapon. I mostly condensed my table because multiple tables were becoming unwieldy. I use one master “item” blueprint ease of casting and then the child blueprints parse the data from my table only pulling in the relevant bits.

The way I currently have it the item types only take the variables it needs and sets them as variables inside its base blueprint. So resources don’t take a damage or weapontype variable for example,

That’s how I have it set up too. Thanks.

If you want one data table solution, as i did in my case, but your data table elements way to different to have all their parameters being present in data table, make it nested.

I have master struct for data table http://puu.sh/qPQ4K.png and those AbilityDataBool; AbilityDataFloat; AbilityDataCLASSTYPE; they all arrays of structs http://puu.sh/qPQdC.png with enum tag http://puu.sh/qPQjp.png for search and data type.I have search function for each data types.

Populated data table looks like this http://puu.sh/qPQvz.png with event graph data extraction which looks like this http://puu.sh/qPQpe.png.

Did you create that find value function yourself?

Yes, function library.