Download

How to implement diffrent inventory items suggestions

I’m looking for suggestions on how to implement different types of items in my inventory. I have a Inventory component that contains all inventory items for that character in struts. Each Strut has general parameters (Weight, NPC owner, etc…) that can be changed for different objects of the same type. So one book can belong to Alice while another belongs to Bob. Right now I’m setting the parameters of the objects when spawning them from the inventory and all is well. I think having a Strut for equip stats and another one for Enchant stats is the best way to go. My question is on the items that wont have any of those stats, will it be a performance hit if I include an uninitiated equip and enchant strut? The equip and enchant Struts will have many values which is my concern.

It’s unlikely to have any severe impact on your performance just by having a few extra unused variables on your items. Have a look at the ark dev kit. Their items have hundreds and hundreds of unused stats on a lot of their items.