Page 1 of 2

How to force recalculation of train paths?

Posted: Tue Jul 12, 2016 7:44 am
by terror_gnom
Hi,

is there any possibility to force a recalculation of the train pathfinding when a train is waiting at a blue chain signal? Would be usefull for train-stackers/multi-lane train stations.

Re: How to force recalculation of train paths?

Posted: Tue Jul 12, 2016 4:59 pm
by Shokubai
It should ...find an open path where one exists. Your question makes it sound as if you have a train that is sitting somewhere and it should be able to find a path but can't. This is probably just a case of a signaling error.

An uploaded save may be helpful here.

Re: How to force recalculation of train paths?

Posted: Tue Jul 12, 2016 9:47 pm
by TheSkiGeek
Currently, trains only pick a destination when they leave a station - if you have multiple same-named stations, a train will pick one to go to when it leaves the previous station in its schedule. If it's blocked at a signal it can try to pick another path, but it won't pick a different destination at that point.

You can sort of cheat this by putting a station in between and having trains stop there for 0s. This way it should always try to go to a station that is unblocked, since it won't pick a blocked station as a potential destination.

Re: How to force recalculation of train paths?

Posted: Tue Jul 12, 2016 11:07 pm
by Kelderek
Seems to me that trains should do another check on available stations any time they are stopped (either at a different station or while waiting at a red signal). I have seen this behavior myself where a train sits idle in a stacker just ahead of a pair of stations with the same name because it wants to go to a specific one of those stations that happens to be occupied. You can verify this by mousing over the train and seeing the pathing arrows. Even if the other station with the same name is wide open it will sit and wait for the first one to be vacated.

Re: How to force recalculation of train paths?

Posted: Wed Jul 13, 2016 8:00 am
by terror_gnom
Probably the trick TheSkiGeek mentioned will work :) I´ll test it later :D THX

*edit* nah... can´t be like you explained... The Train waits at a blue signal until its current destination becomes free, then it chooses another station (that was already free when the train arrived at the signal). But I´ll test the second 0s station anyway :)

Re: How to force recalculation of train paths?

Posted: Wed Jul 13, 2016 11:04 am
by Thegrover
Why not put a new station in the schedule just before the depot with a 0 second wait time? Then it will calculate its arrival station when it knows where is free. Bonus points for sticking waiting space behind the station, so your train enters the "depot" area, passes through the waiting area. Stops at a station to be given a free station (your need to make sure the train was held by a chain signal before hitting the blank station so it was guaranteed a free station), then rolling in. Should work for any number of trains as long as your waiting area is big enough

Re: How to force recalculation of train paths?

Posted: Wed Jul 13, 2016 2:12 pm
by Harkonnen604
Does giving same name to two stations serve any purpose? I always thought it just confuses player because stations are addressed by some internal ID so you don't know which is which. Am I wrong?

Re: How to force recalculation of train paths?

Posted: Wed Jul 13, 2016 3:43 pm
by Kelderek
When you assign a train to go to a station, that is based on the name, not on some internal ID. Even though I may have two separate stations named "Iron Main" when you pull of the list of stations in the scheduler it only shows "Iron Main" once. Trains will use whatever one is available. It's a way to manage high throughput especially on the receiving end if you have a lot of trains, you can have them go to different stations with the same name and it allows for simpler scheduling.

This thread pertains to the fact that trains decide which of those stations to go to when departing the previous stop and will not change their mind even if a better alternative opens up along the way.

Re: How to force recalculation of train paths?

Posted: Wed Jul 13, 2016 3:50 pm
by Harkonnen604
Got it, thanks. If trains are allowed to pick different station while waiting they may go infinite loop back and forth in some cases.

Re: How to force recalculation of train paths?

Posted: Wed Jul 13, 2016 5:24 pm
by terror_gnom
Damn :( It didnt work... Probably I need to build a parallel stacker (not 2 or 3 trains per lane/station)

Re: How to force recalculation of train paths?

Posted: Fri Jul 15, 2016 5:02 pm
by Fushigidane
TheSkiGeek wrote:Currently, trains only pick a destination when they leave a station - if you have multiple same-named stations, a train will pick one to go to when it leaves the previous station in its schedule. If it's blocked at a signal it can try to pick another path, but it won't pick a different destination at that point.

You can sort of cheat this by putting a station in between and having trains stop there for 0s. This way it should always try to go to a station that is unblocked, since it won't pick a blocked station as a potential destination.
That is not true. Trains update paths at other times too, both while moving and stationary. I don't know what triggers it though because sometimes it can sit for several minutes before it finds the empty station.

Re: How to force recalculation of train paths?

Posted: Mon Jul 18, 2016 12:45 am
by Fahrradkette
Fushigidane wrote:
TheSkiGeek wrote:Currently, trains only pick a destination when they leave a station - if you have multiple same-named stations, a train will pick one to go to when it leaves the previous station in its schedule. If it's blocked at a signal it can try to pick another path, but it won't pick a different destination at that point.

You can sort of cheat this by putting a station in between and having trains stop there for 0s. This way it should always try to go to a station that is unblocked, since it won't pick a blocked station as a potential destination.
That is not true. Trains update paths at other times too, both while moving and stationary. I don't know what triggers it though because sometimes it can sit for several minutes before it finds the empty station.
I once read that chain signals have an impact on how trains behave. Is it only for finding paths or also picking (same named) stations?

Re: How to force recalculation of train paths?

Posted: Mon Jul 18, 2016 4:49 am
by Fushigidane
Fahrradkette wrote:
Fushigidane wrote:
TheSkiGeek wrote:Currently, trains only pick a destination when they leave a station - if you have multiple same-named stations, a train will pick one to go to when it leaves the previous station in its schedule. If it's blocked at a signal it can try to pick another path, but it won't pick a different destination at that point.

You can sort of cheat this by putting a station in between and having trains stop there for 0s. This way it should always try to go to a station that is unblocked, since it won't pick a blocked station as a potential destination.
That is not true. Trains update paths at other times too, both while moving and stationary. I don't know what triggers it though because sometimes it can sit for several minutes before it finds the empty station.
I once read that chain signals have an impact on how trains behave. Is it only for finding paths or also picking (same named) stations?
The path finder doesn't see signals, it only sees blocks and if they are free or not. Signals only stop trains from entering reserved blocks.

Re: How to force recalculation of train paths?

Posted: Fri Sep 09, 2016 12:08 am
by impetus maximus
the train algorithm needs fixing.

learning how train signals/chain signals function is frustrating as it is.
then you buid something that should work, then does something like this.
chain.signal.dead.lock2.png
the train went through a blue chain signal (as it should) but passes the free lane and stops at a blocked one. :|

Re: How to force recalculation of train paths?

Posted: Fri Sep 09, 2016 1:54 pm
by Deadly-Bagel
impetus maximus wrote:the train algorithm needs fixing.

learning how train signals/chain signals function is frustrating as it is.
then you buid something that should work, then does something like this.

the train went through a blue chain signal (as it should) but passes the free lane and stops at a blocked one. :|
See this topic. I posted a solution there using the circuit network so that a regular signal basically works like a chain signal. As the trains seem to recalculate when they pass signals, it does so upon being allowed into the loading area and automatically picks the available waiting bay. Note it is best if the faux-chain signal is not right up against a curved rail though I personally didn't find any problems with that.

Re: How to force recalculation of train paths?

Posted: Fri Sep 09, 2016 8:37 pm
by impetus maximus
thanks Deadly-Bagel. i'll check that out.

Re: How to force recalculation of train paths?

Posted: Fri Sep 09, 2016 8:39 pm
by Zeblote
impetus maximus wrote:the train algorithm needs fixing.

learning how train signals/chain signals function is frustrating as it is.
then you buid something that should work, then does something like this.
chain.signal.dead.lock2.png
the train went through a blue chain signal (as it should) but passes the free lane and stops at a blocked one. :|
Is this not a bug? If the path the train wants to take is blocked, it should stop at the chain signal.

Re: How to force recalculation of train paths?

Posted: Fri Sep 09, 2016 9:05 pm
by impetus maximus
Zeblote wrote: Is this not a bug? If the path the train wants to take is blocked, it should stop at the chain signal.
seems like a bug to me. i don't know if it has been offically reported or not.

Re: How to force recalculation of train paths?

Posted: Fri Sep 09, 2016 9:09 pm
by Deadly-Bagel
I don't see a chain signal in the screenshot, is it behind the train?

Re: How to force recalculation of train paths?

Posted: Fri Sep 09, 2016 9:54 pm
by impetus maximus
Deadly-Bagel wrote:I don't see a chain signal in the screenshot, is it behind the train?
sorry. cropped it so it was a smaller image and clearer.
chain.dead.lock.jpg