5

I have multiple chests which are in close proximity and all store large amounts of metal plates. I would like to distribute the load evenly between them, so that all chests always contain roughly the same amount of plates.

Preferably I would like to have some setup where when any chest has more plates than the others, those plates are moved to the chests with less plates. Alternatively I would also be satisfied with some setup which ensures that the chests are filled or emptied in order of fill-state. How can I do that?

Background: The chests are part of my train station. To optimize loading and unloading times I would like to avoid uneven distribution between chests or train cars.

I would prefer a solution which doesn't require any mods.

  • 1
    Not sure how to do it with the vanilla game, but I've used a mod that had this feature as a new type of chest – Aequitas Sep 20 '16 at 15:03
  • 1
    @Aequitas Thank you, but I would prefer a vanilla solution if possible. But you could still post the link to the mod as a comment for those who are less mod-averse than I am. – Philipp Sep 20 '16 at 15:05
  • I don't think what you want to do is possible in the vanilla game. Instead, if you have a logistics network, use active provider chests (which are immediately emptied by the robots). If not, have the chests immediately emptied onto conveyors moving towards your production and/or a larger warehouse. – BlueRaja - Danny Pflughoeft Sep 20 '16 at 20:06
2

After some experimenting I found a setup which works quite well. It is based on an idea that only those chests will be filled which have below average item count:

factorio balancer

  • New items enter the transport belt ring from the right.
  • The red wires connect each chest to the two inserters which move items into it. The rightmost chest is connected to the leftmost inserter again.
  • The green wires connect all chests to the input of the arithmetic combinators and then the outputs of the combinators to all inserters (except the first)
  • The first combinator calculates the average fill-level of the chests. It is set to iron plates / 6 = BLUE.
  • The vertical inserters are set to iron plates < BLUE (except for the first inserter which isn't connected to any network at all. This is important to avoid a deadlock when all chests are perfectly balanced). This means the inserter will work when the chest they serve has below average iron plates.
  • The second combinator calculates average minus 1. It is set to BLUE - 1 = GREEN.
  • The horizontal inserters are set to iron plates < GREEN. That means they will start taking plates from the right neighbor chest when the chest they serve is more than 1 below average. The purpose of the -1 difference is to make sure that chests prefer to take items from the ring than from the neighbor. Without that there will be an infinite loop because the last chest will feed an item back into the ring the moment the first chest picks one up.

The result is that all metal plates which enter the system will be evenly distributed along the chests. When plates are manually removed from one of the chests, the inserters will rebalance by moving items from right to left to refill that chest. The last will move plates back into the ring which will then be picked up by the first chest. After a while the chests will be balanced again.

Also, the upper part of it is free (the electric poles and combinators could easily be placed further south) so a trainstop could be placed there to fill and empty the system. A method to empty the system without blocking train access would be an additional inserter right of the rightmost chest.

The only flaw in the design is that the first chest will always have slightly above average number of items. But considering that I built the design to handle large quantities of items I consider that acceptable.

0

This can easily be done using this mod which was actually designed for the same problem that I believe you are having with train unloading being unbalanced.

The mod provides a 48 slot chest that will balance the number of items with that of it's connecting neigbours


If you wish to do it without mods then something like this may be useful to you although it does have it's limitations. It uses combinators that ensure that the inserters only work if it's target chest has fewer items than the next chest. The problem with this is that it only works linearly so depending on your problem, you may need to adjust it or find a different solution.

  • Can you go into more details about how these combinators are set up and wired? It's not really clear from the image. – Philipp Sep 21 '16 at 7:19
  • @Philipp I'm not exactly sure, I just happened to find it when I was looking for the mod. If you scroll to the bottom you can just copy the blueprint string and use that to see how it's done. Sorry I can't be more useful – Aequitas Sep 21 '16 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.