[1.1.18] Disabling a train station mid pathing can lead to trains instant stopping with train limits

Bugs that are actually features.
Post Reply
AlmightyJu
Burner Inserter
Burner Inserter
Posts: 16
Joined: Wed Dec 13, 2017 9:54 pm
Contact:

[1.1.18] Disabling a train station mid pathing can lead to trains instant stopping with train limits

Post by AlmightyJu »

I'm not sure of the best way to describe this but I have a save and some videos of the problem.

If you have 1 train station called A with a limit set to 2 trains and have 2 trains travelling to station A and then disable the station both trains correctly treat that station as a waypoint and simply path through it and carry on.

If you have 2 stations called A both with a limit set to 1 and have a train travelling to both stations and disable one of those stations one of the trains will instant stop with "destination full", this should act the same as the previous scenario where the train treats the disabled station as a waypoint, or the train should path onto the next stop in the schedule.

In this video toggling the top stations enabled state has no effect on the train
correct waypoint.mp4
(9.09 MiB) Downloaded 25 times
But in this video with both top stations named the same if you disabled the station while the train is travelling it abruptly stops and will only go once the station is enabled or the other station becomes free.
destination full.mp4
(6.88 MiB) Downloaded 25 times
Save file of the problem
Bug.zip
(989.02 KiB) Downloaded 21 times

AlmightyJu
Burner Inserter
Burner Inserter
Posts: 16
Joined: Wed Dec 13, 2017 9:54 pm
Contact:

Re: [1.1.18] Disabling a train station mid pathing can lead to trains instant stopping with train limits

Post by AlmightyJu »

I must have searched wrong the first time, I just found this post which seems to be a duplicate of viewtopic.php?f=23&t=94033 which lead me to thinking of how to get around the problem where the train just stops.

Instead of toggling enable/disable if you simply set the train limit to 0 the train will continue to path to the station and will stop at that station.

While I understand from a technical view of the decision for this behaviour I think the trains should act the same regardless of having a single station or multiple stations with the same name since it's very confusing when trying to work out why only some of my stations keep causing trains to stop on the way there using the same logic as all of my other stations (enable if chest item count > amount train can hold)

mmmPI
Filter Inserter
Filter Inserter
Posts: 638
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: [1.1.18] Disabling a train station mid pathing can lead to trains instant stopping with train limits

Post by mmmPI »

AlmightyJu wrote: ↑
Fri Jan 08, 2021 1:57 am
If you have 2 stations called A both with a limit set to 1 and have a train travelling to both stations and disable one of those stations one of the trains will instant stop with "destination full", this should act the same as the previous scenario where the train treats the disabled station as a waypoint, or the train should path onto the next stop in the schedule.
This behavior is desirable because as you mentionned it offers 2 possibility. Having train "skip" a station (by disabling it). Having train not "skipping" (by reducing limit to 0).

AlmightyJu wrote: ↑
Fri Jan 08, 2021 2:15 am
While I understand from a technical view of the decision for this behaviour I think the trains should act the same regardless of having a single station or multiple stations with the same name since it's very confusing when trying to work out why only some of my stations keep causing trains to stop on the way there using the same logic as all of my other stations (enable if chest item count > amount train can hold)
In a way they already have the same behavior. If a train does A B C A B C schedule. Closing all station A ( or the only station A) will cause train to do B C B C. If that is not what you want but you'd rather have train wait at C for a station A to open, then you reduce incoming train to station A to 0 ( wether there is 1 or several "station A" doesn't change). Train would then wait at C with "destination full" message.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 1563
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.18] Disabling a train station mid pathing can lead to trains instant stopping with train limits

Post by boskid »

I see nothing wrong. You disabled train stop while the train was on route and it has nowhere to go to so it stopped. It works as designed.

AlmightyJu
Burner Inserter
Burner Inserter
Posts: 16
Joined: Wed Dec 13, 2017 9:54 pm
Contact:

Re: [1.1.18] Disabling a train station mid pathing can lead to trains instant stopping with train limits

Post by AlmightyJu »

boskid wrote: ↑
Fri Jan 08, 2021 6:09 am
I see nothing wrong. You disabled train stop while the train was on route and it has nowhere to go to so it stopped. It works as designed.
The thing that is wrong is that a train can keep the same schedule and a station can use the logic of enable/disable and the behaviour of that train can be changed by simply adding a second station with the same name. I understand it is by design but it is counter intuitive and isn't mentioned anywhere so is very difficult to see why my trains suddenly started to stop mid pathing and I cannot imagine anybody thinking its because they have 2 stations with the same name without some in depth testing as disabling a station causes 2 different effects depending on the amount of stations with that name. It's a bad user experience from my view (who wants a train to come to an instant stop by design anyhow :P).
mmmPI wrote: ↑
Fri Jan 08, 2021 6:04 am
In a way they already have the same behavior. If a train does A B C A B C schedule. Closing all station A ( or the only station A) will cause train to do B C B C. If that is not what you want but you'd rather have train wait at C for a station A to open, then you reduce incoming train to station A to 0 ( wether there is 1 or several "station A" doesn't change). Train would then wait at C with "destination full" message.
You've missed that there are 3 scenarios here (assume all stations have a train limit)

1. Single station A, single station B. Disable station B and the train waypoints via B
2. Single station A, multiple station B. Disable 1 station B and the train dead stops with destination full
3. Single station A, any amount of station B. Set station B train limit to 0 and trains currently on the way will stop at the station

The only different between scenario 1 and 2 is the amount of stations called B, in scenario 2 you cannot get a train to treat station B as a waypoint if you use enable/disable conditions on each station, you have to treat all of station B's as a single station for enable/disable which isn't clearly shown and feels very counter intuitive.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 1563
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.18] Disabling a train station mid pathing can lead to trains instant stopping with train limits

Post by boskid »

AlmightyJu wrote: ↑
Fri Jan 08, 2021 2:08 pm
The thing that is wrong is that a train can keep the same schedule and a station can use the logic of enable/disable and the behaviour of that train can be changed by simply adding a second station with the same name.
No, everything here is fine. If you have 2 train stops and one is disabled, the train has to go to the other one because there are still some enabled stops. If you have only one train stop and it is disabled, the train has nowhere to go. I do not know what were exact reasons related to disabling train stops but in this case the train will skip the schedule record and go to the next station in its schedule.

When trains are using limits they are able to repath to already full train stop by means of reservations and there was a lot of effort to make it reliable. Best way is to not disable train stop if it has trains inbound (trains count > 0). When a regular repath occurs the train is able to repath to enabled but full train stop, however if the train stop is disabled it is a forced "go away" and the train may get stuck. Both ways of trains control have their own use cases but mixing them causes the observed behavior.

AlmightyJu
Burner Inserter
Burner Inserter
Posts: 16
Joined: Wed Dec 13, 2017 9:54 pm
Contact:

Re: [1.1.18] Disabling a train station mid pathing can lead to trains instant stopping with train limits

Post by AlmightyJu »

I have to respectfully disagree with it being the best way to handle this, granted it's just my opinion and I've worked around the problem by changing the train limit instead so it's no biggie it just doesn't make logical sense for the behaviour to me. I understand wanting to reserve another stop and that makes total sense, but the decision to just stop when there are no other available stops due to them being disabled feels very wrong.

In my scenario I have on site smelting, each stop is called "Provide Iron Plate" and they are enabled when there is enough for a train and a half to fill up and a train limit of 2, the idea being enough to fill 1 train and by the time the second train gets there it will be enough for them both. As the ore patches dry up a second train would be on the way and the stop would get disabled as production is slow causing the second train to stop and back the line up.

In this case disabling all "Provide iron plate" stations is illogical and using the train limit works but it took a lot of experimenting in the editor to find out why my trains were on the main line with "destination full" when this behaviour hadn't been noticed at all in my early game using the same logic on my stops.

If I only disabled the station if inbound train count < 0 then I would end up with it not ever being disabled since I always have trains waiting to go pickup my plates and as soon as the first train leaves the station another would be on its way; it would act exactly the same as simply never disabling the station.
boskid wrote: ↑
Fri Jan 08, 2021 2:26 pm
If you have only one train stop and it is disabled, the train has nowhere to go.
And it treats the stop as a waypoint and doesn't just stop on the mainline.
boskid wrote: ↑
Fri Jan 08, 2021 2:26 pm
If you have 2 train stops and one is disabled, the train has to go to the other one because there are still some enabled stops.
If the other stops are full the train has nowhere to go.

Both situations can end up with "the train has nowhere to go", but one leads to the train getting on with its journey and the other is the train just halting where it is, from an end user point of view this is confusing. I cannot explain how long I was looking at my backed up line thinking "why are you here if the destination is full" because there is nothing to say that disabling a stop can have this edge case situation occur and disabling a stop has only caused a waypoint effect previously.

Post Reply

Return to β€œNot a bug”