Best way to make an in-game item database?

Hi, I’m making a game with lots of items & abilities and such and am wondering the best way to store/access all that info in game.

In an older game I made, I had 1 scriptable object that contained a bunch of arrays and dictionaries of all the items in the game. This worked perfectly, HOWEVER loading this at the start of the game froze unity for about 10 seconds since it was also loading all of the scriptable objects inside it, and all of the images/sounds/etc associated with those.

So I’m wondering what may be the better approach to maintain ease of use in editor/code but allow the game to stream in the assets from Resources only when it needs them instead of all at once at the start.

Thanks!

Best in terms of … what exactly? Time to edit? Storage space? Usability? Editor performance? Runtime performance? There are always tradeoffs. Also, “lots of” is pretty vague too. Some may think 100 and others one million.

Similarly, your previous use-case may have been hampered by inefficient scripting, not because of the way the assets were stored.

There are plenty of ways to store a long list of gamedata items. Could be a spreadsheet (csv) or sql database (sqlite etc) or one of the many tools in the store, with or without a GUI. Is your data flat, or relational? How important is getting your data exported to an exchangable format like CSV? Does it need to be stored in the cloud? Do you work with a team?

I could go on … basically I’m trying to say without your requirements it is impossible to recommend a tool.

Just do this but with addressables instead.

Yeah that’s basically what I’m asking. That method was super handy to get the stats/sounds/particles/texture/etc of any item at runtime just by grabbing it out of the dictionary. Only problem was that Unity would attempt to load everything at once since it was all placed within the 1 main object.

I’ve never heard of addressables –

But does that mean instead of putting all the scriptable objects into 1 giant dictionary that all gets loaded at once, I can put their addresses in there? So the dictionary will load but none of the objects will until specifically stated to do so? (which would be done easily since their location address is there?)

You can do your own research by looking up the Addressables package. No need to ask me.

But basically yes.