Do I need different structs for different types of items?

I am making an inventory system that will display the items’ characteristics (the items can be melee, ranged, armor, food, misc., etc.). Obviously each type will have its own types of variables. Do I need to make one struct for each type of weapon? And one data table too for each type? As for the UI, how would I use different datatables and structs in the same UI?

Hey there @carmanfer! Much of this depends on what level of variation your weapons can have in your game. In my experience, in games that tend to have only superficial differences (ie damage types) I tend to keep a generalized weapon object. However this can often be broken down into weapon types in cases the weapons have massive differences in how they are used/applied (ie Difference between weapon/tool).

1 Like