[15.37] Train doesn't find path after swapping active/inactive station

This subforum contains all the issues which we already resolved.
Post Reply
basementjack
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sun Sep 25, 2016 11:31 pm
Contact:

[15.37] Train doesn't find path after swapping active/inactive station

Post by basementjack »

For a simple reproducible setup see to the end of the topic.

Hi there,
I've got an issue with trains displaying no-path, but it's not caused by the usual suspects:

NOT caused by:
  • Improper signal placement
  • Missing tracks
  • Two directional trains missing an engine on each end.
RELATED TO/Caused by:
  • Logic that disables a station if the ore count drops below 2000

THE SETUP:
Image
  • I have multiple ore mines.
  • The station at each mine is named the same "COPPER ORE S-D"
  • Green wires connect the feeder chests to the station so the station can read the contents of the feeder chests.
    (Stations are not connected to each other via green wires)
  • When Feeder chest inventory < 2000 station shuts off (Yello lights on station change to red)
Image

THE PROBLEM:
Occasionally a train gets stuck with "No path"
Image

Note the x next to the station name in the engine info panel below. If I click the -> arrow, the train resumes and goes forward just fine.
Image

However, if I don't catch one of these, the trains all backup and my factory comes to a halt:
Image

Is this a bug, is there a way around this?

- Jack

PS:
The In Game problem I'm attempting to solve:
Small mines run out of inventory quickly and can't restock fast enough.
Yet trains keep lining up, often when another, farther away station has plenty of inventory.
So they sit waiting in line at a station that can't keep up.
The logic circuit (Shown above) disables the station when inventory gets too low to completely fill a car with ore.
Problem (almost) solved! Trains avoid closed stations, and since there are multiple stations with the same name, trains will route to one that has enough ore to fill it quickly, even if it's farther away!
Except for these engines getting stuck with 'no path' as described above...
Feels like either a bug or some aspect of how the game works that I don't understand yet.

Loewchen
Global Moderator
Global Moderator
Posts: 8285
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Complex Train 'No path' problem/bug?

Post by Loewchen »

Post the save please.

basementjack
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sun Sep 25, 2016 11:31 pm
Contact:

Re: Complex Train 'No path' problem/bug?

Post by basementjack »

@Loewchen -

Good news: I may have found a workaround.
Bad news: My save game no longer breaks, but I suspect we can recreate this if
this is considered a bug and is needed for testing.
Good news: I did some more testing/observation before I tried the workaround and have a theory of what's happening.

EXPLANATION:

A combination of signal placement on tracks, density of trains and timing caused the "NO PATH" Lockout to occur

SEQUENCE OF EVENTS TO CAUSE LOCKOUT:
  • Signal just past station.
  • Next signal is many many tiles north.
  • First train enters station, starts to fill
  • Next train approaches, is immediately behind first train which is still in station.
  • Inventory drops below 2000 while filling first train, Train station deactivates
  • First train pulls away, clearing the Signal just past station.
  • Second train passes station, Stops at Signal, but train does not "clear" disabled station.
  • No Path appears and train gives up. (Potential bug here)
Resolution:
  • Ensure that a train in need of repathing due to a disabled station can "clear" that station
  • Remove the signal just a few tiles north of the station.
  • Place new signal one train length north of station.
  • add other signals along the northbound track, so that a 3rd train behind the second doesn't get caught by the "No Path" behavior
Original signal placement (RIGHT AFTER STATION):
Image

Birds eye view of track and nearby signals (NOTE THERE IS NO OTHER SIGNAL FOR A FAIR DISTANCE AFTER THE STATION):
Image


Working placement of signals:
Image

Now the big question:
Is this a bug, or is this expected behavior?
If it's a bug, I'll try to recreate it in a sandbox and post a save game.

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Complex Train 'No path' problem/bug?

Post by Zavian »

Edit: Had a better read of your post. Now I'm less sure you were hitting the issue I expected. My comments still apply to the normal case of disabling stops leaving trains with no path, so I'll leave them in a spoiler below.
Your theory pretty much matches my guess of what was happening. In my opinion that is a case of "don't do that". If you want to disable train stations whilst a train is en route then you need to ensure that your rail layout always makes sure a train has a route to it's next stop (and you need to ensure that you don't disable all stations on a trains route either). You could add loops to your train system so that a train can always get to it's next stop. Alternatively you can simply limit each circuit controlled station to one train only, that way the station will only be disabled when that train is actually in the station loading/unloading. Or you could use the circuit network to devise a more complex control scheme.

basementjack
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sun Sep 25, 2016 11:31 pm
Contact:

Re: Complex Train 'No path' problem/bug?

Post by basementjack »

@Zavian

Thanks, I am sort of on the fence here between "was I doing it wrong" or "Is this an actual product bug"

There are a few interesting things here:
  • The train thats loading at the station when the station disables is fine.
  • All the trains stuck behind the "no path" train are fine, and don't display "no path"
  • It is only the train that gets stuck at the red light, which happens to overlap the disabled station that gets the no path message.
  • The "no path" train never attempts to recalculate the path on it's own.
  • Clicking the -> button clears the "no path"
An interesting test would be to park a train in the signal block ahead and then click -> on the no path train to see if the condition recycles.

Another interesting test would be to park a train in the block ahead, then delete the 'no path' train below and see if the next train in line also gets stuck with a no-path when it straddles the station.

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Complex Train 'No path' problem/bug?

Post by Zavian »

Uploading the save would probably make it easier for other people to have a look, and work out what they think is actually happening.

aaargha
Filter Inserter
Filter Inserter
Posts: 329
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: Complex Train 'No path' problem/bug?

Post by aaargha »

OK, so I managed to reproduce this behaviour in a much smaller setup, it seems there is something strange going on with trains trying to path to a train stop they have just slightly passed when disabling stations. I'm not really sure it is the exact same situation you have but it seems close at least.

How to reproduced in the attached save, use combinators to turn stations on or off:
1. turn the left station off
2. set train to auto
3. turn left station on
4. turn right station off
The train should now be in no path mode, it tries to path to the train stop it is sitting on but can't.
If you at this point turn the right station on and off again the train will manage to find the circular path.

This feels, to me at least, like it is not intended.
Attachments
Find path bug.zip
(2.08 MiB) Downloaded 56 times

Loewchen
Global Moderator
Global Moderator
Posts: 8285
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Complex Train 'No path' problem/bug?

Post by Loewchen »

I'll move this to bugs.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [15.37] Train doesn't find path after swapping active/inactive station

Post by kovarex »

I believe that this should be fixed for 0.16

Post Reply

Return to “Resolved Problems and Bugs”