How to force recalculation of train paths?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
terror_gnom
Fast Inserter
Fast Inserter
Posts: 121
Joined: Wed Apr 06, 2016 4:01 am
Contact:

How to force recalculation of train paths?

Post 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.
Shokubai
Filter Inserter
Filter Inserter
Posts: 470
Joined: Mon May 02, 2016 3:17 pm
Contact:

Re: How to force recalculation of train paths?

Post 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.
TheSkiGeek
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Thu Jun 16, 2016 5:00 am
Contact:

Re: How to force recalculation of train paths?

Post 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.
Kelderek
Filter Inserter
Filter Inserter
Posts: 250
Joined: Tue Nov 11, 2014 6:04 pm
Contact:

Re: How to force recalculation of train paths?

Post 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.
terror_gnom
Fast Inserter
Fast Inserter
Posts: 121
Joined: Wed Apr 06, 2016 4:01 am
Contact:

Re: How to force recalculation of train paths?

Post 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 :)
Thegrover
Inserter
Inserter
Posts: 31
Joined: Thu Jul 07, 2016 8:00 am
Contact:

Re: How to force recalculation of train paths?

Post 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
Harkonnen604
Filter Inserter
Filter Inserter
Posts: 285
Joined: Thu Jun 09, 2016 5:56 am
Contact:

Re: How to force recalculation of train paths?

Post 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?
Kelderek
Filter Inserter
Filter Inserter
Posts: 250
Joined: Tue Nov 11, 2014 6:04 pm
Contact:

Re: How to force recalculation of train paths?

Post 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.
Harkonnen604
Filter Inserter
Filter Inserter
Posts: 285
Joined: Thu Jun 09, 2016 5:56 am
Contact:

Re: How to force recalculation of train paths?

Post 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.
terror_gnom
Fast Inserter
Fast Inserter
Posts: 121
Joined: Wed Apr 06, 2016 4:01 am
Contact:

Re: How to force recalculation of train paths?

Post by terror_gnom »

Damn :( It didnt work... Probably I need to build a parallel stacker (not 2 or 3 trains per lane/station)
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
Post Reply

Return to “Gameplay Help”