I am working on an item system that includes things like weapons, equipment, consumables, etc. I am currently using a pickup class system in which each item has an item version and a pickup version. The pickup version has very little data on it but spawns the heavier item class version when interacted with. I like this system since it means I make one hard reference to the item class (which is pretty light) and then can theoretically add as many items as I want to the game without increasing the number of hard referenced assets to my player character.
I have read that some consider a data table as a better way to do large scale projects, however, this seems somewhat counterintuitive to me as, even if I were to use soft references for a lot of assets, wouldn’t I still need to have a very large amount of data (which would increase proportionally the amount of total items in my game) loaded at any given time? Obviously, a data table is very convenient for item stats since you can manage all of them in one place, but scalability wise (in terms of maximizing total content without limiting performance) would I be wrong to think that a data table creates a lot of hard reference related limitations?
Why would data tables generate more data than an actor-class-per-object-type? You still need all the same data – inventory icon, in-world mesh, trigger script, etc.
I would go with a data table or data assets, and then have a generic “in world pick-up” actor class, and a generic “in inventory” object, which can reference the data instance (struct or data asset) There can be an optional, soft-referenced actor class for what to do if the user tries to “activate” or “wield” or “wear” the thing in question.
Even that could be shared – every “pistol” is the same actor class, and only the data items (mesh, rate, sound effects, ammo, …) would change as configuration data.
Basically, too many specialized actor classes will become quite unwieldy when they get into the thousands. It’s still a little bit grayscale, because if you use blueprints to configure many “pistol” instances, technically each of those are still a new actor class, so you’re going to have to figure out exactly how far you want and need to take it.