Train Repath When Stopped

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
Shokubai
Filter Inserter
Filter Inserter
Posts: 470
Joined: Mon May 02, 2016 3:17 pm
Contact:

Train Repath When Stopped

Post by Shokubai »

Purpose
Increase throughput at large depots and remove the need for "creative solutions" to trains ignoring empty bays.

Problem
Currently trains chose a desired path and refuse to change this path for long periods of time. The effect is that a train may sit and occupy a waiting bay while a train unloads in its predetermine station leaving empty stations unused for long periods of time. The effect is ultimately a throughput limiter of materials.

Solutions
  • When a train comes to a complete stop perform a path check
  • Along with the path check allow trains to see the status of trains loading or unloading at the intended station(s) and weight those stations in some meaningful way.
  • Allow multiple trains stopped at the same block to consider each other's time stopped, planned destination, etc
  • Aggregate these new logics to produce an "efficient path" to the best station.

Tekky
Smart Inserter
Smart Inserter
Posts: 1039
Joined: Sun Jul 31, 2016 10:53 am
Contact:

Re: Train Repath When Stopped

Post by Tekky »

In OpenTTD, trains recalculate their path at every intersection (when using block signals) or every signal (when using path signals). This works very well, in my opinion. This may cause a significant additional CPU load, but, if necessary, you can always build additional waypoints so that the pathfinder has less work to do (because the search distance is significantly lower when using waypoints).

Therefore, I agree that, in Factorio, trains should also recalculate their paths regularily. But, in order to compensate for the additional CPU load, it may be necessary to introduce waypoints into Factorio, as has been suggested in this thread.

Shokubai
Filter Inserter
Filter Inserter
Posts: 470
Joined: Mon May 02, 2016 3:17 pm
Contact:

Re: Train Repath When Stopped

Post by Shokubai »

OpenTTD was really why I settled on "when stopped" (and at waypoints) in order to avoid using too much CPU time.

Stumpyofpain
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Jun 06, 2017 4:31 pm
Contact:

Re: Train Repath When Stopped

Post by Stumpyofpain »

hi
I think this is a very good idea, because I often have the problem, the trains needlessly stand around, because the path they wanted to drive is blocked, although there are alternatives.

Just lately a piece of rail has been destroyed.
Thus trains have stopped in the unloading station and have reported "no path".
The follow-up train wanted to drive in that 1 station instead of entering the next station. (Multi Unloadingstation)

Edit: A picture to show what happened.
This train would stay there forever... until the "no path" train leaves the bay.
Attachments
Blockedstationduetonopath.png
Blockedstationduetonopath.png (4.59 MiB) Viewed 4988 times
Last edited by Stumpyofpain on Wed Jun 07, 2017 6:03 pm, edited 1 time in total.

Shokubai
Filter Inserter
Filter Inserter
Posts: 470
Joined: Mon May 02, 2016 3:17 pm
Contact:

Re: Train Repath When Stopped

Post by Shokubai »

Stumpyofpain wrote:hi
I think this is a very good idea, because I often have the problem, the trains needlessly stand around, because the path they wanted to drive is blocked, although there are alternatives.

Just lately a piece of rail has been destroyed.
Thus trains have stopped in the unloading station and have reported "no path".
The follow-up train wanted to drive in that 1 station instead of entering the next station. (Multi Unloadingstation)
Depending how far you wanted to go here code wise you could get Googlemapsian (tm) and force trains to repath any time a signal or track is destroyed. I get a bit concerned about the instant load of forcing all trains to do that at once but there are definitely use cases where it might be beneficial.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Train Repath When Stopped

Post by Rseding91 »

Trains already do re-path every 5 seconds when stopped at chain signals when the destination is a stop that exists multiple times in the world.
If you want to get ahold of me I'm almost always on Discord.

Shokubai
Filter Inserter
Filter Inserter
Posts: 470
Joined: Mon May 02, 2016 3:17 pm
Contact:

Re: Train Repath When Stopped

Post by Shokubai »

Rseding91 wrote:Trains already do re-path every 5 seconds when stopped at chain signals when the destination is a stop that exists multiple times in the world.
In theory this sounds good but the practice simply leaves empty bays for long periods of time.

If you have 4 bays all named the same. Lets say a group of 4 trains pull in to the waiting area in close succession. All 4 trains may want to go to the same bay. 1 Trains enters and the other 3 sit. Perhaps one of those trains will change its mind but the other trains generally sit. This cascades through the entire rail network as trains sit unnecessarily when openings clearly exist.

In other train centric games this behavior simply does not exist. Trains move instantly and without hesitation.
Image

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Train Repath When Stopped

Post by ssilk »

Well, the basic problem is (as I currently see it), that the chain signal is not able to handle this kind of issue (unlike in that last gif).

I think this is wanted. :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

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

Re: Train Repath When Stopped

Post by Deadly-Bagel »

Rseding91 wrote:Trains already do re-path every 5 seconds when stopped at chain signals when the destination is a stop that exists multiple times in the world.
If I read that correctly, this doesn't apply when there's a single instance of that stop but multiple paths to it? As in your average waiting bay to ore unloading?
Money might be the root of all evil, but ignorance is the heart.

Post Reply

Return to “Ideas and Suggestions”