Interrupt cancels ongoing interrupt

Post your bugs and problems so we can fix them.
RandomUsername
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Nov 21, 2023 12:39 am
Contact:

Interrupt cancels ongoing interrupt

Post by RandomUsername »

An interrupt that is allowed to interrupt other interrupts completely clears temporary stop schedule.

E.g. Have a refuel interrupt that can interrupt others, and an interrupt that has 2 stops. If the refuel interrupt becomes valid before the train leaves the first station, then upon starting the refuel becomes active, and instead of the EXPECTED behaviour of just inserting the predefined stop(s) before the next station, the temporary schedule is wiped, and the interrupt is added.

This might be intentional, if so, make this VERY clear in the "Allow interrupting other interrupts" tooltip, otherwise (my preference) change the behaviour.

Single stop train interrupts would work, but then what is the point of interrupting an interrupt, if you cannot have the train continue where it left off? Why wouldn't I just use a normal interrupt with higher priority?

------------
Edit: Ignore this last section, pointless to the topic

Sidenote, to why this is an issue with my train network:
Dynamic train station names are not a feature. Thus dynamically dispatched pickup trains are only possible if you have every pickup station as the same name. (With wildcards dropoffs work as intended)

Problem: For n stations you need n trains because worst case scenario, every train goes to a different stop fills up, then waits until needed. Obviously resources that are not in demand will have trains sitting there uselessly.

Solution: Check if both load and unload have a space for a train, if so, do the obvious route. This train will occupy the train limit that very instant and prevent others from being dispatched.
However if you have for example both Plastic and Copper Ore loading stations open, have both stations named "Pickup", and need copper delivered, there is no guarantee that your train will actually go to the Copper Ore "Pickup" station.

With this system having two stop interrupts and an interrupting refuel interrupt, I've had a few cases of unintentional belt mixing, which is never fun.
Last edited by RandomUsername on Sun Dec 01, 2024 4:37 pm, edited 1 time in total.
Sukasa
Burner Inserter
Burner Inserter
Posts: 9
Joined: Tue Apr 29, 2014 1:00 am
Contact:

Re: Interrupt cancels ongoing interrupt

Post by Sukasa »

Seems in 2.1.21 this is still an issue. I've got an example save, attached, where a train running a pair of interrupts will ultimately never complete one of the interrupts as the second station in that interrupt gets cancelled by a refuelling interrupt. I would have expected an interrupt to insert a temporary stop, not replace existing temporary stops.
Attachments
PetriDish.zip
(1.35 MiB) Downloaded 5 times
Rafiki23
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Dec 01, 2024 1:52 am
Contact:

Re: Interrupt cancels ongoing interrupt

Post by Rafiki23 »

I agree,
If a priority interrupt, interrupts an active interrupt, then it cancels the active interrupt, rather then returning to the active interrupt, once the priority interrupt is complete.
So, if you are running copper plates, get diverted by a priority interrupt for fuel, you will then return to the depot after executing the fuel interrupt, then if you get a call for iron plates, go to the the iron supplier but already have a full copper cargo so then deliver the iron cargo to the copper drop-off.

Watch the active train in the attached save file.

Rafiki
User avatar
Theragus
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Fri Oct 25, 2024 8:42 pm
Contact:

Re: Interrupt cancels ongoing interrupt

Post by Theragus »

Hi,
from what I see this is intended behavior as described in the original FFF regarding Train Interrupts in Interrupts -> https://factorio.com/blog/post/fff-389
This allows the interrupt to trigger while another interrupt is in progress, which clears the original interrupt and replaces it with the new interrupt targets.
For the use case described by Rafiki23, you could edit the interrupt to take into account the items that the train is currently loaded with (Item Wildcard), then an interrupt would trigger to drop of the items after leaving the refueling stop instead of going to a pickup station again, as shown in the screenshot for the FFF.

Also, small note that Interrupts actually have an execution order, top to bottom, so if multiple interrupts would become active the first one that matches the condition is picked.
Never Stop!
User avatar
Theragus
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Fri Oct 25, 2024 8:42 pm
Contact:

Re: Interrupt cancels ongoing interrupt

Post by Theragus »

Sorry, forgot a small addition regarding original post:
RandomUsername wrote: Tue Nov 05, 2024 2:28 pm However if you have for example both Plastic and Copper Ore loading stations open, have both stations named "Pickup", and need copper delivered, there is no guarantee that your train will actually go to the Copper Ore "Pickup" station.
there actually is, the train stop priority feature does exactly what you want.
This is also the example that was used for train stop priority initially, preventing trains from just moving around advanced products while ignoring basic ingredients.
Never Stop!
RandomUsername
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Nov 21, 2023 12:39 am
Contact:

Re: Interrupt cancels ongoing interrupt

Post by RandomUsername »

Theragus wrote: Sun Dec 01, 2024 1:25 pm there actually is, the train stop priority feature does exactly what you want.
This is also the example that was used for train stop priority initially, preventing trains from just moving around advanced products while ignoring basic ingredients.
You're right, I'm actually working on a design that works using the circuit network, with with global requests being sent to trains. Once a train is dispatched, the incoming train count is subtracted from the global need. The design somewhat resembles what is outlined in this video

Nonetheless, the interrupt cancelling the schedule is still an issue for simpler designs, and I do not see an use case for it in the current state whatsoever.
User avatar
Theragus
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Fri Oct 25, 2024 8:42 pm
Contact:

Re: Interrupt cancels ongoing interrupt

Post by Theragus »

Hi,
in regards to the initial report, I don't think this is technically a bug since it's working as intended.

For your issue with the behavior of Interrupting interrupts REPLACING instead of ADDING temporary stops, I'm gonna give my (unqualified) opinion that you then need to design your interrupts better.
Most notably in a way to make sure your desired interrupts are triggered even when the trains are leaving the stop at their refueling station.
Since I don't have seen any of your setups I'm just gonna post one I am currently using.
12-01-2024, 19-18-04.png
12-01-2024, 19-18-04.png (77.23 KiB) Viewed 146 times
This is a very simple one (maybe in some cases too simple) and covers the case where trains go to the refueling midways but allows them to resume their intended operation after that.
Never Stop!
Sukasa
Burner Inserter
Burner Inserter
Posts: 9
Joined: Tue Apr 29, 2014 1:00 am
Contact:

Re: Interrupt cancels ongoing interrupt

Post by Sukasa »

Sounds like the issue is in the design and not the implementation, but that doesn't mean it's not an issue. Regardless, having interrupts be wiped out means that more complex routing/station work/etc is essentially impossible unless you want to have an exploding number of interrupt combinations. Even just a "replace existing temporary stops" checkbox that makes the interrupt ADD instead of REPLACE would be a great fix
Post Reply

Return to “Bug Reports”