Merging Chests

by Atria

Enables merging of multiple chests into one entity. Supports merging of arbitrary number of chests (configurable in mod settings). Version 5.0.0 introduced potentially breaking changes for old saves. If your have chests larger than 42 don't update to 5.0.0.

Content
a month ago
0.13 - 1.1
99.7K
Storage

g Maximum inventory size in 0.17?

5 years ago

Hi!

I have realized that the default setting has changed to 1000 stacks. Why? Is there a new limitation in Factorio 0.17? I am sure the default limitation was much higher in 0.16. I have now set it to 10.000 stacks. Is this a problem? Unfortunately I can't find any information to the limits.

5 years ago

Limit is there because of possible performance slowdown when inserting/picking up items from very large inventory. Unless it's already fixed in base game. The limit was there for a long time.

5 years ago

Is it a linear degradiation or a sudden jump starting from a certain amount of stacks in the box?
Whats your suggested maximum limit we can put there?

5 years ago

I flat out don't know. This issue was first encountered by one player more than a year ago. I will do some test when I have some free time. But in the meanwhile I'd suggest using lower limit because if you encounter the problem and you would like to lower the limit all items in those removed inventory slots will be deleted when you load the map again.

5 years ago

Much has changed under the hood in 0.17, so who knows if the limits still apply. For the time being I will take slow steps as suggested.

5 years ago
(updated 5 years ago)

I've just done some testing and inventory size still affects UPS. I had chest with 100 full slots being slowly inserted by 100 inserters into chest of same size. I altered chest size limit from 100 all the way to 10000.

When not powered the inserters used 0.02 ms update time. These are the update times for chest size limits.

Limit      |100 |1000|10000|15000 (actual size)
Update time|0.02|0.04| 0.1 | 0.2

Conclusion: If you really need those massive chests (inventory size > 1000), beware of performance issues. But If you don't need these large inventories, I'd suggest limiting the size as much as you can.

5 years ago

Thank you. That is very helpful.

5 years ago

Let me supplement this post with some explanations from the programming side point of view.
The chests in this game accept multiple types of items, and with different amount and/or health/ammo in each slot. Therefore, whenever items are inserted to a chest, slots are scanned from the first slot. When item type/health match, then it will try to insert to this slot. If there are remaining items in the input stack, it will scan the next slot. The process will repeat until nothing remains or up to the last slot. For the worst-case scenario, it will scan to the last slot. For vanilla steel chest, it's only 48 slots so quick enough. If you are using some warehouse with 10000 slots, that means in theory 200 times in scanning is needed! To make the situation even worse, very often multiple inserters/loaders are used on the same chest/warehouse. The scans have to go independent for each inserter/loader. If you have 10 inserters on the same chest/warehouse, it needs 100000 slot handling per update in the worst case.
Taking items from a chest is similar, except the scan starts from the last slot. If no information of empty slots is known (consuming memory to do that), then it ends up have to start scanning from the 10000th slot even though the warehouse can be quite empty.

That's why in some warehouse mod (forgot which one), the author already forewarned that his/her warehouses are NOT UPS-friendly. The statement is true for not only his/her warehouses, but also ALL chests/containers with high number of slots.

So while warehouse may seems convenient to many players, it is a poor choice for megabase builders.
And that's why I love this mod! I can use 1×N line chests for train stations and belt balancing, while avoiding UPS hit to my game!

5 years ago

Yes, and if you share view of "item buffer are bad" then you are going to use minimum inventory size you actually need which in most cases won't be over 200 to fully unload a train (depends on size of your train)

5 years ago

and what if you add a option for huge stacks?
meaning if you have a 20 sized chest instead of adding 20x slots just increase the stack size by 20x
(if that can work ofcourse)

5 years ago

I am neutral to "item buffer are bad" statement, because different players can have different needs.
For example, I do like buffering green circuits a bit, since the need can be quite abrupt. But still I don't overdo that, just a few critical types and only a few chests worth of items.
Apart from that, excessive buffering is a bad thing to me, because there is an infinite mining productivity technology in game. Less reserve intermediates or end products means less ores mined early, which means more resources being made overall.

@Tigerman913
It cannot be done as I know. Only number of slots is a property of each chest type. Stack size is a property of each item type (e.g., green circuit has 200), not chest. You cannot have different stack size, unless you clone each item type as new item types. (Plus some weird lua script to "convert" when inserted/removed from warehouse, if it is even possible.) Much much much more troublesome than it is worth the effort.

New response