Factorio

Factorio

View Stats:
Long Term Storage Chest Logic
I have several long term storage chest areas surrounded by roboports around my base and all of them have plenty of space. However, when I deconstruct something, a swarm of bots will fly to the opposite side of the base to deposit the goods in the long term storage when there is storage right next to them. I know they prioritize depositing in chests with the same goods they are carrying, but there were none of the same goods in the far away chests. This is insanely annoying. Please help
< >
Showing 1-7 of 7 comments
I found they tend to put things in older boxes. I guess there might be a index of storage boxes and they choose the first built ones rather than distance.
Last edited by oyssoyss; Jan 3 @ 8:16am
The best solution to this IMO is not to have huge bot networks. Use small local ones for a specific purpose.
Chindraba Jan 3 @ 10:15am 
It's all about priorities, as the bots see them, not as we'd wish them to be.

The only time distance matters in picking a chest is when something is being picked up. If something is available in two or more chests with the same priority, then, and only then, the bots will pick the closest one.

When dropping something off where there isn't any place it 'belongs' already, the bots will pick the on with the lowest internal ID number. Those IDs are assigned as things are built so the lowest ID is also the oldest chest. In theory, if there are chests with equal priority they are picked in a round-robin fashion. It's nearly impossible to make that happen, however.

The decon stuff will be placed in chests according to this priority:
  1. A storage chest which has a filter to match the item
  2. A storage chest which has some of the same thing in it
  3. An empty storage chest without a filter
  4. Any storage chest without a filter which has room

In your case the level 3 priority is met first - empty chest with no filter. The lowest ID is the oldest one built. As soon as that chest is targeted to get the thing the bot carries it is promoted to level 2 priority - matching inventory. The round-robin effect won't trigger because the level 3 priority won't happen again, for that item. If you do get that chest filled up and have more to put away, then the next oldest one will be used. So, given enough time and enough stuff, the round-robin can happen.
i lost Jan 3 @ 11:56am 
Originally posted by Chindraba:
It's all about priorities, as the bots see them, not as we'd wish them to be.

The only time distance matters in picking a chest is when something is being picked up. If something is available in two or more chests with the same priority, then, and only then, the bots will pick the closest one.

When dropping something off where there isn't any place it 'belongs' already, the bots will pick the on with the lowest internal ID number. Those IDs are assigned as things are built so the lowest ID is also the oldest chest. In theory, if there are chests with equal priority they are picked in a round-robin fashion. It's nearly impossible to make that happen, however.

The decon stuff will be placed in chests according to this priority:
  1. A storage chest which has a filter to match the item
  2. A storage chest which has some of the same thing in it
  3. An empty storage chest without a filter
  4. Any storage chest without a filter which has room

In your case the level 3 priority is met first - empty chest with no filter. The lowest ID is the oldest one built. As soon as that chest is targeted to get the thing the bot carries it is promoted to level 2 priority - matching inventory. The round-robin effect won't trigger because the level 3 priority won't happen again, for that item. If you do get that chest filled up and have more to put away, then the next oldest one will be used. So, given enough time and enough stuff, the round-robin can happen.
Thanks for explaining. Although this seems like a bit of an oversight on the devs part, it feels like distance should probably be considered more at least in priority 3 as you described it when there is no filtered chests and no chests with similar items
Last edited by i lost; Jan 3 @ 11:57am
Because of the puzzle nature of the game some of those things the devs leave the player to figure out. To continue in your situation, if it is long term storage the chances it will be accessed soon are fairly low. If the bots have no other high priority tasks what difference does it make where the chest is? Another way you can solve your problem is to build your long term storage dump all in one central location.

The other solution to your issue is to use all the tools available to you. You can set filters on the storage chests so the bots will deliver stored materials to locations they are most likely to be used first. You can also force the bots to do that by placing buffer chests (they have a different priority level) that will request the items from your long term storage to specific locations that the item is more likely to be used and the buffer chest will then act as long term (but not as long term) storage for that item.

The devs gave you the pieces. You can put it together any way you choose to make it work the way you want.
Originally posted by i lost:
Thanks for explaining. Although this seems like a bit of an oversight on the devs part, it feels like distance should probably be considered more at least in priority 3 as you described it when there is no filtered chests and no chests with similar items

Not an oversight, actually, rather it is part of a larger design.
In version 0.7.0 they adjusted behaviors to avoid fragmenting the storage and reduce the mixing of things in a chest. It helps the player to know where the stuff will be and helps the bot routines "find" what's needed faster (code optimization in this case). Filters weren't even added to storage chests until 0.16.8. Now, in 2.0.7, they've adjusted the one remaining annoyance by having the bots pick a chest with a matching filter over matching inventory. That wasn't the case in 1.1 and did get obnoxious when a chest filtered to belts was ignored because there was an older chest with one stray belt in it.

That last piece does give you a bit of a tool as well. Your 'long term storage' can be built with chests without filters. If you deconstruct an area and want to keep things close - to do the rebuild with - you can place a storage chest with a filter, and that one will be filled before the ones which only happen to match the inventory item.
Z0MBE Jan 3 @ 4:25pm 
Using the enable chests is a very overpowered circuit implementation - I wonder if you could solve the issue with that kind of system in place on logistic storage using circuit logic
< >
Showing 1-7 of 7 comments
Per page: 1530 50

Date Posted: Jan 3 @ 7:20am
Posts: 7