[2.0.41] Train priority overrides enable/disable and train limit 0

Bugs that are actually features.
vrcngtrx
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Mar 14, 2025 1:26 pm
Contact:

[2.0.41] Train priority overrides enable/disable and train limit 0

Post by vrcngtrx »

In the video I have a double-headed train with a schedule in which it stops at an "Enter" station, is unloaded until the chests at the station are full, and then it leaves by going to the "Exit" station with no wait condition. Each "Enter" station is disabled via a circuit once the chests are full and are not renabled until they are empty. The schedule also has an interrupt to wait at the "Depot" station in case every "Enter" station is full.

If every "Enter" station has the same priority, then this works almost as expected. There is some weird behavior in which the train goes back to visit the same stop twice before going to the depot in the case where all the "Enter" stations are disabled, but this is only a minor part of the issue. The real issue is when one of the "Enter" stations has a higher priority than the others. In this case, the train will visit this stop when it is enabled, and then continually circle back to it, even when it is disabled by the circuit.

I would expect that if a station is disabled, then it is impossible for a train to choose it as a destination. Hence whenever all the stations are disabled, it should be forced to go to the depot station.

I don't think there is any chance that the circuit is enabling the stop for 1 tick or something like this, at least assuming it is working correctly in-game. Perhaps I made my schedule poorly, but I still don't see why this behavior should arise. This seems to be a problem with the way the train is choosing which "Enter" station it wants to visit.

Below I am attaching a dropbox link to a video showing the behavior. It is very consistently reproducible. I am also including the save file this was recorded on. The save file is using the mods Editor Extensions v2.4.2 and Factorio Library v0.16.2 for demonstration purposes, but this happens without these mods as well.

EDIT: I forgot to add the log file.

https://www.dropbox.com/scl/fi/mu46xjyj ... kxd89&dl=0
Attachments
factorio-current.log
(6.83 KiB) Downloaded 12 times
Bug.zip
(2.72 MiB) Downloaded 10 times
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3754
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.41] Train priority overrides enable/disable and train limit 0

Post by boskid »

Thanks for the report however i am going to classify this as Not a bug. Thats a consequence of multiple features and train priorities are not a required part of this observed behavior. Setting higher train stop priority makes this behavior more visible by making other "Enter" train stops to have far greater pathfinder cost so the pathfinder prefers going to the top "Enter" train stop. If the vertical rail section between upper "enter" branch and other branches would be longer then a pathfinder starting from the top train stop would find going back to the top train stop have lower pathfinder cost regardless of priorities and the behavior would still happen. Problem in your setup is that you are using Exit waypoints which the train reaches while still being in the Enter train stop block. There is a feature to prevent rail stackers from being overfilled, which makes the train keep reservation of the departing train stop until the train leaves the rail block next to departing train stop or until the train reaches its destination. In this case the train reaches a waypoint while still holding a reservation for the Enter train stop and so it is allowed to repath back to that train stop. Disabled train stop simply means no new reservations can be created but in this case there are no new reservations created, train keeps reusing the same reservation it already had. In theory i could make train not reuse its own reservation of a train stop but last time i tried doing anything with this was causing problems with trains nopathing in the middle of rail network because train was unable to reuse some reservations it already had and a fixed state was in general worse than non fixed one.
Post Reply

Return to “Not a bug”