The ability to specify between red and green wire would be the perfect opportunity to add new features for "array" pointwise operations. By array I mean wire.
As a simple example, filtering on signals (both whitelist and blacklist) can be achieved with 6 combinators and 2 ticks of delay (see technicalfactorio).
This single combinator would do the job. Devs did not specify how the everything / anything / each signals would work with the new combinators, but I suppose that the depicted single combinator will do the job for a whitelist filtering. For a blacklist, use "=" instead of "≠", but this one is more tricky, because each = 0 might select no signal, depending on how devs implement it.
Arithmetic pointwise operations is a big one. For instance, pointwise multiplication can be currently achieved with 5 combinators, 2 ticks delays and with potential overflow (see technicalfactorio).
If implementing the possibility to have the signal each several time as input in the right way (alongside having the possibility to select between red and green wires for arithmetic combinators), it would be possible to do this in one single arithmetic combinator. Not only would this simplify pointwise multiplication, but it would also give us access to all other operators (division, modulo...), which are almost impossible to get currently.
There would also be a use-case for several each as input of decider combinators: pointwise maximum of red and green signals (and similarly minimum) could be achieved with two decider combinators in parallel and 1 tick of computation only (with pseudocode but hopefully that makes sense):
Code: Select all
(RED, GREEN) -> RED.each ≥ GREEN.each then RED.each -> OUTPUT
(RED, GREEN) -> RED.each < GREEN.each then GREEN.each -> OUTPUT
Since I am talking about using several special signals as input, one feature that I felt was missing in Factorio was to have both anything and everything as input when selecting a signal (output is anything). For instance, the following would choose one of the signals of max value: Anyway, it seems that the selection feature ( anything as output) would be somewhat rendered obsolete by the new selector combinator. For sake of simplicity, the selection feature could be removed from the decider combinator, although this means that what could be achieved in one single decider combinator in 1 tick might now require a decider AND a selector combinator, and 2 ticks of computation. Simplicity and modularity vs backward compatibility and speed
I'm jumping on the opportunity to present some of my contraptions. This is a system of combinators that allows to translate number of items to number of stacks and vice versa. I intended to use it for my Space Exploration run, for smart interplanetary transfer (what a coincidence). The core idea is to do a pointwise operation (usually multiplication or division) between a wire A that is supposed constant, and wire B that changes (but not too fast). You might see how this
from left to right:
- wire A content (a bunch of constant combinators that contain each item in the game and their stack size). I used a lua command and python script to generate that.
- an iterator over wire A signals, grouped by value (i.e., stack size). the signal "S" takes the value of each distinct values. It's quite big but you need only one for the whole map, and I tried to minimize the iteration time (3 ticks per distinct value, plus 3 ticks to reset). In vanilla, it would do a cycle roughly every half second, but modded content can introduce custom stack sizes so it would take longer.
- item to stack converter (pointwise B/A). Here, B is the content of the chest. I also made versions of this that perform rounded up division and so on.
- stack to item converter (pointwise B*A). Here, B is the output of the previous contraption.