Two circuit operations: STACKIFY and reverse
Posted: Sun May 21, 2017 5:50 am
Summary: currently in the game it's easy to know *QUANTITY* of items, but we lack an easy way to compute *SPACE* of items (the number of stacks of blue belts in your logical system for instance). SPACE is usually important in a factory, but it's even more important in a train-centered Factorio.
Given the developers intention to make trains really attractive, I believe a way to compute space through combinators would be useful and desirable. The general powerful application would be to know how much space you need, or how much space you're already using, whether it's in chests, or trains. I can already see it making mixing trains and logistic way easier than it is right now.
This is why I propose two new circuit operations:
In a way, this is what we could define as the weight of a pile of item from a practical point of view.
Input: number of stacks of items. Output: Quantity of items corresponding those to stacks.
For instance, if the input is 4 blue splitter and 1 space science and DESTACKIFY is applied to EACH, it returns 200 blue splitters and 2k space science.
Here is the contraption for those curious, I'm sure it can be simplified (I'm a circuit beginner) but I'd be surprised it could be simplified to a "portable" extent:
Under I is the input, under O is the output. The W part of the circuit is just a small thing that compares the input weight with a wagon's weight, to see if the input is too big to fit in a wagon.
edit: this contraption looks unwieldy and ugly, but programming STACKIFY would not be a performance issue (would not be surprised if the devs already got the function in the game actually)
Given the developers intention to make trains really attractive, I believe a way to compute space through combinators would be useful and desirable. The general powerful application would be to know how much space you need, or how much space you're already using, whether it's in chests, or trains. I can already see it making mixing trains and logistic way easier than it is right now.
This is why I propose two new circuit operations:
STACKIFY (WEIGHT): Count the stacks of a signal of items.
For instance, if the input is 134 yellow belt and 7 boiler, and STACKIFY is applied to EACH, it would return 2 yellow belt and 1 boiler, the number of stacks respectively those items would take up in a chest.In a way, this is what we could define as the weight of a pile of item from a practical point of view.
DESTACKIFY: Convert stacks in number of items
The reverse of STACKIFY (not quite, but almost).Input: number of stacks of items. Output: Quantity of items corresponding those to stacks.
For instance, if the input is 4 blue splitter and 1 space science and DESTACKIFY is applied to EACH, it returns 200 blue splitters and 2k space science.
Bonus: STACKIFY in a contraption
I know that my suggestion is possible to make with actual signals, I actually made STACKIFY myself but it takes a lot of space. Especially because you have to split items per stack size, and read stack sizes from combinators, a step that can't be compressed it seems. From it, I could easily made ANTI-WEIGHT/ANTI-STACKIFY.Here is the contraption for those curious, I'm sure it can be simplified (I'm a circuit beginner) but I'd be surprised it could be simplified to a "portable" extent:
Under I is the input, under O is the output. The W part of the circuit is just a small thing that compares the input weight with a wagon's weight, to see if the input is too big to fit in a wagon.
SuperStack
edit: this contraption looks unwieldy and ugly, but programming STACKIFY would not be a performance issue (would not be surprised if the devs already got the function in the game actually)