Big Containers UPS+


Adds a selection tool that reduces inventory sizes of storage buildings for UPS savings. Mod created by request!

Utilities
23 days ago
1.1 - 2.0
946
Storage

g Why would this work?

22 days ago

You claim that this mod has an impact on UPS.
My question is: why would reducing storage space in entities have any non-neglectible impact?

LuaInventory should be basically an array, so access should be O(1).
The only impact I can think of are inventories where the looked for item-stack is faaar down in the list, which would make it O(n), which is still neglectible and a worst case scenario, since (at least in my games) inventories are usually full and only contain one item type and therefore only the first item stack is considered as its the correct one.

Any reasoning why this should have a non-neglectible impact on UPS?

22 days ago
(updated 22 days ago)

Hey, thanks for taking a look at the mod!

You won't notice it until you both A) get pretty far into a megabase and B) are using warehouse-style containers in many of your standard designs, such as train stops. This forum post discusses the issue.

In short the UPS impact has more to do with putting items into containers than taking them out. The inserter has to check each slot in a container for where it can put the items in, which for a full container (most scenarios) means every slot is checked for every insertion.

This kind of UPS impact isn't something most people will ever be aware of, and for those it does affect I believe they will see around 2-4 more updates per second. The important part is that at that point of gameplay you are doing everything you can to get every bit of UPS back that is possible, so this is just another tool in the box for those players that is basically free UPS for existing designs.

Space Age actually gives us a convenient way to experiment with this and observe the slowdown - start a new world and go into editor mode. Put down a cargo landing pad and a few hundred or thousand storage bay extensions to pump up the capacity to stupendous levels. Then surround the bay with as many inserters as you can fit and have them start putting items into it.

22 days ago

Interesting. thanks!

New response