Page 1 of 1

'Each on Red Circuit' and 'Each on Green Circuit'

Posted: Thu Jan 21, 2021 12:56 am
by Clockulator
TL;DR
Allow combinator and comparator to use 'Each on Red Circuit' and 'Each on Green Circuit' on the left and right sides of operand. (Where 'Each on Red Circuit' and 'Each on Green Circuit' would be new features). This would allow operations to be performed on multiple item types signalled on a circuit, between two circuits.
What ?
Add 'Each on Red Circuit' and 'Each on Green Circuit' to allow logic and mathematical expressions on several item counts signalled on one circuit. Allowing comparisons and operations between multiple values between two circuits. Only items of the same type would interact between the two sides of the operation (implementation would be like 'Each', but allow an operand to interact with items of the same type on the second circuit).

EG:
- Input Green: 50 Copper Plate, 500 Coal, 10 Wood
- Input Red: 1 Copper Plate

- Equation: "Each Green" * "Each Red"

- Output 'Each': 50 Copper Plate (can be attached to output Red, Green, or both networks).

Might look something like:
red_green.png
red_green.png (200.03 KiB) Viewed 3035 times
Why ?
It would allow the more traditional use of logic and mathematical expression on several item counts signalled on one circuit network. Allowing comparisons and operations between multiple values between two circuit networks.

To do this currently many individual comparators or combinators are needed (unless I've missed something), and knowledge at each comparator/combinator about which items types are you looking at. If you have 10s of different item types in your circuit network and want them all involved in the calculations, it’s a lot of blocks to put down and configure individually (and you might need to leave space in your layout to expand it with more item types later). Also for compute load (for mega bases) it would be more effect to be able to do this calculations in one entity.

Re: 'Each on Red Circuit' and 'Each on Green Circuit'

Posted: Thu Jan 21, 2021 1:40 am
by NotRexButCaesar
+1 this would also make multiplying by stack size easier

Re: 'Each on Red Circuit' and 'Each on Green Circuit'

Posted: Thu Jan 21, 2021 4:57 am
by ssilk
This is an extended copy of similar requests from here
viewtopic.php?p=526422#p526422

Nearly same:

viewtopic.php?f=6&t=32300 Pairwise multiply/divide EACH signal in combinators
viewtopic.php?f=6&t=26944 Expand Circuit Network's "Each"
viewtopic.php?f=6&t=24257 New Combinator to work on wires seperatly
viewtopic.php?f=6&t=92616 filter combinator

viewtopic.php?f=80&t=50283 Separated Handling of Red and Green Wires
viewtopic.php?f=6&t=49278 circuit combinators, set wire-colors for select-windows
viewtopic.php?f=6&t=31438 Wire color based signal input selector (for virtual signals)


Similar:

viewtopic.php?f=6&t=61557 New combinator symbols: Each[Green] and Each[Red]
viewtopic.php?f=6&t=75852 One Wire for control circuits, colours as channels
viewtopic.php?f=6&t=56890 Separate signals to/from red and green wires

Re: 'Each on Red Circuit' and 'Each on Green Circuit'

Posted: Thu Jan 21, 2021 6:44 pm
by Clockulator
Thanks for pointing them out. I did have a little search but my skills where weak. My post is pretty much a duplication of the request in viewtopic.php?f=6&t=49278 with slightly different use case to demonstrate it.

All of these do show there is interest in something similar. Would be great to see something added to allow the red/green to be used as the left and right sides of expressions.

Re: 'Each on Red Circuit' and 'Each on Green Circuit'

Posted: Sat Jan 23, 2021 2:28 pm
by ichVII
Clockulator wrote: Thu Jan 21, 2021 12:56 am [...]
Why ?
It would allow the more traditional use of logic and mathematical expression on several item counts signalled on one circuit network. Allowing comparisons and operations between multiple values between two circuit networks.

To do this currently many individual comparators or combinators are needed (unless I've missed something), and knowledge at each comparator/combinator about which items types are you looking at. If you have 10s of different item types in your circuit network and want them all involved in the calculations, it’s a lot of blocks to put down and configure individually (and you might need to leave space in your layout to expand it with more item types later). Also for compute load (for mega bases) it would be more effect to be able to do this calculations in one entity.
A componentwise comparison can be achieved by just multiplying the red wire with -1 in a combinator, then wiring this and the green wire to a decider combinator.

A componentwise multiplication can be achieved by using the componentwise square function that exist in the game. You only need to calculate ((R+G)^2-R^2-G^2)/2. This should be possible in about 6 combinators (i have a blueprint somewhere, if you are interested). So you have kind of missed something.

Edit: blueprint. Its just 5 arithmetic combinators.

Re: 'Each on Red Circuit' and 'Each on Green Circuit'

Posted: Tue Jan 26, 2021 11:24 am
by gGeorg
What about make a selection of signal type for both inputs. Red/Green/All. Default is All. Then you can specifiy the wire for any operation you want.
e.g. for each input off any combinator you select a signal and type of signal. flexible and it do not brake any off current circuitry becose they are all set : signal to All.

You know yo need switch All not Both, becouse moders will want add dozen other colored wires. :twisted:

Re: 'Each on Red Circuit' and 'Each on Green Circuit'

Posted: Mon Dec 16, 2024 9:52 pm
by Hares
Resolved in 2.0
12-17-2024, 00-52-38.png
12-17-2024, 00-52-38.png (48.7 KiB) Viewed 624 times

Re: 'Each on Red Circuit' and 'Each on Green Circuit'

Posted: Tue Dec 17, 2024 6:34 am
by Koub
Hares wrote: Mon Dec 16, 2024 9:52 pm Resolved in 2.0
[Koub] Thanks, moved to Implemented.