Efficient way of stroring game data internally

I am building a mobile game, which will have about 100 game items a player can obtain as she progresses through the game. Also, there will be a number of different enemies. Besides its gameplay parameters like HP, a game item will have a couple of images (small, big) and a monster will have an image and a 3d model.

I am in the process of finding the best way to store those data internally so that I could spawn necessary items and monsters dynamically and, at the same time, it won’t be an overhead for the memory.

One option is to have a game object with an array of prefabs, which is always in the scene so that I can request to spawn an object at any time. I don’t really understand if the prefabs in this array will consume the same amount of memory as the spawned game object, or it will be just a reference to a prefab in the project hierarchy. Or maybe use Scriptable Objects instead of Prefabs, but the question about memory consumption remains the same.

Another option was to have everything in the Resources folder so that I could go and do Resources.Load(), but this would impact the overall build size. To reduce the build size I would consider loading my data (sprites and models) from an external resource, but never worked with that before, so need an advice here.

How do you tackle these kinds of things in your projects?

We use Unity’s AssetBundles for this: Unity - Manual: AssetBundles
If you decide to use AssetBundles, I highly recommend installing the AssetBundle Browser (made by Unity) from the package manager: Unity - Manual: Unity Asset Bundle Browser tool
That tool makes it easy to design and build your bundles. Then, you can dynamically load and unload bundles as you need them. We use 2 bundles for each scene; one contains the scene itself and the other contains the things that scene will dynamically load. You could use more detailed bundles if you want. I’ve heard the Escape from Tarkov uses a bundle for each item.

1 Like