Page 1 of 1

Assembler's "Set Recipe" should use the strongest signal

Posted: Tue Oct 22, 2024 9:22 pm
by 19wolf
So I've been playing around with the "set recipe" feature of assemblers and I'm having a lot of trouble getting it to do what I want because of how the signals currently work. And in researching it, apparently getting the max signal is non-trivial? Unless I'm missing something, if I could just get my assembler to use whatever signal has the highest value, I wouldn't end up with a contraption that's trying to make belts before it makes gears.

Re: Assembler's "Set Recipe" should use the strongest signal

Posted: Wed Oct 23, 2024 1:56 am
by sarge945
I noticed this too. It was very annoying.

You can work around it using the new combinator, but it's tedious and annoying.

Re: Assembler's "Set Recipe" should use the strongest signal

Posted: Sun Oct 27, 2024 9:55 am
by RoseQuartz
Would love to have this. It would make the somewhat tedious "ensure items are craftable" part of dynamic malls simpler and seems like an obvious feature.

Re: Assembler's "Set Recipe" should use the strongest signal

Posted: Sun Oct 27, 2024 10:53 am
by mmmPI
19wolf wrote: Tue Oct 22, 2024 9:22 pm And in researching it, apparently getting the max signal is non-trivial? Unless I'm missing something,
Most of your research must have found result from before the expansion release where it was indeed non-trivial to find the max signal.

The new selector combinator that can be used for this now, it has several mode, one of them ( on the right in the picture) allow to "select input" by descending order with X as index in the picture means sending X=1 as input with the other signals will have as result for ouput the highest signal ( the 1rst) in descending order , if you want the lowest signal you can sort by ascending.
selector combinator.jpg
selector combinator.jpg (143.64 KiB) Viewed 854 times
There are other mode that may help.

Not sure how i feel about the suggestion, the strongest signal seems more intuitive, but may end up more difficult to use as it would change sometimes more frequently than the current order.

Re: Assembler's "Set Recipe" should use the strongest signal

Posted: Sun Oct 27, 2024 12:52 pm
by Elobomg
This is totally needed In my opinion. Right now we have the tools to do it with some combinators but really if just the assembly would just take the strongest signal I could just add a *10 to each intermediate ingredient after being compared in a chest so it will craft it first and after 1/10 of the signal is made, will change to the other recipe and tho, making a smart mall would be sooooo much easier than starting to filter out all the things you need before final product.
mmmPI wrote: Sun Oct 27, 2024 10:53 am
19wolf wrote: Tue Oct 22, 2024 9:22 pm And in researching it, apparently getting the max signal is non-trivial? Unless I'm missing something,
Most of your research must have found result from before the expansion release where it was indeed non-trivial to find the max signal.

The new selector combinator that can be used for this now, it has several mode, one of them ( on the right in the picture) allow to "select input" by descending order with X as index in the picture means sending X=1 as input with the other signals will have as result for ouput the highest signal ( the 1rst) in descending order , if you want the lowest signal you can sort by ascending.
selector combinator.jpg
There are other mode that may help.

Not sure how i feel about the suggestion, the strongest signal seems more intuitive, but may end up more difficult to use as it would change sometimes more frequently than the current order.
Yeah you would need to amplify the signal after being compared so it has highest priority and then is crafted. Also using small orders would compensate this tho.

Re: Assembler's "Set Recipe" should use the strongest signal

Posted: Tue Nov 26, 2024 11:30 am
by IsaacOscar
What if the maximum signal changes too quickly?
Then the recipe could changed after ingredients have been picked up but before they are placed in the machine, thus causing inserers to get stuck.

I suggest it only changes recipe if the current recipe signal is no longer sent, or it has no recipe set and there is a signal. Then when it changes, it uses the max.
This behaviour would be hard to communicate to users.

Re: Assembler's "Set Recipe" should use the strongest signal

Posted: Tue Nov 26, 2024 5:27 pm
by Khazul
This seems to be one of those things that if it gets done, then there are many many other scenarios that have equally good arguments for special treatment of signals.
As someone suggested - use a selector combinator. If you need to restrict signals, use a multi-decision decider setup to function as a filter.
If you use the random input option it has an update timer as well that may be useful holding a recipe to save messing with timed latch setups (though a timed latch will always be more responsive).

What I actually use for recipe swapping is a lock out latch that blocks further recipe changes until the current one has finished or was abandoned. That other thing I sometimes use is triggered register (basically a multi-signal memory cell with a separate trigger input to load the register).

I think there are greater needs for more combinators with more complex operators to more generally facilitate the kind of control you are looking for, for eg, while there are resources around for many of the more complex combinator setups with feedback that can be out of reach for many players and/or end up very clunky with circuits, for eg clocks/timers, memory cells, clocked memory cells, SR and RS latches, Continuous Moving Average accumulators and many others that would be of far greater and more general benefit I think as well as immediately solving these kinds of problems and making the solutions to these kinds of problems much more accessible to people or even just to save space for those who already know what they are doing.