Page 1 of 1

Train always takes the wrong path

Posted: Sun Apr 15, 2018 4:30 pm
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 4739 times
train1.PNG
train1.PNG (1.97 MiB) Viewed 4739 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

Re: Train always takes the wrong path

Posted: Sun Apr 15, 2018 5:04 pm
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.

Re: Train always takes the wrong path

Posted: Sun Apr 15, 2018 5:10 pm
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!

Re: Train always takes the wrong path

Posted: Sun Apr 15, 2018 5:26 pm
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.

Re: Train always takes the wrong path

Posted: Sun Apr 15, 2018 5:51 pm
by kvl
Okay, I chosse option 1!

" have one train per pick up station "

Thank you!

Re: Train always takes the wrong path

Posted: Sun Apr 15, 2018 6:41 pm
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.

Re: Train always takes the wrong path

Posted: Sun Apr 15, 2018 6:43 pm
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.

Re: Train always takes the wrong path

Posted: Sun Apr 15, 2018 7:20 pm
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

Re: Train always takes the wrong path

Posted: Mon Apr 16, 2018 5:15 am
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

Re: Train always takes the wrong path

Posted: Mon Apr 16, 2018 5:50 am
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.

Re: Train always takes the wrong path

Posted: Mon Apr 16, 2018 8:38 pm
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!