Using Data Tables, Structs and Data Assets for an Inventory

I’m unsure as to what constitute lightness in a Struct, but I’d assume it’s “few and simple variables”?

The “best” structs contain plain data only with fixed size. The main goal is to align the data in memory and prevent cache misses. I’m don’t feel competent enough so I won’t even try to explain these topics. Here is some info if you want to learn about that:

I could get that data from the PickUp and store it in the Inventory upon succesful Pickup if it’s better performance wise?

I doubt you will see any difference if you don’t make it constantly (on tick) but having fewer redirections is always faster. The downside is you fill your memory with redundant data but from the topics above you can see that data locality is actually more important.

should I remove the meshes and animations from the DT?

They are probably stored as references there anyway but yes. I would make them into an object/actor and leave a soft reference in the DataTable to it. Next I’d load the soft reference only when the object is taken by the player. These could be soft references to Data Asstes even :wink:

1 Like