Factorio

Factorio

View Stats:
Blech Nov 5, 2023 @ 2:45am
Circuit network: How do i do batch arithmetic combination?
I have been playing around with automation via the circuit network, and I often run into needing to use arithmetic combinatiors to do batch operations like "Take all signals on the red wire and perform an operation (like add or multiply) with the corresponding signal on the green wire". But I think I am a bit too thick to figure out how to do it. I end up making a whole long line arithmetic combinators that each handle one signal and then recombine on the other side. It is very annoying and makes the designs poorly extendable.

Is there a technique or maybe a modded part that can do this?
< >
Showing 1-7 of 7 comments
Fel Nov 5, 2023 @ 2:50am 
They are added together (those on the same signal) before being processed by the combinator.
Combinators can't do anything with a specific wire.
Kind of depends on what you are trying to do but you can use the decider combinator functions of each, anything, and everything to pas through either a true (1) or false (0) signal or to pass the input signal through as the output. You can also modify the signals by using a constant combinator set with specific values (negative numbers are possible) for each item/signal.
Blech Nov 5, 2023 @ 11:31am 
Am I maybe just one of a few people who use the circuit system for major logistics tasks? I find myself having to do the "Subtracts all the signals on the red wire by their corresponding signals on the green wire" (or multiply, or divide) quite often. And the only way I can see of going it is to make a line of arith combinators and take each signal on their own combinator. Its really annoying that I can't seem to find a batch option.
Fel Nov 5, 2023 @ 12:14pm 
Put the green wire into an arythmetic combinator doing "anything * -1 output anything" then connect your red wire to the output.
It will "add" the negative value to the value already on the wire.
This is something relatively widely used, for things like sushi belts for example (belts that can have a wide variety of items on it and that loops around on itself).

I don't see where you would need to multiply or divide "anything (red wire)" and "anything (green wire)".

In case you didn't know, "anything" individually processes each signal (again, it doesn't do "per wire" but "per signal") and releases the result (usually on "anything" again, meaning the same signal).

For conditions, you also have "any" and "all" depending on if you want the condition to work if at least one fits or if all of them (signals that are not at 0) need to fit.
Originally posted by Blech:
Am I maybe just one of a few people who use the circuit system for major logistics tasks? I find myself having to do the "Subtracts all the signals on the red wire by their corresponding signals on the green wire" (or multiply, or divide) quite often. And the only way I can see of going it is to make a line of arith combinators and take each signal on their own combinator. Its really annoying that I can't seem to find a batch option.
If you are doing that frequently you are likely making something complicated that is actually simple to do another way.

Specific examples of what you are trying to accomplish would help us help you.
Nilfsen Nov 5, 2023 @ 3:44pm 
While you can do "batch" calculation on all imputs in arithmetic combinator, you cannot do that between same signals regardless of input colour.
You can do same operation on all incoming signals, regardless if by constant or by signal.
All combinators sum up same sifnal comming from red and green wire before doing operations on them. So incoming red A6 and green A3 loose their colour before calculation and become A9. So setting A*A will give 81, not 18.

Colours exist only as colour of wire carring signal not signal it self.
This way colours are way to not mix signals comming from two different sources in case they are send to more than one place.

Only way to do calculation on same signal comming from red and green wire is to change one of colours in to other signal, but that makes imposible to do "batch" calculation.

Taking example above only way to get result A18 of incomming red A6 and green A3 uis to change one of them in to other signal. If you will use other combinator to change A3 in to B3 then you can set B*A and set result as A to get A18.
That means you need to have 2 combinators for each pair of signals to do same operation on them.

Only sum and division can be done in "batch" as described by You. Thats done "automaticaly" when both signals meet in one combinator/building (for division you need to multipy one colour by -1).
malogoss Nov 5, 2023 @ 5:56pm 
Originally posted by Blech:
Am I maybe just one of a few people who use the circuit system for major logistics tasks?

No.
< >
Showing 1-7 of 7 comments
Per page: 1530 50

Date Posted: Nov 5, 2023 @ 2:45am
Posts: 7