Differences in Data Assets, Data Tables and Structures (Overall Hierarchies in systems)

My Inventory stores flat data (Item quantities) for bagged type items (Ammo, meds, grenades etc).
For slotted items I use a named actor object reference.

Every slot that uses an Actor obj ref is a spawned and attached actor. If not empty it’s a visible actor attached to the characters. Either in hand or on the body or other gear based attached actor.

All the “Data” items are broke down to integer quantities. This struct contains all backpack stored items. There’s no need for the primary data inventory to be heavy.

Each base type of item (Meds, Ammo, Grenades etc) use a singular function to add and remove quantities.

For UI aspects the inventory system has a series of functions that get and pack a struct with the needed data. It’s essentially a copy of the simple data struct, but adds elements for icons and other data. The inventory system manages the data, but only the UI uses it.

e.g.
Then 0: Meds →

  • Medkits (2), (icon, X, Y, Z data)
  • FirstAid (1), (icon, X, Y, Z data)
  • Bandages (5), (icon, X, Y, Z data)
  • Caffeine (1), (icon, X, Y, Z data)
  • Adrenaline (2), (icon, X, Y, Z data)

At the moment 100% of my item data is Data Table based. It’s faster and easier to work with in regards to adding and refactoring. If I add a new item I do not need to create an asset. If I want to modify specs of any given actor or type of item I do not need to open and edit 15 gazillion actors.

Data tables can be runtime edited. This makes it possible to make changes on a live branch without having to repackage the game… essentially pushing a patch.

Downsides to DT’s is the seek time to read data. DT’s work very similar to databases like MySQL/Oracle etc. The larger they are (rows and columns) the slower they get.

Breaking down your data into multiple DT’s will make lookups faster, but at the cost of human management.

For example I have 5 different med items. Very small DT footprint. Weapons on the other hand sits around 120. If/when performance takes a hit here. I can break that table down into sub groups.
AR, SR, DMR, LMG, SMG, Pistol, Shotgun, Misc… 8 data tables to manage vs 1 vs 120 data assets.

As is there are also DT’s for WeaponBallistics, WeaponRecoil, WeaponDmg, WeaponFX etc.