[boskid][1.1.48] Trains don't stop accurately enough at train stops

This subforum contains all the issues which we already resolved.
mrvn
Smart Inserter
Smart Inserter
Posts: 5855
Joined: Mon Sep 05, 2016 9:10 am
Contact:

[boskid][1.1.48] Trains don't stop accurately enough at train stops

Post by mrvn »

A train with the same station name in the schedule will drive to another station with the same name as it's standing at. For this it should choose the closest station. Consider a game with dual headed stations like this:
screenshot.png
screenshot.png (4.22 MiB) Viewed 3305 times
All stops have the same name and the trains schedules have the station twice with 5s inactivity.

When the train is placed at a train stop and set to automatic it will switch between the 2 train stops of the station and not move at all. But if the train is send away from the station with a temporary stop then when it returns it doesn't seem to stop at the right position to go back to becoming unmoving. Instead it will leave the train station and return over and over.

This also applies to rail targets, not just stops.
Attachments
train-position-rounding-error.zip
(2.72 MiB) Downloaded 160 times
User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: [1.1.48] Trains don't stop accurately enough at train stops

Post by ptx0 »

the problem is that you cannot have only the same two stations in the train schedule be a stop with the same name. the behaviour you describe will occur. i had the same problem when trying to unload an extremely long oil train with train stops named "Oil" "Oil" "Oil". I couldn't use inactivity condition, I had to use cargo condition and each stop with the same name had a very distinct reason it would leave, e.g. "Oil > 100k", "Oil > 200k", etc.
mrvn
Smart Inserter
Smart Inserter
Posts: 5855
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [1.1.48] Trains don't stop accurately enough at train stops

Post by mrvn »

I think you misunderstood the problem. The trains leave each station and go to another station once the scheduled condition is met (5s inactivity here). What condition is used really doesn't matter. You can have more stations in the schedule besides the two with the same name and that also doesn't matter. It's the choice of stop they drive to for the repeated station that is the problem.

A train freshly placed and snapped to a stop should behave the same way as a train arriving and stopped at a train stop. The behavior when freshly placed is the desired and expected one. In a dual headed station like in the save with the station name repeated the train should always visit both stops of the dual headed station.

Here is another example of trains behaving differently:
screenshot.png
screenshot.png (4.25 MiB) Viewed 3207 times
The top most station is named differently and both trains have the same schedule: Tim I Hely, Tim I Hely, kimnet. One will visit the two stops in the double headed stations while the other goes to one of the bottom most stations.

I suspect the train position of the two trains differs slightly and they stop at slightly different positions. One is within the margin where the opposite stop is reachable and the other is not. Maybe it would be enough to reset the trains position to be exactly at the stop every time a train stops at a train stop to get a consistent behavior.
Attachments
train-position-rounding-error-2.zip
(2.7 MiB) Downloaded 151 times
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2983
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][1.1.48] Trains don't stop accurately enough at train stops

Post by boskid »

Thanks for the report. Issue is now fixed for 1.1.51. It was related to incorrect check that would reject a path from the Back end of a train when last joint was already on the rail next to the train stop within acceptable margin of 0.05. Condition was correct for the Front end of a train.
Post Reply

Return to “Resolved Problems and Bugs”