Page 1 of 1

Train not moving

Posted: Thu Dec 03, 2020 3:17 pm
by Zarylo
Situation:
  • In this specific scenario the magenta train refuses to move to the magenta station on the right. Even though the blocks are free and the station enabled.
  • The cyan train isn't moving to the cyan station to the right because it is disabled.
Observations:
  • the magenta train attempts to path through blue.
  • Setting the cyan train to "manual" (effectively disabling it) causes the magenta train to drive straight ahead to the magenta station as scheduled.
  • magenta train's behavior is not influenced by whether cyan train has a waiting condition or not (nor what it would resolve to if it did)
Conclusion:
the magenta train prefers the path through the left cyan station over the path straight ahead with two black stations. However it completely Ignores the cyan train in it's pathing calculation if it isn't set to manual.

Issue:
It is intended that magenta train prefers a path it believes to be reasonable. (Though what is reasonable is debatable.)
It surely can't be intended that magenta train ignores a free path over a blocked one though.

Reproducibility:
The attached zip file contains the engineered scenario in the picture.
This appears in 1.1, 1.0 and I've seen it in older versions too.

Re: Train not moving

Posted: Thu Dec 03, 2020 4:27 pm
by mmmPI
https://wiki.factorio.com/Railway/Train_path_finding


Those are the rules that define which path is prefered.

From what i see on your picture i would tend to think that the cyan train cause a penalty to the path, but not a big one. Unless you manually set it to manual mode, in this case the penalty become 7000 and the magenta train prefers the other path.

It's hard to tell from the picture if the magenta train repath to the wrong path regularlly and thus don't move. Or if it has choosen its path once in an infortunate moment and then stick with it due no no repathing event.

Hopefully it helps you find solutions :).

Re: Train not moving

Posted: Thu Dec 03, 2020 6:23 pm
by orzelek
There is a general rule that helps in cases like this:
Ensure that your main ralis have no stations on them. Placed station is counted as quite a big penalty for trains and it will cause strange behaviour like the one observed here.

(Just add one more rail going above the station = train will be happy to use it)

Re: Train not moving

Posted: Thu Dec 03, 2020 6:32 pm
by Zarylo
mmmPI wrote: Thu Dec 03, 2020 4:27 pm https://wiki.factorio.com/Railway/Train_path_finding


Those are the rules that define which path is preferred.

From what i see on your picture i would tend to think that the cyan train cause a penalty to the path, but not a big one. Unless you manually set it to manual mode, in this case the penalty become 7000 and the magenta train prefers the other path.

It's hard to tell from the picture if the magenta train repath to the wrong path regularly and thus don't move. Or if it has chosen its path once in an unfortunate moment and then stick with it due no no repathing event.

Hopefully it helps you find solutions :).
Thanks for replying :)

As long as I can't remove the 4k penalty from the straight track then unfortunately not D:.
The magenta train is pathing down to cyan. I don't know what track you refer to when you say "wrong path". Repathing would solve the issue if the wait time of the cyan train was respected on the other hand.

Re: Train not moving

Posted: Thu Dec 03, 2020 6:46 pm
by Zarylo
orzelek wrote: Thu Dec 03, 2020 6:23 pm There is a general rule that helps in cases like this:
Ensure that your main rails have no stations on them. Placed station is counted as quite a big penalty for trains and it will cause strange behavior like the one observed here.

(Just add one more rail going above the station = train will be happy to use it)
So it's a known ... feature ... then :oops:
If the behavior is intended then I have to scrap my entire refueling scheme.
know any mods that allow removing penalty from tracks or stations?
Thanks for replying

Re: Train not moving

Posted: Thu Dec 03, 2020 10:15 pm
by mergele
The bandaid solution would be to add another 2 dummy stations to the lower track. If the penealty is everywhere it is nowhere.

Re: Train not moving

Posted: Fri Dec 04, 2020 8:54 am
by mmmPI
Zarylo wrote: Thu Dec 03, 2020 6:32 pm The magenta train is pathing down to cyan. I don't know what track you refer to when you say "wrong path". Repathing would solve the issue if the wait time of the cyan train was respected on the other hand.
There is a debug menu you can access from F4, it's a box to tick to make visible when a train repath. It shows a little "repath" text floating above the train for a few second.

I think the magenta train repath regularly toward the "wrong path" meaning it update its path regularly, and always picks the one that is occupied, the bottom long one.

the rules that applies i think are either:

The train has waited at a chain signal for a multiple of 5 seconds and there are multiple train stops with the same name as the destination.
The train has waited at a chain signal for a multiple of 30 seconds and there is only a single train stop with the same name as the destination.

So every 5 or 30 second (i think) there could be this little text floating above the train. meaning the magenta train choosed again the blocked path.
But i'm not sure the train is considered as "waiting at chain signal" or "departing the station". ( i didn't load the scenario :oops: )

I think the cyan train count as a penalty of 1000, either from :

When the path includes a train stop with a train stopped in it that doesn't have other valid stops in its schedule -> Add a penalty of 1000.
When the path includes a train that doesn't have a path -> Add a penalty of 1000.

Then you have 1 train stop, costing 2000 :

When the path includes a train stop that is not the destination -> Add a penalty of 2000.

There is no incrementing penalty for the cyan train ( i think), so the penalty for the "wrong path" is 3000. The penalty for the other path may be 4000 due to 2 stations.

as mergele said, placing another dummy station or 2 on the lower track would re-balance the penalties. It could be a solution :)

Re: Train not moving

Posted: Tue Dec 15, 2020 3:13 am
by Squelch
Disabled stations still appear to have a penalty of 2000 each where they are not destinations. That gives the top branch a total penalty of 4000 compared to 3000 of the lower branch with the single enabled stop with a train in auto but without a valid destination (CyanEnd is disabled)

The lower path will always be the preferred route regardless of the status of the black stops in this scenario. The only situation where the upper branch will be chosen is if the Cyan train is in manual mode without a passenger.

It does seem counterintuitive that disabled stops still have such a high penalty. Is this intentional? Should there be an entry in the penalty wiki to clarify disabled stops?