[2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop

Bugs that are actually features.
Sukasa
Burner Inserter
Burner Inserter
Posts: 9
Joined: Tue Apr 29, 2014 1:00 am
Contact:

[2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop

Post by Sukasa »

Working on trains, I have found that circuit conditions checking that a signal is not present do not work if the train stop the train is at does not have a circuit connection.

This is somewhat of a problem as I am trying to set up a 'refuel' interrupt where specific train stops can inhibit that interrupt from firing if those stops have complex circuit logic attached to them.
11-30-2024, 09-40-40.png
11-30-2024, 09-40-40.png (57.65 KiB) Viewed 781 times
This is the interrupt in my petri-dish world I have been testing with. The '2' is not significant.

Save file is attached. Incidentally you notice that the one "Goto B and D" interrupt gets cancelled by the "Goto C" interrupt instead of interrupted, which would be a real problem if the train was trying to pick cargo up at B and drop it off at D... This is (slightly improperly) documented in another bug report here that didn't get a response yet, and it appears to still be relevant to 2.1.21
Attachments
PetriDish.zip
(1.35 MiB) Downloaded 22 times
Loewchen
Global Moderator
Global Moderator
Posts: 9908
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [2.1.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop

Post by Loewchen »

It's way simpler, no train stop circuit condition is true without the stop having a circuit connection. This behavior was the same in 1.1.
Sukasa
Burner Inserter
Burner Inserter
Posts: 9
Joined: Tue Apr 29, 2014 1:00 am
Contact:

Re: [2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop

Post by Sukasa »

I would counter that having interrupts that sometimes can and sometimes cannot function when they are checking that a signal is zero (or in this case "not 2") is in no way simpler to try and manage from a conceptual and maintenance point of view. As well, there is no "no circuit connection" trigger that could be used in an alternative clause to achieve equivalent functionality.
robot256
Smart Inserter
Smart Inserter
Posts: 1119
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop

Post by robot256 »

Sukasa wrote: Sat Nov 30, 2024 11:18 pm I would counter that having interrupts that sometimes can and sometimes cannot function when they are checking that a signal is zero (or in this case "not 2") is in no way simpler to try and manage from a conceptual and maintenance point of view. As well, there is no "no circuit connection" trigger that could be used in an alternative clause to achieve equivalent functionality.
The "no circuit connection" trigger could be useful, but you can also use the At specified station / Not at specified station conditions if you know which stations have the circuit.
Sukasa
Burner Inserter
Burner Inserter
Posts: 9
Joined: Tue Apr 29, 2014 1:00 am
Contact:

Re: [2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop

Post by Sukasa »

That only works if you know the stations ahead of time, but if you're designing a blueprint book that's, unfortunately, not necessarily an available option
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3753
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop

Post by boskid »

Hm... looking at the code i see this behavior was introduced literally when circuit conditions in schedule were added (it appears that was in 0.13.0) and it was always working this way (considering circuit condition as false when train stop does not provide a circuit connector). Changing this behavior causes no tests to fail however i always considered this behavior to be a feature. Changing this is relatively simple for me but i am not sure if its actually a bug. Similar behavior was put in place for space platform schedule when "send to platform" checkbox is disabled: in that case circuit conditions inside of a space platform are also considered as false regardless of conditions being true for zero-valued signals.
robot256
Smart Inserter
Smart Inserter
Posts: 1119
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop

Post by robot256 »

Sukasa wrote: Tue Dec 03, 2024 3:37 am That only works if you know the stations ahead of time, but if you're designing a blueprint book that's, unfortunately, not necessarily an available option
If you are designing a blueprint book, including the stations, then you can include an empty constant combinator attached to every station type where you want the interrupt to function.
thialfi17
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Oct 26, 2024 2:36 pm
Contact:

Re: [2.0.21] Train interrupt circuit condition checking for non-presence of signal needs wired train stop

Post by thialfi17 »

Sorry to bump this so late but I just encountered this in my game, I have a proposal that doesn't change the behaviour that hopefully will aid in discoverability (at least in some circumstances):

Can you add the green highlighting like from decider combinators to the interrupt conditions? Is that technically/mechanically possible to add from the perspective of the train that you are looking at? It wouldn't be perfect but it would at least make it clear to me which of the conditions wasn't firing.

To actually allow me to work around this, please can we also have an interrupt condition for "Not at a station" or "No circuit connection". That way I can have an interrupt with the circuit condition when at a station and an interrupt without the circuit condition which is only used when not at a station.

Context for my issue:
I have a refuelling interrupt that checks a circuit condition (used to indicate if a train station is "stacked" which requires special pathing to escape) to prevent it from triggering. I incorrectly assumed that a non-present connection would be treated the same as zero which follows the logic used elsewhere that any signal not explicitly set is zero. As you stated maybe this isn't a bug and maybe it is a feature, however I found it unintuitive and ended up spending quite a long time debugging why my interrupt wasn't firing since all of the conditions appeared to fulfilled. It's also extra annoying because this interrupt seems to work on some of my stations (because they have the send to train feature enabled by pure chance in a blueprint + circuit connection) but then on my fluid trains it doesn't (different/no blueprint for stations) which means I went for hours and hours without encountering this problem until one of my fluid trains got stuck.
Locked

Return to “Not a bug”