How to force recalculation of train paths?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Fushigidane
Inserter
Inserter
Posts: 20
Joined: Sun Jul 03, 2016 8:07 pm
Contact:

Re: How to force recalculation of train paths?

Post 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.
Fahrradkette
Inserter
Inserter
Posts: 45
Joined: Thu Aug 27, 2015 4:37 pm
Contact:

Re: How to force recalculation of train paths?

Post 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?
Fushigidane
Inserter
Inserter
Posts: 20
Joined: Sun Jul 03, 2016 8:07 pm
Contact:

Re: How to force recalculation of train paths?

Post 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.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: How to force recalculation of train paths?

Post 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. :|
User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: How to force recalculation of train paths?

Post 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.
Money might be the root of all evil, but ignorance is the heart.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: How to force recalculation of train paths?

Post by impetus maximus »

thanks Deadly-Bagel. i'll check that out.
Zeblote
Filter Inserter
Filter Inserter
Posts: 973
Joined: Fri Oct 31, 2014 11:55 am
Contact:

Re: How to force recalculation of train paths?

Post 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.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: How to force recalculation of train paths?

Post 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.
User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: How to force recalculation of train paths?

Post by Deadly-Bagel »

I don't see a chain signal in the screenshot, is it behind the train?
Money might be the root of all evil, but ignorance is the heart.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: How to force recalculation of train paths?

Post 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
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: How to force recalculation of train paths?

Post by impetus maximus »

Deadly-Bagel, i removed the chain signals and replaced them with standard signals.
wired the five lane entrance signals to a red wire, and strung it to poles to the two faux-chain signal as you called it.
kept the output signals normal. the faux-chain signals are set to RED > 4 close signal.

seems to be working so far. when it goes green they go to an open lane. haven't seen one jam up yet :)
might just ditch chain signals all together till they get fixed/reworked.

cheers
User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: How to force recalculation of train paths?

Post by Deadly-Bagel »

No worries =) Glad it helped.

As for blue chain signal, it means at least one exit is free but others are not. Not sure exactly what the problem is but the reason I designed that faux-chain signal thing is because another user had a problem where one of his loading bays would free up, the train would ignore it altogether.

So what I suspect is happening is that northbound rail just after your chain signal was open, which for some reason allows the train to move on. Perhaps chain signals were not designed for use with multiple outputs like this, or it could be it's just checking -a- route to the destination is available but not recalculating or whatever when it passes the signal. It's a weird one to be sure.

EDIT: Confirmed the behaviour. Train will NOT pass a blue signal unless an exit to its destination is free. However, if it's picked a route and a different exit is free, it will keep going on its original route. Interestingly this only seems to happen if the train has picked its route before its desired path is blocked, otherwise it works as expected.


EDIT: Derp, sleep deprived lol. In my tests I was placing the train too far forward so it was already past the chain signal, or at least the point it would stop for it. Trains should only ever pass a blue signal if it doesn't think its exit is free so I have no idea what you're doing in your setup to get around that, if you can replicate it submit a bug report.
Money might be the root of all evil, but ignorance is the heart.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: How to force recalculation of train paths?

Post by impetus maximus »

ok i have a save set up with the chain signal problem of trains entering a block then passing a green lane and stopping at a red signal. (dead lock)
[edit]can i upload the save without sharing login info etc? :? stupid question. devs are smarter than that!
rails.zip
that save if you run it (0.13.20) will have the trains coming from the bypass on the right, going through a blue signal.
passing a green lane, and stopping at a blocked one. dead locking the system. the train exiting the unload station
by the stacker does some odd things. it refuses to leave the station. hitting F4 and enabling 'show rail paths'
showed it's path was set to leave east on the west bound side of the one way side of the bypass. :|
two lanes are one way, with the lane in the middle being two way. selecting the train that is stuck at the station
and clicking "go to station" will send it on it's way.

the debugger (F4) it great for showing what trains are "thinking". when the train is approaching the stackker it will change which
lane it is going into while in the block before it. also note how i have 'show train signals' selected but not all are circled?
F4.debug.rail.jpg
it won't take long for a train to pull up to the stacker, pass an open lane, and jam the system.
User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: How to force recalculation of train paths?

Post by Deadly-Bagel »

Okay that is really weird.. Post it in the bug forums and they should be able to find out what's going on.

Seems you can avoid the problem by putting a pair of opposing chain signals just before the junction leading to the loading bays.
Money might be the root of all evil, but ignorance is the heart.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: How to force recalculation of train paths?

Post by impetus maximus »

ok i'll work on putting a bug report together. i tried putting a chain signal before the lanes but a train would end up stopping at it dead locking.
[edit]did a search and submitted a report. turns out it's been reported already.
Last edited by impetus maximus on Mon Sep 12, 2016 1:06 pm, edited 1 time in total.
User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: How to force recalculation of train paths?

Post by Deadly-Bagel »

I mean at the point just before the yellow (is it green? /colourblind) line and white line join in your last screenshot.
Money might be the root of all evil, but ignorance is the heart.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: How to force recalculation of train paths?

Post by impetus maximus »

Deadly-Bagel wrote:I mean at the point just before the yellow (is it green? /colourblind) line and white line join in your last screenshot.
oh, i could try one there. [edit] yup... just as i thought.
the train leaves the bypass and blocks the main line even though there is an open lane in the stacker.
GeniusIsme
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sun Sep 28, 2014 7:26 am
Contact:

Re: How to force recalculation of train paths?

Post by GeniusIsme »

Don't build ordinary signals on exits from shared track. Trains will stop there and block. Place ordinary signals only in places where you believe trains can wait forever without blocking the system.
lpw
Inserter
Inserter
Posts: 21
Joined: Tue Jan 06, 2015 10:50 pm
Contact:

Re: How to force recalculation of train paths?

Post by lpw »

GeniusIsme wrote:Don't build ordinary signals on exits from shared track. Trains will stop there and block. Place ordinary signals only in places where you believe trains can wait forever without blocking the system.
If you put chain signals at the entrances of the shared track this shouldn't hold true.
Post Reply

Return to “Gameplay Help”