Train interrupt "Destination full or no path" question

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Azhdar
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Oct 30, 2020 11:51 pm
Contact:

Train interrupt "Destination full or no path" question

Post by Azhdar »

Hello,

In 1.1 my trains were following this schedule :
-Res pickup -> until full
-Depot -> 1s inactivity
-Res drop off -> until empty
-Depot -> 1s inactivity
The Depot station acted as a fuel station as well.
The Res pickup and drop-off stations were moderated by circuit that adjust the train limit depending on available resources/storage space. Thus the trains were waiting at the Depot stations until a space opened in a pickup/drop-off station.

I tried to implement this in 2.0 using the interrupt system but it does not work properly :
-Res pickup -> until full
-Res drop off -> until empty
+Interrupt : Fuel
+Interrupt : when Destination full or no path -> Depot until Res drop-off is not full (I tried several variants with both an interrupt when train is full and one when train is empty)
The problem is that when the drop-off station opens up, the trains first go back to the pickup station for nothing before heading to the drop off. I am not sure of how it works, but it seems the interrupt disturbs their regular schedule and they're jumping to the next station.

Can anyone explain how the interrupt system works and how I could do ?

Thanks !
Diver
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu May 11, 2017 7:51 pm
Contact:

Re: Train interrupt "Destination full or no path" question

Post by Diver »

I have the same issue. It feels like the interrupt is put in the wrong order, skipping the current Target.

On the example:
-Pickup location -> wait til full
-Dropoff location -> wait til empty
-Interrupt if Destination full -> goto Wait location, wait until pickup is not full

It seems what happens is:
emptied at dropoff -> selects pickup as next station, but fires interrupt because pickup is full.
Interrupt is inserted BEHIND pickup, effectly skipping pickup. So the next station, after the interrupt, is Dropoff again.

What i would expect is the interrupt being inserted BEFORE pickup, so the train continues it's orders normally after the interrupt.

My Workarround right now is to have two Stations in my Interrupt: Wait location, followed by Pickup/Dropoff depending on loadstate. Both with the same wait conditions as on normal scheudle.
The drawback is, i need two interrupts for each cargo im hauling, as i need to define the Pickup/Dropoff locations specifically.

So Interrupt1: When Destination full or no path AND Has Cargo in inventory -> goto Wait location, wait until dropoff is not full -> goto dropoff, wait until cargo empty
Interrupt2: When Destination full or no path AND Empty cargo inventory -> goto Wait location, wait until pickup is not full -> goto pickup, wait until cargo full

I hope for a better solution, as in letting the player define if the interrupt should be before or after current target.
Last edited by Diver on Fri Oct 25, 2024 3:02 pm, edited 1 time in total.
Azhdar
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Oct 30, 2020 11:51 pm
Contact:

Re: Train interrupt "Destination full or no path" question

Post by Azhdar »

Diver wrote: Fri Oct 25, 2024 3:01 pm My Workarround right now is to have two Stations in my Interrupt: Wait location, followed by Pickup/Dropoff depending on loadstate. Both with the same wait conditions as on normal scheudle.
The drawback is, i need two interrupts for each cargo im hauling, as i need to define the Pickup/Dropoff locations specifically.

So Interrupt1: When Destination full or no path AND Has Cargo in inventory -> goto Wait location, wait until dropoff is not full -> goto dropoff, wait until cargo empty
Interrupt2: When Destination full or no path AND Empty cargo inventory -> goto Wait location, wait until pickup is not full -> goto pickup, wait until cargo full
When I tried this it did not work for me, and the trains were still jumping stations (sometimes several trains would try to go to the same station at the same time when it opened and then get rerouted to the other stations in their schedule).
But the solution I found (detailed below) is really similar to yours so maybe it was another problem that affected my trains, I would need to try again.

Something that seems to work :
In the interrupt condition, instead of "Destination full or no path" as a condition using "Station is full" works as intended (without jumping to the next station). However the station need to be specify, and thus one interrupt per station in the schedule to be created (maybe there's a smoother way to do it but I did not find it yet).

Current schedule would be :
-Res pickup -> until full
-Res dropoff -> until empty
Interrupt 1 : if Any Res dropoff is full AND Full Cargo -> Depot until Any Res Dropoff is not full
Interrupt 2 : if Any Res pickup is full AND Empty Cargo -> Depot until Any Res Pickup is not full
Both interrupt are standardized for most of my trains so set up is easier, and train do not seem to jump a station when using these.
Azhdar
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Oct 30, 2020 11:51 pm
Contact:

Re: Train interrupt "Destination full or no path" question

Post by Azhdar »

I think a wait condition such as "Wait until next station in schedule is not full" would be perfect to streamline the process and avoid train jumping stations.
Kalanndok
Long Handed Inserter
Long Handed Inserter
Posts: 90
Joined: Sat Dec 12, 2015 9:07 am
Contact:

Re: Train interrupt "Destination full or no path" question

Post by Kalanndok »

That can't be made easily.
The "next station" is only ever determined after the wait conditions are fulfilled so the information is not yet there while the train is waiting.

Interrupts are supposed to be used for that case.
GlitchCloud
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Oct 31, 2024 9:48 pm
Contact:

Re: Train interrupt "Destination full or no path" question

Post by GlitchCloud »

I've stumbled upon this problem and my solution is to create waiting stations right before the unload stations and make it so that train is not able to leave unless it goes through the unload (which will remain blocked till the previous train unloads).
10-31-2024, 22-51-47.png
10-31-2024, 22-51-47.png (169.52 KiB) Viewed 2254 times
Edit:
But even then the trains that are supposed to wait for their turn will seep through the empty stations and go for a needless refill. Sigh...
GlitchCloud
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Oct 31, 2024 9:48 pm
Contact:

Re: Train interrupt "Destination full or no path" question

Post by GlitchCloud »

I think I have figured it out:

1) Use the same name for multiple unload stations if you have more than one for the same resource so you don't need to create interrupts for each and every unload station.
2) Use separate Interrupts for different resources with the following setup: (Condition) Destination fill or no path, (Destination) [Your_Waiting_Station] -> Waiting condition) [Your_Unload_Station] is not full
3) ADD TWO UNLOAD SCHEDULES! So it looks like this: Go to loading and wait for full cargo, Go to unload and wait for empty cargo, Go to unload and wait for empty cargo

The reason for the last one is that when it fails to go to the unload station, goes for interrupt instead and when station frees up it tries to go for a refill and skips the unload (since it initially failed and was replaced by an interrupt.)

Now all my trains behave exactly like they supposed to: fill up, go to the waiting station and unload as soon as the unload is free to use. HURRAY!

Here is a screenshot of my locomotive settings for copper in case the text description is not clear enough
11-02-2024, 19-56-43.png
11-02-2024, 19-56-43.png (427.22 KiB) Viewed 2040 times
ferris.443
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat Nov 02, 2024 10:58 pm
Contact:

Re: Train interrupt "Destination full or no path" question

Post by ferris.443 »

The issue I have with this work around is, I expect under normal condition (interrupt not triggered) the train would load and unload, then proceed to another or the same unload station again without any cargo before proceeding to the load station.
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 141
Joined: Sun Jun 14, 2015 8:14 am
Contact:

Re: Train interrupt "Destination full or no path" question

Post by Tallinu »

Here's what worked for me. I had to create an interrupt for each resource (I already had all loading stations and unloading stations for each resource using the same names, i.e. "Copper Pickup" for outposts and several "Copper Unload" stops at the base). The interrupt specifically checks if that train group's unload station is full and the train has cargo, and if so sends it to the parking area until that specific station name is not full.

This has been correctly creating the temporary stops before the unload station, as desired (technically it places it after the pickup stop at the end of the list, but that's immediately before it loops around to the top, so it works. I haven't tested reordering the normal pickup and unload stations in the schedule). In a few cases when I first set up each interrupt, sometimes it placed the temporary stop after unload instead -- but in all those cases, after clearing it and letting the train go back out to a nearby outpost, when it triggered the interrupt again it created the temporary stop in the correct place on the schedule (and has continued to do so afterward).

20241103184802_1.jpg
20241103184802_1.jpg (400.52 KiB) Viewed 1697 times

I haven't set anything up for departing trains (in case not enough outposts have room for a train, since they're set up to configure their train limit based on how many train loads worth of resources are present in their buffer chests) but I expect it to work the same, just with "empty cargo" instead of "has cargo"...

I think the "Destination full or no path" interrupt needs a bit more explanation info in game. It doesn't seem very useful for "destination full" purposes. My guess is that it's intended for unexpected situations where the train needs to skip a stop to avoid getting stuck or caught in an endless loop rather than the otherwise "normal" behavior we want here. In which case, putting the temporary stop before the station would not be desirable.

For trains that can travel in both directions, for instance, you could create a generic "turnaround" shunt as a fork off of every outpost and set up a generic "Destination full or no path" interrupt that sends it to any of these turnarounds instead, to avoid having the train stop in the middle of the track with no path forward or backward. I don't think "destination full" would ever be likely to trigger this though, since a station which reduces its train limit does not cause trains that are already on their way to that station to stop or repath -- by design, they still arrive at that specific location.
gigahurts
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Nov 07, 2024 1:22 am
Contact:

Re: Train interrupt "Destination full or no path" question

Post by gigahurts »

Definitely agree that this feels like a bug. It seems to me like the following is happening:

1. The train finishes its wait condition at the loading station
2. The train evaluates the next station on its schedule, and determines that station is full.
3. The train considers the unloading station to be complete in the schedule, for some reason.
4. The interrupt occurs, moving the train to the waiting station.
5. The train returns to its schedule, which, since it already finished its unloading station in the schedule, is loading again.

Expected behavior:
Number 3 should not occur until a station has been actually visited. I expect the interrupt should stop evaluation of the next station and then, when it comes back from finishing the interrupt, the train should re-evaluate that station which it has not yet visited on the schedule as the next station to visit.

Perhaps a better way to frame this is that the interrupt occurs during a station evaluation, and it places an interrupt station after the station being evaluated. It then jumps to that interrupt and executes it, skipping the original destination. However, since a train would normally wait for a destination to become available, it feels that the interrupt should be placed before the destination, since it feels like this evaluation of a destination ultimately always happens before the destination is visited, never during the visit.

While it feels like wildcard station names might be able to improve this so you do not need to make one interrupt per resource, it will be far more complicated, and never be as elegant as if this worked as expected. If the behavior here is intended by the designers, I would recommend updating the text to say "Previous destination full or no path" or something similar, to convey that this interrupt will not happen until after a station is passed over in the schedule. Ideally we could get a little info icon explaining how it works, in that case.

FWIW here's my workaround that requires specially named smelting stops. Please excuse Windows not knowing how to handle HDR when using snipping tool. This effectively gives the same benefit of having two drop offs in a schedule, but without two of the problems of other approaches:
1. Not needing to make this interrupt one-per-resource.
2. When no interrupt happens, the train only does one drop off.
Attachments
Screenshot 2024-11-06 175240.jpg
Screenshot 2024-11-06 175240.jpg (1.53 MiB) Viewed 1545 times
Last edited by gigahurts on Thu Nov 07, 2024 1:58 am, edited 2 times in total.
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 141
Joined: Sun Jun 14, 2015 8:14 am
Contact:

Re: Train interrupt "Destination full or no path" question

Post by Tallinu »

gigahurts wrote: Thu Nov 07, 2024 1:41 am Definitely agree that this feels like a bug. It seems to me like the following is happening:

1. The train finishes its wait condition at the loading station
2. The train evaluates the next station on its schedule, and determines that station is full.
3. The train considers the unloading station to be complete in the schedule, for some reason.
4. The interrupt occurs, moving the train to the waiting station.
5. The train returns to its schedule, which, since it already finished its unloading station in the schedule, is loading again.
Remember, though, that only "Destination full or no path" seems to work this way. Using "(specified) station is full", the interrupt stop gets placed before the full station rather than after.

Like at the end of my previous post, I suspect "Destination full or no path" may be intended to skip a stop, in order to get a train out of a situation where it cannot path to any station on its normal schedule. But in that case it is not very useful for any "destination full" situation I have thought of. Maybe there is one? If so I'd love to hear it.

But maybe this interrupt condition (or all interrupts in general?) should have an option you can check or clear to control whether the train skips the current "next stop" in its schedule when firing the interrupt? Or "Destination full or no path" could be split or duplicated into two interrupts, one which skips a stop and one which doesn't?

It would be great to hear from the devs regarding the intended behavior of this interrupt. The workaround of setting up the desired behavior using "(specified) station is full" requires creating one interrupt for every single destination in every different train group's schedule, because it doesn't work if you leave the station unspecified. This method creates a large number of interrupts which differ only in which station is specified for their trigger and wait condition (since you need to also have the train wait until that specified station is no longer full before leaving the temporary stop). This goes against the design philosophy they seem to be aiming for of enabling you to use more generic schedules and routes and setting a certain thing up once and then being able to use it for many trains.

You can't always use the wildcard item parameter either, because the train may be empty, and yet you still want it to be able to go to a waiting station, depot, shunting yard, etc if no cargo loading location is available (all have reached their current train limit, or limit = 0). How do you tell the interrupt which station it should wait on to free up without that? It seems like there needs to be a generic "next stop is not full" wait condition (maybe "next stop is full" as well, though I'm not sure what that would be useful for) and a generic "next stop is full" interrupt trigger as well, which does not skip the next stop, just inserts the temporary stop before it the same way "(specified) station is full" does.
Last edited by Tallinu on Fri Nov 08, 2024 10:45 pm, edited 3 times in total.
Lochar
Inserter
Inserter
Posts: 47
Joined: Mon Mar 14, 2016 4:06 pm
Contact:

Re: Train interrupt "Destination full or no path" question

Post by Lochar »

Train with one stop: Cargo Pickup.

Interrupt: [Wildcard] Dropoff. Condition: Full Inventory And [Wildcard] > 0. Target station: [The actual wildcard item] Drop

Interrupt an Interrupt: Condition: Destination full or No Path. Target Station: Holding Bay


This should send a train to an open cargo pickup. When it's full, the first interrupt should send it to the dropoff. If the dropoff is full, the interrupt an interrupt happens and sends it to the holding bay.

If the cargo pickup is full after [Wildcard] Dropoff is complete, the interrupt an interrupt should fire off and send the empty train the the holding bay as well, and when destination full or no path clears, it should go to Cargo Pickup.

Then you just circuit control Cargo Pickup stations to be closed if you don't need their resource. And have enough Holding Bay stations to support a good chunk of your train system.
gigahurts
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Nov 07, 2024 1:22 am
Contact:

Re: Train interrupt "Destination full or no path" question

Post by gigahurts »

Tallinu wrote: Fri Nov 08, 2024 6:50 pm But maybe this interrupt condition (or all interrupts in general?) should have an option you can check or clear to control whether the train skips the current "next stop" in its schedule when firing the interrupt? Or "Destination full or no path" could be split or duplicated into two interrupts, one which skips a stop and one which doesn't?

It seems like there needs to be a generic "next stop is not full" wait condition (maybe "next stop is full" as well, though I'm not sure what that would be useful for) and a generic "next stop is full" interrupt trigger as well, which does not skip the next stop, just inserts the temporary stop before it the same way "(specified) station is full" does.
Wholeheartedly agree. I think either of these basically fixes this issue.
GlitchCloud
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Oct 31, 2024 9:48 pm
Contact:

Re: Train interrupt "Destination full or no path" question

Post by GlitchCloud »

ferris.443 wrote: Sat Nov 02, 2024 11:03 pm The issue I have with this work around is, I expect under normal condition (interrupt not triggered) the train would load and unload, then proceed to another or the same unload station again without any cargo before proceeding to the load station.
I have not noticed this behavior yet, but it could be also because all my trains get buffered in a "Waiting Room"
gigahurts
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Nov 07, 2024 1:22 am
Contact:

Re: Train interrupt "Destination full or no path" question

Post by gigahurts »

They fixed this! 115988
User avatar
PssX
Burner Inserter
Burner Inserter
Posts: 17
Joined: Tue Mar 01, 2016 9:00 am
Contact:

Re: Train interrupt "Destination full or no path" question

Post by PssX »

gigahurts wrote: Wed Nov 20, 2024 12:33 am They fixed this! 115988
Yes, and immediately somebody complains that they relied on the behavior that got fixed. :P
Post Reply

Return to “Gameplay Help”