[2.0.13] OR in decider combinator with EACH + EVERYTHING signals does not behave as expected

Bugs that are actually features.
GrimerX
Inserter
Inserter
Posts: 44
Joined: Thu Sep 17, 2015 5:06 am
Contact:

[2.0.13] OR in decider combinator with EACH + EVERYTHING signals does not behave as expected

Post by GrimerX »

I'm trying to create a generic train stop combinator that will call trains when
1/ Any of the material is less than some amount [can take more into storage]
2/ There is no material present

Hence, using the EVERYTHING of nothing test.

The condition evaluates correctly, but the OR does not behave as an OR.
Image

And it works correctly without using EACH as one of the tests.
Image
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3335
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.13] OR in decider combinator with EACH + EVERYTHING signals does not behave as expected

Post by boskid »

This falls into the same explanation as viewtopic.php?p=624460#p624460 - decider is in "each mode" so the behavior of outputs changes: they output 1 for each signal passing and since there were no "each" signal substitutes it outputs 1*0=0. Not a bug.
GrimerX
Inserter
Inserter
Posts: 44
Joined: Thu Sep 17, 2015 5:06 am
Contact:

Re: [2.0.13] OR in decider combinator with EACH + EVERYTHING signals does not behave as expected

Post by GrimerX »

Thanks boskid. I do understand why the 'each' is outputting [] now. However, my report is about the 'or' condition not behaving as OR. As you can see, one of the two conditions is true, so TRUE | FALSE should ==> TRUE, but it is evaluating as FALSE.

I am assuming the green means TRUE, if that is not the case disregard.

Thank you for looking.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3335
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.13] OR in decider combinator with EACH + EVERYTHING signals does not behave as expected

Post by boskid »

119917.

You are right TRUE | FALSE ==> TRUE however if there are no input signals, then this condition is considered as fulfilled for 0 signals and so each of the 0 signals produces output, which becomes no output.
GrimerX
Inserter
Inserter
Posts: 44
Joined: Thu Sep 17, 2015 5:06 am
Contact:

Re: [2.0.13] OR in decider combinator with EACH + EVERYTHING signals does not behave as expected

Post by GrimerX »

I see - thank you. I might suggest to not turn the row green then. Thanks again for the explanations!
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 784
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: [2.0.13] OR in decider combinator with EACH + EVERYTHING signals does not behave as expected

Post by IsaacOscar »

A workaround I found for this issue is to have a constant combinator that outputs non-zero values for all the signals you care about (in my case I only had 4, I assume trying to add every possible signal to the constant combinator is not a good idea as there are quite allot of them, and 5 versions with different qualities).

then connect it to the red wire input of the decider.
add an "OR each != each" condition to the decider but only for the red circuit.
and mark the rest of the conditions to be for the green circuit.

This will force the decider to do the rest of the comparisons for each signal from the constant combinator, even if the green wire value is 0. (it will also operate for those signals not in the constant combinator, but non-zero on the green circuit).

In particular, this solution allows you to do logic on "each" of the green signals when some of them are zero.
Post Reply

Return to “Not a bug”