Why does train return to disabled station?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
half a cat
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Sun Jul 16, 2023 4:03 pm
Contact:

Why does train return to disabled station?

Post by half a cat »

I have a problem where a train keeps leaving and returning to the same station, even though that station is disabled. Can someone explain what is happening?

This train carries the Ultracube mod's special cube to any available station named "Use". Station availability is controlled by setting train limit to 0 or 1 in circuit conditions. The train's schedule has two stops, "Use" and "Depart"; the reason for "Depart" is to make the train leave its current station and then find a new path to "Use". Every "Use" station has an adjacent "Depart" station.

The train keeps leaving and returning to this station, even though its train limit is set to zero. You can see the "Use" and "Depart" stations.
station1.jpg
station1.jpg (636.87 KiB) Viewed 410 times
The train never arrives at this station:
station2.jpg
station2.jpg (149.82 KiB) Viewed 410 times
If, while the train is between stations, I set it to manual and then set it back to automatic, then it will go to the other station.

Why does it work this way? My guess is that because the train is still occupying the "Use" station when it arrives at "Depart", the game ignores the train limit on "Use" and chooses the closest station as the destination.
half a cat
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Sun Jul 16, 2023 4:03 pm
Contact:

Re: Why does train return to disabled station?

Post by half a cat »

The attached save has the train setup that I described, and you can see it always returning to the same station.
Attachments
train-routing-bug.zip
(1.63 MiB) Downloaded 20 times
Loewchen
Global Moderator
Global Moderator
Posts: 10993
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Why does train return to disabled station?

Post by Loewchen »

The train is considered at the stop until it leaves the rail block, the next stop is inside the rail block so it never leaves the first station, does not clear the stop reservation and can path back to it.
Nidan
Filter Inserter
Filter Inserter
Posts: 385
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Why does train return to disabled station?

Post by Nidan »

The train is considered at the stop until it leaves the rail block
or stops at another train stop, but passing a waypoint isn't stopping.
You can either
- put the stations far enough apart that the train has left the "Drop" station's block by the time the breaking point reaches the "Depart" station,
- stop at the "Depart" station (even an always true wait condition is fine, but there has to be a wait condition),
- ensure that the train cannot reach the "Drop" station from its corresponding "Depart" station, or
- make two (identical) schedule entries for the "Drop" station and get rid of the "Depart" stations.
Post Reply

Return to “Gameplay Help”