Too many inventories?

riquid

New member
I am looking to make a factory building game like Satisfactory or Factorio using almost entirely Opsive assets.

Would it be practical to have several hundred machines, each with their own individual inventories all loaded into memory at once? Would that be way too many inventories for an average players computer to handle? If it's not practical, are there any decent work arounds?

Thank you so much for your time and for your ongoing support for the development community.
 
That's a good question.
I've never stressed test this with that many Inventories.
The Inventories don't store that much data, but they do store strings for the ItemCollection names and arrays of ItemInfos with with references to the item and amounts.
You could potentially compute how much data this will all use.
a reference is 64bits, integers are 32 bits, arrays need a reference and, strings depend on the size of string lets say 128bits.

So lets say you have 500 machines with a single collection with 5 items each
That you be 500( 128 +64+ 5*64*32) = 5216000bits
That's less than a Megabyte, so that first looks fine.

But of course I'm not taking into account the fact that Inventories are Monobehaviours with a ton of data and have an update function. Inventories need to be on gameobjects that also take a ton of space and need to be rendered.

So if you have issues I doubt it will be the Inventories. But the only way to tell is simply trying it out and looking at the profiler.
Then you'll know the bottleneck and if it turns out its the Inventory you'll have to deal with it by fixing the exact issue.
Be careful with assumptions, always check the real data by testing it. And don't try fixing something before it proves to be a problem. That's just a waste of time from my experience.

I hope that helps
 
Top