Decider combinator weird "anything" output

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
xoft
Burner Inserter
Burner Inserter
Posts: 19
Joined: Thu Aug 25, 2016 4:08 pm
Contact:

Decider combinator weird "anything" output

Post by xoft »

I'm having some trouble with a decider combinator:
Basically, I'm trying to burn away excess material on Gleba. I'm comparing the logistic network contents to set values, hoping to output any item that has more than the set amount. However, the output for some reason is "belt" instead of the bio items that the combinator is watching. Any idea why this is so?
The "Anything" output description says that the first signal matching the condition will be output. There's no condition on belts in my inputs. Based on the description alone, I'd say it's a bug, but it would seem weird that such a basic bug would go unnoticed for so long.
12-10-2024, 14-39-57.png
12-10-2024, 14-39-57.png (138.82 KiB) Viewed 500 times
Here's my save (~50 MiB): https://xoft.cz/factorio/First%20-%20we ... output.zip
The decider combinator is next to the player on Gleba.
jaylawl
Fast Inserter
Fast Inserter
Posts: 157
Joined: Sat Nov 23, 2024 10:14 am
Contact:

Re: Decider combinator weird "anything" output

Post by jaylawl »

That isn't how the "anything"-thing works (and i'm not even sure exactly how it works) - you need something else anyway.

Try this:

Assume the red signal provides how much of each item you have and the green signal provides the amount of items you want in storage at maximum. This combinator will then forward the signal only if red is greater than green, which you can use to your liking - for example on filter inserters. This will work for outputting multiple signals.
comb.png
comb.png (560.94 KiB) Viewed 490 times
BlakeMW
Filter Inserter
Filter Inserter
Posts: 965
Joined: Thu Jan 21, 2016 9:29 am
Contact:

Re: Decider combinator weird "anything" output

Post by BlakeMW »

"Anything" outputs the first and only the first signal, if any signal passes, the one it outputs doesn't have to be one that passed.

"Everything" will forward all signals if all of them pass.

"Each" will process each signal independently, forwarding it only if it passes.


What you probably want here, is to use a Decider combinator in AND mode with a Constant Combinator.

For example on the Constant Combinator, output "Spoilage = 500, Jellynut seeds = 100, ...", put that on the green wire.

On the Decider Combinator, on the green wire have the constant combinator, and on the red wire the "stuff in storage" signal. Then do something like "Each
(green) > 0" to filter to only things defined in the constant combinator, AND Each (red) > Each (green) to filter to only those in excess of defined. Output Each = 1.
Tertius
Smart Inserter
Smart Inserter
Posts: 1007
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Decider combinator weird "anything" output

Post by Tertius »

As far as I understand the ANY operator as output, it chooses from the complete input set if used with one of the ordinary comparison operators, and from the matching input set if used with the EACH operator as comparison operator. It gets really complicated, if you use multiple conditions and one (or even more) are with EACH.

The first part of the popup help text "the first input signal..." applies to ordinary comparison operators, and the second part "..the first signal that passed all conditions..." means all that passed an EACH.
Lighthouse
Burner Inserter
Burner Inserter
Posts: 19
Joined: Wed Nov 20, 2024 3:09 am
Contact:

Re: Decider combinator weird "anything" output

Post by Lighthouse »

I see several different aspects here.

a) reaching your goal - fellow members already replied helpfully.
b) logical correctness of the output (rather than being a bug) - a dispute
c) whether the in-game description/documentation is helpful - what I want to focus on.

Here quoting the the full description of the Anything (Virtual Signal)
If any of the input signals meet the condition, it will pass. It is false when there are no inputs.
Outputs the first input signal, or the first signal that passed all conditions, respecting signal order in both cases.
and a simplified sample:
Image

This is logically correct, just as the sentence "Either my name is Lighthouse or the moon is made of cheese.". But I think the description and the actual output could be rephrased for easier reading.
There is an input signal that passes all conditions and it is not part of the output. Why should "[...]or the first signal that passed all conditions[...]" be part of the description? (This is not rhetorical - I actually would like to understand: Does that part make a difference in other cases that we didn't consider here?)

IMHO The description of the output could be something like "Independent of what signal passed the condition, the output is the first input signal (ordered ascending by an internal signal ID)". Actually I am not sure of the "internal signal ID" part, but as you can see in my example: the red signal has a smaller ID than the green ("first" connection ID) but the output is part of the green set anyway.
Attachments
simplified case.png
simplified case.png (62.93 KiB) Viewed 381 times
jdrexler75
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Sat Nov 28, 2020 5:27 pm
Contact:

Re: Decider combinator weird "anything" output

Post by jdrexler75 »

Lighthouse wrote: Tue Dec 10, 2024 10:55 pm IMHO The description of the output could be something like "Independent of what signal passed the condition, the output is the first input signal (ordered ascending by an internal signal ID)". Actually I am not sure of the "internal signal ID" part, but as you can see in my example: the red signal has a smaller ID than the green ("first" connection ID) but the output is part of the green set anyway.
The signal order has long been a question of mine, I don't think it's explained anywhere, and I haven't been able to influence it.

But I do know that whenever I try to rely on signal order, the game consistently picks the one I didn't want :roll:

So I've never been successful in using the "any" signal, and already rework the logic to use "each" plus an extra condition.
Nidan
Filter Inserter
Filter Inserter
Posts: 275
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Decider combinator weird "anything" output

Post by Nidan »

Lighthouse wrote: Tue Dec 10, 2024 10:55 pm Here quoting the the full description of the Anything (Virtual Signal)
If any of the input signals meet the condition, it will pass. It is false when there are no inputs.
Outputs the first input signal, or the first signal that passed all conditions, respecting signal order in both cases.
[...] Why should "[...]or the first signal that passed all conditions[...]" be part of the description?
Because it is necessary, albeit worded poorly. Both halves of the tooltip talk about different things.
My attempt at rewording it wrote:When used as condition, it will pass if any of the input signals meet the condition. It is false when there are no inputs.
When used as output, it outputs the first input signal, or, if the conditions use Each, the first signal that passed all conditions, respecting signal order in both cases.
----------
jdrexler75 wrote: Wed Dec 11, 2024 12:15 am The signal order has long been a question of mine, I don't think it's explained anywhere, and I haven't been able to influence it.
It is roughly the same order as within the signal picker UI, exceptions may exist. You can't influence it.
feng
Inserter
Inserter
Posts: 42
Joined: Sat Jun 25, 2016 1:17 pm
Contact:

Re: Decider combinator weird "anything" output

Post by feng »

I had some similar issues some weeks ago and reported a bug. Thanksfully I got an explanation from boskid how the new deciders work in 2.0:

Deciders have 2 operation modes:
- 'normal' mode:
normal mode is active when there is NO 'each' condition on input side. So only when using 'Any', 'Everything' or an individual input signal. Normal mode deciders will PASS ALL input signals if one condition becomes true. That means that also signals will pass that do not meet the condition. On output side you can still select which passed values you want to output (red wire, green wire)

- 'each' mode:
each mode is active as soon as one 'each' condition is on input side. Each mode deciders will only pass EACH signal that meets the corresponding condition.

OPs problem explained: Decider is in normal mode as only individual signal conditions are there. One condition becomes true, so ALL signals are passing to the output side. The 'Any' selector then outputs the very first signal it catches from all the passed signals. The order of the signals is equal to the order of the signals in the signal picker UI.

Solution to your problem would be the already mentioned way with a constant combinator and checking red vs. green wire signals like this:
grafik.png
grafik.png (105.05 KiB) Viewed 298 times
Lighthouse
Burner Inserter
Burner Inserter
Posts: 19
Joined: Wed Nov 20, 2024 3:09 am
Contact:

Re: Decider combinator weird "anything" output

Post by Lighthouse »

Ah, thanks, feng! Now I understand why the description is the way it is. For me the description text still does not seem helpful.

With this in mind I guess the original use case could be implemented like this:

Image
Image

Some ideas on the "order by ID" part: I guess the corresponding field is "order" in the data.raw?

yumako-mash
order = "a[organic-processing]-c[yumako-mash]"

spoilage
order = "c[nutrients]-a[spoilage]"

Assuming the ordering is alphanumerical... but actually its my first time of looking at this data.raw and I am no modder, so this is really more of a question than a deeper insight.
User avatar
PssX
Inserter
Inserter
Posts: 26
Joined: Tue Mar 01, 2016 9:00 am
Contact:

Re: Decider combinator weird "anything" output

Post by PssX »

Lighthouse wrote: Wed Dec 11, 2024 4:04 pm I guess the corresponding field is "order" in the data.raw?
https://lua-api.factorio.com/latest/types/Order.html
Post Reply

Return to “Gameplay Help”