Train always takes the wrong path

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
kvl
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Apr 15, 2018 4:07 pm
Contact:

Train always takes the wrong path

Post by kvl »

Hello,

at first I want to apologize for my - hopefully not so bad - english.
My server version is 0.16.36 (headless).
My client version is 0.16.36.36253

Question 1: Can I name ALL my pick-up stations with the same name?
Nobody can give me a specific answer. And I don't know what to look for.

Question 2: I have all my pick-up stations named "ABHOLEN" (german for pick-up).
All my stations in my base are named "BAHNHOF" (german for station).
I want to pick-up iron-/copper ore at "ABHOLEN" and want to bring it to a free "BAHNHOF".

Now to my problem:
When a train leaves "BAHNHOF", it gets stuck in front of the next occupied station "ABHOLEN", instead of continuing to the next station on the alternative route (runs parallel).
trains.PNG
trains.PNG (182.7 KiB) Viewed 3274 times
train1.PNG
train1.PNG (1.97 MiB) Viewed 3274 times
How can I tell the train to ignore the occupied station and continue to the next free station?
Maybe somebody has a link for a functioning evasion station.

Thank you in advance!

KVL

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

Re: Train always takes the wrong path

Post by Loewchen »

This setup will simply not work, identical station names can be used to direct the train to the next free one only if they have roughly the same distance to the train, otherwise the train will choose to rather wait at an occupied one than travel to one further away.

kvl
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Apr 15, 2018 4:07 pm
Contact:

Re: Train always takes the wrong path

Post by kvl »

Hi,

thank you for your answer!

So the answer to my question 1 is "no".
Question two is therefor obsolete. (hope this sentence makes sense :D)

How can I make the train head for a free station?
Or do I have to drive certain trains to certain stations?

Thank you in advance!

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

Re: Train always takes the wrong path

Post by Loewchen »

The easiest options would be to either have one train per pick up station or at least divide the stations among trains, like:
  • Abholen 1
  • Bahnhof
  • Abholen 2
  • Bahnhof
and the next train starts with
  • Abholen 3
  • ...
Since your pick up stations even provide different resources, relying on chance for which station is served is not an option.

kvl
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Apr 15, 2018 4:07 pm
Contact:

Re: Train always takes the wrong path

Post by kvl »

Okay, I chosse option 1!

" have one train per pick up station "

Thank you!

bobucles
Smart Inserter
Smart Inserter
Posts: 1669
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Train always takes the wrong path

Post by bobucles »

This setup will simply not work, identical station names can be used to direct the train to the next free one only if they have roughly the same distance to the train, otherwise the train will choose to rather wait at an occupied one than travel to one further away.
To clarify:
A train has to be stalled for some length of time (30 seconds?) before it decides to look for a free station. It will first try the closest station, stall because it's occupied, wait, and then try again for the long distance station.

Setting up the trains to split themselves between multiple stations is a bit tricky but not impossible. Make sure your bypasses are clear and that trains wait at a position BEFORE they have to commit to a path of no return.

Placing same name stations a large distance apart can pose problems because the pathing engine doesn't flat out give up on an occupied station. It simply looks for the "closest" station possible and an occupied station is considered 1000 tiles or so in terms of distance. The only way to give up on a station is to turn it off.
Last edited by bobucles on Sun Apr 15, 2018 6:45 pm, edited 2 times in total.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Train always takes the wrong path

Post by orzelek »

I'm not sure but you could try to use simple circuit to disable occupied station.
Disabled station will not be counted by other trains and they should repath to different one.
It might have different drawbacks since trains can then repath in any moment which might have strange side effects on roundabouts.

quyxkh
Smart Inserter
Smart Inserter
Posts: 1027
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Train always takes the wrong path

Post by quyxkh »

Trains path on departure, and when their current destination stop is disabled, and (I'm sure this next is at least roughly right, if anybody's done science on this more recently than me and can improve this please chime in) when they're stopping at a chain signal and at five second intervals while still stopped at one, but other than that they just run the route they've chosen.
How can I make the train head for a free station?
Trains always route to the nearest free train stop with the right name, considering penalties, but: there's no coordination among trains, no central office staff keeping them all from piling up at a single stop, train path selection does consider track conditions at the time but not what other trains might be planning.

If you don't want to figure out circuitry for coordinating trains there's the LTN mod to do the scheduling.

If you do want to, I think you could start from this simple penalty-only-signals setup to get you started, the idea is you can get signals to wire themselves closed, adding a 1000-tile penalty to that path, only when a train's not approaching and there's not enough at their protected stop, using only a single active combinator per stop: This is just a first step, getting a scheduling coordinator going is very nontrivial, signal multiplexing and addressable memory are just parts of what needs tackling.
penalty-only-signals-demo-blueprint

JimBarracus
Filter Inserter
Filter Inserter
Posts: 365
Joined: Mon Jul 03, 2017 9:14 am
Contact:

Re: Train always takes the wrong path

Post by JimBarracus »

You could add a ton of wired signals before the "abholen" stations to add the pathing penalty to this station when occupied.
When your grid gets larger you need to add even more signals.

Best way is to switch to unique station names

zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Train always takes the wrong path

Post by zOldBulldog »

You can have all the stations with the same name. To make it ignore an occupied station you have to disable the occupied station with circuit network logic. But it can get complicated.

A simple (not perfect) way to close an occupied station is to:

- Run a piece of red or green wire from the stop to a pole (to cause the stop to be in a circuit).
- Set the stop to "enable/disable" and "read stopped train".
- Use the enable condition T≤ 0. Where T is the signal that the stop uses to return the train number.

Since all train numbers are greater than 0 that tells the stop to be enabled only when there is no train.

One possible problem:. If all the stations are busy (when you have more trains than stations) the train will skip them all and go back to the pickup station, where it will not stop because it is already full, and it could go on a permanent loop and eventually stall when it runs out of fuel.

kvl
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Apr 15, 2018 4:07 pm
Contact:

Re: Train always takes the wrong path

Post by kvl »

JimBarracus wrote:Best way is to switch to unique station names
Done.

I have a Train-"Main-Line" now and unique station names. Perfect!

Post Reply

Return to “Gameplay Help”