Decider combinator behavior

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
alexiooo
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Oct 28, 2025 7:45 pm
Contact:

Decider combinator behavior

Post by alexiooo »

I have a network with two signals, here using X and Y, and I would like to find the minimum of the two---writing this now, I realize I can use a selector combinator for this, but in my original larger problem I was trying to stuff more logic into a single decider combinator.

In any case, I tried to express finding the minimum as "anything <= X AND anything <= Y", as seen in the screenshot. I expected this to roughly mean: match any signal s, such that s <= X and that same s <= Y, which since I know that X and Y are the only signals in the network, should've given me the smaller signal (I don't particularly care which one I get if they are equal). Instead, no output was generated, presumably because of the behaviour described here.
Screenshot From 2025-10-28 19-50-33.png
Screenshot From 2025-10-28 19-50-33.png (223.71 KiB) Viewed 340 times
I can achieve what I wanted by just using 2 combinators, so it's fine, but this behaviour was surprising and non-intuitive enough that was going to submit a bug report as well, before I found this thread!

EDIT: While playing with "Anything" I also ran into the following situation, where asking for "anything != X" gave "X" as a result.
Screenshot From 2025-10-28 20-01-20.png
Screenshot From 2025-10-28 20-01-20.png (314.62 KiB) Viewed 339 times
If it matters, I encountered this behaviour on version 2.0.69 (build 84148 expansion, linux64)
Last edited by alexiooo on Tue Oct 28, 2025 8:05 pm, edited 3 times in total.
h.q.droid
Fast Inserter
Fast Inserter
Posts: 219
Joined: Mon Nov 18, 2024 12:10 pm
Contact:

Re: Decider combinator behavior

Post by h.q.droid »

As a workaround, you can use "each" for your desired behavior. "anything" is undefined behavior right now, deducing from this: viewtopic.php?t=122664
Tertius
Smart Inserter
Smart Inserter
Posts: 1469
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Decider combinator behavior

Post by Tertius »

alexiooo wrote: Tue Oct 28, 2025 7:57 pm In any case, I tried to express finding the minimum as "anything <= X AND anything <= Y", as seen in the screenshot. I expected this to roughly mean: match any signal s, such that s <= X and that same s <= Y, which since I know that X and Y are the only signals in the network, should've given me the smaller signal (I don't particularly care which one I get if they are equal). Instead, no output was generated, presumably because of the behaviour described here.
Your 1st screenshot doesn't output anything, because the 1st ANY doesn't match, because there isn't any signal equal or below X (Y is the only other signal, but it is above). The 2nd ANY matches, because there is the signal X that is lower than Y. However, both are combined with AND, and with the 1st condition being false and the 2nd being true, the AND result is false, so no output is being generated.

About the 2nd screenshot:
The ANY operator is evaluated every time on its own when it is encountered in some term. It's not holding the same signal for every ANY.
There is a signal not equal to X, (it's Y), so the condition is true. As output, any signal is selected, and this means any signal from the whole input. Not necessarily the matchig signal. X is being selected, because ANY selects the signal by internal signal order, and X comes before Y.

If you want the output ANY select only from signals matching a condition, you need to replace the ANY in the condition with an EACH.
Nidan
Filter Inserter
Filter Inserter
Posts: 338
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Decider combinator behavior

Post by Nidan »

h.q.droid wrote: Wed Oct 29, 2025 3:19 am "anything" is undefined behavior right now, deducing from this: viewtopic.php?t=122664
Using Anything as output isn't undefined, it's function is quite useful. But it's ingame tooltip could be improved.
When used as output and the conditions do not use Each, it outputs one signal from the selected input(s) (the first in internal ordering). The condition doesn't influence which signal gets picked, the only thing that matters is that it passes as a whole.
When used as output and the conditions use at least once Each, the selection above is limited to the signals that allowed the condition (again, as a whole) to pass.
alexiooo
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Oct 28, 2025 7:45 pm
Contact:

Re: Decider combinator behavior

Post by alexiooo »

Tertius wrote: Wed Oct 29, 2025 7:59 am Your 1st screenshot doesn't output anything, because the 1st ANY doesn't match, because there isn't any signal equal or below X (Y is the only other signal, but it is above). The 2nd ANY matches, because there is the signal X that is lower than Y. However, both are combined with AND, and with the 1st condition being false and the 2nd being true, the AND result is false, so no output is being generated.
Thanks for the response, but it seems there's been a slight confusion! I was replying to a bug report somebody made about decider combinator behaviour involving "Anything", to which the response was that the reported behaviour was by design, since the right-hand-side of a condition with Anything on the left is apparently excluded from the signals considered. I was trying to add to this discussion with an example of interesting behaviour that is only possible if the signals on the right *are* included, but apparently mods moved my reply to a stand-alone post, or I might have clicked the wrong button? This is my first time posting on the forum.
About the 2nd screenshot:
The ANY operator is evaluated every time on its own when it is encountered in some term. It's not holding the same signal for every ANY.
There is a signal not equal to X, (it's Y), so the condition is true. As output, any signal is selected, and this means any signal from the whole input. Not necessarily the matchig signal. X is being selected, because ANY selects the signal by internal signal order, and X comes before Y.

If you want the output ANY select only from signals matching a condition, you need to replace the ANY in the condition with an EACH.
So the tooltip says "Output the first input signal, or the first signal that passed all conditions". Based on that, I'd have expected ANY to behave similar to EACH, but only output a single matching signal rather than all of them, but it seems that is not the case.

EDIT: ah, so the behaviour I was trying to achieve is possible when using EACH for the conditions and ANY for the output! I'd originally misread the suggestions as telling me to use EACH for the output also, which would be close, but not quite what I wanted. Thanks for letting me know!
It'd be nice if the tooltip clarified this, e.g., "Output the first input signal, or if EACH is used as a condition, the first signal that passed all conditions". It's slightly un-intuitive to me that ANY on the output is tied to EACH on the input, rather than ANY.
Post Reply

Return to “Gameplay Help”