Hares wrote: Tue Dec 24, 2024 7:52 pm
Tried to reduce this to one combinator but didn't succeed.
I think i heard of this one called "edge detector", if i'm not mistaken, you can achieve this with a single arithmetic combinator set up to do EACH * -1 output EACH
The wiring is the trick, if you have a constant combinator representing the input value, it need to be connected to the input and the output of the arithmetic with different colors of wire, and at the output, if the signal change, during 1 tick there will be "something" , and the next tick the arithmetic combinator will again nullify everything.
Hares wrote: Tue Dec 24, 2024 7:52 pm
Tried to reduce this to one combinator but didn't succeed.
I think i heard of this one called "edge detector", if i'm not mistaken, you can achieve this with a single arithmetic combinator set up to do EACH * -1 output EACH
The wiring is the trick, if you have a constant combinator representing the input value, it need to be connected to the input and the output of the arithmetic with different colors of wire, and at the output, if the signal change, during 1 tick there will be "something" , and the next tick the arithmetic combinator will again nullify everything.
Okay, something like this:
12-24-2024, 23-41-05.png (664.32 KiB) Viewed 841 times
Even though it is now reduced to 1 comb, it has very limited use case, and work well only for deterministic logical signals.
I'd prefer to stay at 2-comb design.
Hares wrote: Tue Dec 24, 2024 7:52 pm
Tried to reduce this to one combinator but didn't succeed.
I think i heard of this one called "edge detector", if i'm not mistaken, you can achieve this with a single arithmetic combinator set up to do EACH * -1 output EACH
The wiring is the trick, if you have a constant combinator representing the input value, it need to be connected to the input and the output of the arithmetic with different colors of wire, and at the output, if the signal change, during 1 tick there will be "something" , and the next tick the arithmetic combinator will again nullify everything.
Okay, something like this:
12-24-2024, 23-41-05.png
Even though it is now reduced to 1 comb, it has very limited use case, and work well only for deterministic logical signals.
I'd prefer to stay at 2-comb design.
It is still basically a 2 device setup, just arranged in a manner to allow embedding of the second differencing stage (+ve/-ve/any detect) in the second device.
Re: Combinator cookbook 2.0
Posted: Tue Dec 24, 2024 9:41 pm
by mmmPI
Hares wrote: Tue Dec 24, 2024 8:43 pm
Okay, something like this:
Yes ! I'm using this often
Hares wrote: Tue Dec 24, 2024 8:43 pm
Even though it is now reduced to 1 comb, it has very limited use case, and work well only for deterministic logical signals.
I'd prefer to stay at 2-comb design.
Well it can be used as a building block for many more advanced contraption. It is meant to detect when signal changes, and let thru the magnitude of the change be it a positive or a negative, so it can be used to trigger one time action with "if something" => then do "thing" . But it can also be used to "count" things. If you have such deviced attached to say a chest, and you pick up manually 100 things, in one single click, such edge detector will detect "-100" variation. But if you take 10 and then 10 and then 10 as an inserter does, it will detect also - 10 and -10 and - 10.
Re: Combinator cookbook 2.0
Posted: Wed Dec 25, 2024 8:52 pm
by coffee-factorio
I wanted to point out the advantages and current state of the new display panel for signage.
What you guys are doing with rs latches and timers is beautiful. I made some examples that show how that can be used in practice if you ship some combinators onto a space platform. The second latch shows how to stack on conditions - so I'm suggesting this is a "stacking latch" as a name on that basis. RS/ect. can refer to the old multi-combinator model.
The circuits shown demonstrate ammo and fuel-oxidizer safety switches for a space platform. If it can get to a port but can't raise either value after they fall under a tolerance range, it will not be able to raise a flag. This forces a platform to stay in a dock till these values are brought into a "safe flight" range. The fuel tolerance is probably looser than it ought to be.
I think that clocks are a bit more interesting now and wanted to make an example piece as to why.
This shows a clock that has been decorated with a reset condition and that passes along an enabling condition. The lamp shows that the passed signal is lost for one tick on T = 0. It also shows how time interacts with a properly set display, and signal passing over radar; which has practical applications for synchronizing remote machines to a global time.
If you revisit the old classic memory cell timers those are actually a lot of fun to play with! You can now make them cycle. And you can make a classic one-shot count up to N timer. But you can have the one shot time area reset on a control now, so you can control how each combinator works and manipulate them independently.
To demonstrate this I used a new style latch to make a reset button. It's "interesting" because you need to involve the constant combinator in the circuit. A safer design can be made by tying that circuit to a logic combinator that reads when S=1 and forwards that. It will reset the count independently of signal R, which controls if the timer can increment at all (but otherwise doesn't do anything to memory). As for the practical use of this I'm really not sure
12-26-2024, 13-34-24.png (76.64 KiB) Viewed 729 times
P.S.
Let me know if you want to see more of this, i.e. version that prints in display components instead of constant combinators.
Re: Combinator cookbook 2.0
Posted: Thu Dec 26, 2024 5:13 pm
by dontdieych
Priority map
I don't know a better title... Consider you have a list of signals and you want to map each of these signals to an associated signal. For example you want to map an item to an associated recipe. Additionally, this setup picks the item with the highest (or lowest) value, so you're able to either consume the most available item or produce more of the least available item.
It could be used as priority filter for signal to assembly machine. e.g. sending chemical plant and pipe signal to machine recipe -> pipe should have priority over chemical plant. If not, machine try to make chemical plant at first.
Re: Combinator cookbook 2.0
Posted: Sat Dec 28, 2024 5:57 pm
by Tertius
Pulse Extender
This is one thing I didn't see yet, it's the counterpart of the edge detector: the pulse extender. It's another variation of the memory cell that simply holds the last non-null signal forever or until you reset with R <> 0.
To hold and store one specific signal and not simply everything, replace all the EACH wildcards with the specific signal you want.
combinator_18405600_512x192.png (42.16 KiB) Viewed 642 times
The fascinating thing is the AND EACH = 0 part of the condition in the lower combinator. Usually, EACH=0 is never true, because if everything is 0 there is nothing for EACH to expand, so no check is being done, so it can never result in anything being true. But here the signals seem to have been collected by the other EACH that checks for the other wire.
So if you provide a list of non-null signals on one wire, you're able to check for EACH=0 on the other wire and get results!
Seeing all these 1- or 2-combinator setups that look all the same in the screenshot but provide meaningful different generic behaviors, I would say the 2.0 combinator changes are not just convenience, they really add generic functionality not available previously. I'm not decided yet which of all the 1-combinator examples to add to the wiki guide I intend to create, since they seem kind of trivial if you look at them. On the other hand, it's not trivial to find the right combination of wire selection, wildcard, loopback, comparison. There are so many variations possible now. People might not realize on their own some task is trivial.
Re: Combinator cookbook 2.0
Posted: Sun Jan 05, 2025 7:21 pm
by Tertius
I found an interesting MAP on discord with just 1 decider.
This simple variant picks the most available fluid and outputs the corresponding solid fuel recipe, so always the most available fluid is converted into solid fuel.
The variant in discord additionally uses the green wire color to perform additional comparisons against configured values across wire colors, for example for "...but only if > minimum" conditions. To differ between item and recipe, the recipe values are bumped into the millions.
01-05-2025, 20-13-07.png (278.67 KiB) Viewed 448 times
Tertius wrote: Sun Jan 05, 2025 7:21 pm
I found an interesting MAP on discord with just 1 decider.
This simple variant picks the most available fluid and outputs the corresponding solid fuel recipe, so always the most available fluid is converted into solid fuel.
Mindblowing. Instantly updated my auto-unbarelling setup to be 3 ticks faster.
This, however, works only for static maps -- for dynamic maps you still need an extra combinator or two.
01-06-2025, 17-06-39.png (672.64 KiB) Viewed 419 times