[0.16.51] Train stops slightly in front of station under certain conditions

Things that we don't consider worth fixing at this moment.
User avatar
Seaish
Inserter
Inserter
Posts: 27
Joined: Fri Aug 25, 2017 9:40 pm
Contact:

[0.16.51] Train stops slightly in front of station under certain conditions

Post by Seaish »

I tried searching for this, but I'm not sure what to call it so it might already be reported.

Image

When a train has a two-stop schedule, or a schedule where all but two stops are disabled, and the second stop is disabled about half a second after the train leaves the first station (depending on acceleration and braking force), the train will stop up to two blocks ahead of the station. This causes two problems: the rear inserter for each car will now be aligned with the car behind the intended car, and fluid pumps will no longer connect. Either of these issues can cause problems depending on your specific train setup.

This happens very infrequently in my actual games, and will cause the first wagon of a train to fill up with fuel. Since it's waiting for empty cargo, it'll get stuck and never leave the station.

I'm on the fence whether to consider this a bug or not. It definitely seems purposefully coded such that the train is able to stop at any place within the two blocks of the station, and is easily fixed with changes to layout or circuit conditions, but it breaks some gameplay assumptions of what trains on automatic will do.

In the attached save, I have set it up so that the train will get stuck every time.

If this functionality is actually intended, I would like to know why. And if this is unintended and isn't going to be changed, I'd be fine with that since it really isn't that big of a problem.
Attachments
Train stop bug.zip
(16.9 MiB) Downloaded 108 times
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: [0.16.51] Train stops slightly in front of station under certain conditions

Post by disentius »

I would assume the train stops because the pathfinder can't find a valid path anymore, since you disabled the train's only destination. So the train stops the moment it tries to recalculate the path.
You can find when and how the path recalculates here. https://wiki.factorio.com/Railway/Train_path_finding
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2409
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: [0.16.51] Train stops slightly in front of station under certain conditions

Post by Jap2.0 »

disentius wrote: Sun Oct 14, 2018 12:47 pm I would assume the train stops because the pathfinder can't find a valid path anymore, since you disabled the train's only destination. So the train stops the moment it tries to recalculate the path.
You can find when and how the path recalculates here. https://wiki.factorio.com/Railway/Train_path_finding
I would think so as well, but I also thought that in automatic mode cargo would only load/unload while at a station.
There are 10 types of people: those who get this joke and those who don't.
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: [0.16.51] Train stops slightly in front of station under certain conditions

Post by disentius »

Well... You got one:)
Played around with your save, and this behavior only happens if i put the rail signal directly behind staion 1.
User avatar
Seaish
Inserter
Inserter
Posts: 27
Joined: Fri Aug 25, 2017 9:40 pm
Contact:

Re: [0.16.51] Train stops slightly in front of station under certain conditions

Post by Seaish »

disentius wrote: Sun Oct 14, 2018 12:47 pm I would assume the train stops because the pathfinder can't find a valid path anymore, since you disabled the train's only destination.
The train in the example always has its first stop enabled. Only the second stop is disabled.

It stops there because it considers this position as a valid position for this station, which is a problem because it breaks expectations. Under all other circumstances, the train would go all the way around and line up with the stop correctly. As far as I know, this is the only way for a train to stop in such a location (with cargo open) with automatic mode enabled. It would seem to almost all players that train stations are a single point on the rail, but this shows that the station is actually two squares long.

Plus, if it couldn't find a path, it would say "no path" and wouldn't open for cargo, as the last guy said. It's just on a simple loop.
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: [0.16.51] Train stops slightly in front of station under certain conditions

Post by disentius »

trainstop extends after the station pole, between the signal and the pole, leading to weird behavior.
Made another save to showcase this.
I disable stop2 on a yellow from the first signal after stop1.
Breakdancing train.
train stuc at station after leaving.gif
train stuc at station after leaving.gif (4.41 MiB) Viewed 3583 times




EDIT:
Stop exists on the whole rail segment where the station is attached.
Attachments
Train stop bug2.zip
(2.21 MiB) Downloaded 118 times
User avatar
Seaish
Inserter
Inserter
Posts: 27
Joined: Fri Aug 25, 2017 9:40 pm
Contact:

Re: [0.16.51] Train stops slightly in front of station under certain conditions

Post by Seaish »

Okay, so I was looking at old stuff from well-known Factorian arrow in my gluteus, and found this video which takes advantage of this behavior:

Grid station for ethereal trains
Circuit details

Basically, with certain circuit work, it allows trains to stop at any point on straight rail with more flexibility than exploiting no-path situations, which is useful for a small number of use cases like this one.

This specific case isn't too good since you can't have signals/more than one train per line, but there could be others.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14601
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] Train stops slightly in front of station under certain conditions

Post by Rseding91 »

Thanks for the report. I'm not sure if there's anything here worth working on. The entire rail that the train stop sits on is a valid location for a train to be stopped at. In the scenario you've described - disabling stations - you force strange things to happen with the train and get strange results.

At the moment the best I can say is: don't do that if you don't want it to happen.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Won't fix.”