Is there a way to stop trains from choosing new stations mid-journey?
Is there a way to stop trains from choosing new stations mid-journey?
I'm building a big base where I use small twoheaded trains to transport goods, thinking incorrectly it would make the base more flexible to just make multiple small factories for individual goods and give stations names like "GreenCircuitsLoad" and "GreenCircuitsUnload". I assumed the trains would neatly transport things from the various loading stations to the various unloading stations.
What actually happens is that all trains will insist on using just the two stations closest together, but even worse, if one is assigned to a station a bit further away, the train often will decide halfway to switch to another station when it becomes available and the far station will not get any goods.
This completely ruins the efficiency of the base, of course, because trains constantly depart for the further away stations only to suddenly turn around on a roundabout and travel back the entire way it came, because another station became available next to its loading station and it was just a bit closer. And then a new train will be assigned to the far station, but the same thing will happen. If often see trains move in all kinds of crazy directions because it keeps choosing new stations, instead of sticking by the one it originally chose and leaving the newly available station for the next train that becomes available. This results in much longer ride times than necessary and a lot of extra congestion.
Is there a way to just prevents trains from ever choosing a new station when it's already on it's way to one? Is there maybe a mod that does this?
What actually happens is that all trains will insist on using just the two stations closest together, but even worse, if one is assigned to a station a bit further away, the train often will decide halfway to switch to another station when it becomes available and the far station will not get any goods.
This completely ruins the efficiency of the base, of course, because trains constantly depart for the further away stations only to suddenly turn around on a roundabout and travel back the entire way it came, because another station became available next to its loading station and it was just a bit closer. And then a new train will be assigned to the far station, but the same thing will happen. If often see trains move in all kinds of crazy directions because it keeps choosing new stations, instead of sticking by the one it originally chose and leaving the newly available station for the next train that becomes available. This results in much longer ride times than necessary and a lot of extra congestion.
Is there a way to just prevents trains from ever choosing a new station when it's already on it's way to one? Is there maybe a mod that does this?
-
- Smart Inserter
- Posts: 2765
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Is there a way to stop trains from choosing new stations mid-journey?
Use train limits on stations to get your trains to naturally spread out across the stations more. Either set them statically, or dynamically with circuits. And if you're doing any station disabling... don't.
Note that for 2.0, the devs are adding station priority and will be changing station disabling behavior (see latest FFF, 395).
Note that for 2.0, the devs are adding station priority and will be changing station disabling behavior (see latest FFF, 395).
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Re: Is there a way to stop trains from choosing new stations mid-journey?
I already do that, no station will ever have more than 1 train assigned to it, but trains still cluster to a few stations because as Train 1 leaves an unloading station for example, Train 2 will get assigned to that station after a while and leave its loading station. But Train 1 will then immediately reroute to the loading station that now became accessible again, often following a horribly inefficient route because it was going somewhere else originally.FuryoftheStars wrote: ↑Thu Feb 01, 2024 1:14 pmUse train limits on stations to get your trains to naturally spread out across the stations more. Either set them statically, or dynamically with circuits. And if you're doing any station disabling... don't.
Note that for 2.0, the devs are adding station priority and will be changing station disabling behavior (see latest FFF, 395).
The end result is that although the trains could be going from 2 loading stations to 2 unloading stations, but they're going from 1 to 1, and waste a lot of time and create a lot of congestion because the routes they follow are so bad. None of this would be an issue if they just stuck by the stations they originally selected, so that's why I was hoping maybe some mod existed to fix this.
I'm looking forward very much to station priority TBH, that would solve this issue as well.
Re: Is there a way to stop trains from choosing new stations mid-journey?
If a loading station has a full train load or more it's limit should be 1, otherwise 0.
If an unloading station can take a full train load or more it's limit should be 1 otherwise 0.
If the the loading stations run full and unloading empty you need more trains, if both run low you need more resources.
No 2.0 features are needed to make this work.
If an unloading station can take a full train load or more it's limit should be 1 otherwise 0.
If the the loading stations run full and unloading empty you need more trains, if both run low you need more resources.
No 2.0 features are needed to make this work.
Re: Is there a way to stop trains from choosing new stations mid-journey?
https://wiki.factorio.com/Railway/Train ... _operation
Basically. Whenever a train hits traffic it tries to repath.
Suggestions:
Try to eliminate turnarounds and roundabouts in your train system.
They give your trains many opertunites for strange behaviour and slow down path finding a lot.
Maybe you think that trains then will path through stations if you do that - but there is a high penalty in the path finder for that so it shouldn't happen often.
It's there by change something on the way to station 2 that makes them avoid it? Stations on the main line, Traffic jams, etc?
Other idea: You could oversaturate your station.
Make a third train.
Example:
2 Loading station set to 1 train max.
Train 1 finishes loading
Train 2 is enroute to station 2
Train 3 is waiting for destination in unloading station (or in a dedicated parking station)
--> when train 1 leaves train 3 reserves the spot. Train 2 gets no chance to repath
Basically. Whenever a train hits traffic it tries to repath.
Suggestions:
Try to eliminate turnarounds and roundabouts in your train system.
They give your trains many opertunites for strange behaviour and slow down path finding a lot.
Maybe you think that trains then will path through stations if you do that - but there is a high penalty in the path finder for that so it shouldn't happen often.
It's there by change something on the way to station 2 that makes them avoid it? Stations on the main line, Traffic jams, etc?
Other idea: You could oversaturate your station.
Make a third train.
Example:
2 Loading station set to 1 train max.
Train 1 finishes loading
Train 2 is enroute to station 2
Train 3 is waiting for destination in unloading station (or in a dedicated parking station)
--> when train 1 leaves train 3 reserves the spot. Train 2 gets no chance to repath
Re: Is there a way to stop trains from choosing new stations mid-journey?
I only disable unloading stations, so that trains have always somewhere to go. The trouble with disabling loading stations too is that you can get the situation that a train can't go anywhere after unloading and gets stuck blocking an unloading station.Loewchen wrote: ↑Thu Feb 01, 2024 4:16 pmIf a loading station has a full train load or more it's limit should be 1, otherwise 0.
If an unloading station can take a full train load or more it's limit should be 1 otherwise 0.
If the the loading stations run full and unloading empty you need more trains, if both run low you need more resources.
No 2.0 features are needed to make this work.
And because the unloading station is blocked, other trains cannot go there and will keep waiting at the loading stations, meaning new loading stations won't get available either, so the unloading station will remain blocked until the loading station is unblocked again.
Adding more trains is something I'm doing now, but this creates a lot of extra traffic so I can't just do that indefinitely.
Re: Is there a way to stop trains from choosing new stations mid-journey?
Thank you for the suggestions.Nosferatu wrote: ↑Thu Feb 01, 2024 4:45 pmhttps://wiki.factorio.com/Railway/Train ... _operation
Basically. Whenever a train hits traffic it tries to repath.
Suggestions:
Try to eliminate turnarounds and roundabouts in your train system.
They give your trains many opertunites for strange behaviour and slow down path finding a lot.
Maybe you think that trains then will path through stations if you do that - but there is a high penalty in the path finder for that so it shouldn't happen often.
It's there by change something on the way to station 2 that makes them avoid it? Stations on the main line, Traffic jams, etc?
Other idea: You could oversaturate your station.
Make a third train.
Example:
2 Loading station set to 1 train max.
Train 1 finishes loading
Train 2 is enroute to station 2
Train 3 is waiting for destination in unloading station (or in a dedicated parking station)
--> when train 1 leaves train 3 reserves the spot. Train 2 gets no chance to repath
I did not know about the roundabout issue. I'm indeed using a lot of them for crossings, I will try if I can replace them with some alternative.
My rail network is quite busy and although I'm trying to reduce traffic as much as I can, there probably will always be a few pauses en route to far away stations. Do I understand you correctly that that is the only time they're supposed to repath, or do they also do it at full speed?
Oversaturating stations is what I'm mainly trying now, I've entered a lot of extra trains into the network and it does help a bit. The flipside of this is that this greatly increases the number of trains I'm using and causes a lot of traffic. That's why I was looking for some way to prevent the repathing, because that's what causes trains to follow inefficient routes and makes it necessary to have more of them riding around in the first place.
Re: Is there a way to stop trains from choosing new stations mid-journey?
The bold ones are the most critical I think. As soon as he gets blocked a little bit he starts to search for alternate routes.Wiki wrote:Repaths that happen as part of normal train operation
A train fails a revalidation.
The train stop a train is heading to is renamed or destroyed.
The train is preparing to stop at a signal (chain or regular) that changes so that the train can now continue.
The train is braking for a signal (chain or regular) it cant reserve.
The train enters a new rail block and can't reserve the next needed signal (chain or regular).
The train has waited at a chain signal for a multiple of 5 seconds and there are multiple train stops with the same name as the destination.
The train has waited at a chain signal for a multiple of 30 seconds and there is only a single train stop with the same name as the destination.
The train wants to depart from a signal (chain or regular) that it stopped at.
The train wants to depart from a train stop.
The train is pathing to a train stop that gets disabled.
The last one in the list is why everybody says disabling stations is bad
![Wink ;)](./images/smilies/icon_e_wink.gif)
The traffic should die down again. Once you reached over-saturation you have more trains but lots of them will wait in stations.The flipside of this is that this greatly increases the number of trains I'm using and causes a lot of traffic.
-
- Smart Inserter
- Posts: 2765
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Is there a way to stop trains from choosing new stations mid-journey?
Just for clarity sake, there is an actual disable feature of train stops (currently) that is different from setting train limits to 0. Setting the limit to 0 keeps the stop open for any trains already pathed to it, but prevents new ones from pathing to it, whereas disabling makes even current trains pathing to it repath elsewhere.Frankvd wrote: ↑Thu Feb 01, 2024 6:17 pmI only disable [...]Loewchen wrote: ↑Thu Feb 01, 2024 4:16 pmIf a loading station has a full train load or more it's limit should be 1, otherwise 0.
If an unloading station can take a full train load or more it's limit should be 1 otherwise 0.
If the the loading stations run full and unloading empty you need more trains, if both run low you need more resources.
No 2.0 features are needed to make this work.
So... which "disable" do you mean here? Disable disable, or train limit 0 "disable"?
![Smile :)](./images/smilies/icon_e_smile.gif)
I recommend creating an intermediary train depot of sorts for this. You can even make multiple on different sides of your base so that it kind of forces some routing with the trains. Alternatively, stacker bays at your loading and/or unloading that use a train station for navigation.
And it looks like Nosferatu answered the other question I was going to comment on re: situations that cause repathing.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Re: Is there a way to stop trains from choosing new stations mid-journey?
I also think it happens mostly when those two happen, because trains need to wait every once in a while. The repathing itself is not a problem if it's just finding a more efficient path to the same station, but when it starts choosing new stations it is an issue.
As for disabling stations, I only disable them when they have a certain amount of goods in storage, and they can only reach that threshold when a train is unloading. And because they all have a train limit of 1, whenever a train is unloading, it means there is no other train heading for the station. So it never happens that a station gets disabled while a train is heading for it.
Unfortunately, due to this pathing behavior it will not, because when a train departs for a station 5 minutes away, travels 2 minutes, then turns around for a different station next to its starting point, traveling another 2 minutes back, it will have traveled for 4 minutes, even though it could have reached the same endpoint in a matter of seconds, as the endpoint is next to its starting station. So a lot of trains are following very inefficient routes, meaning there is a lot more traffic than necessary.The traffic should die down again. Once you reached over-saturation you have more trains but lots of them will wait in stations.
This wouldn't be an issue if it just chose a different path to the same station, as the train in that case would be heading for the same endpoint through the most efficient route, but if the endpoint completely changes halfway, everything a train has traveled up until that point is essentially wasted time and effort.
Re: Is there a way to stop trains from choosing new stations mid-journey?
The "hard" disable, but they only get disabled once there are enough goods in storage, which in turn can only happen when a train is unloading, and because the train limit is 1, there is never another train heading for the station when there is already one unloading and this threshold is reached. So this causes no issues.FuryoftheStars wrote: ↑Thu Feb 01, 2024 8:21 pm
Just for clarity sake, there is an actual disable feature of train stops (currently) that is different from setting train limits to 0. Setting the limit to 0 keeps the stop open for any trains already pathed to it, but prevents new ones from pathing to it, whereas disabling makes even current trains pathing to it repath elsewhere.
So... which "disable" do you mean here? Disable disable, or train limit 0 "disable"?
This could be an option, it would require me to rename stations and have trains travel from loading->depot, and depot-> unloading. Maybe I can fit this in for some goods. What is a stacker bay?I recommend creating an intermediary train depot of sorts for this. You can even make multiple on different sides of your base so that it kind of forces some routing with the trains. Alternatively, stacker bays at your loading and/or unloading that use a train station for navigation.
And it looks like Nosferatu answered the other question I was going to comment on re: situations that cause repathing.
-
- Smart Inserter
- Posts: 2765
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Is there a way to stop trains from choosing new stations mid-journey?
Parallel rail lines prior to a stop (or set of stops) where trains wait. Similar concept as a depot, only meant to service a specific set of stations.
Kind of like this (and you can do diagonal, too):
Image taken from here: https://www.factorio.school/view/-LRiXaIKDuAdgArz5tuf
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Re: Is there a way to stop trains from choosing new stations mid-journey?
Ah OK thank you, that makes it clear. I use similar models in my original base, but in the train base I build now the stations are small and close together, so unfortunately there is no space to build waiting areas like this. I use double-headed trains and stations where they go in with one locomotive and exit with the other, like this:FuryoftheStars wrote: ↑Wed Feb 07, 2024 8:45 pmParallel rail lines prior to a stop (or set of stops) where trains wait. Similar concept as a depot, only meant to service a specific set of stations.
Kind of like this (and you can do diagonal, too):
stacker example.jpeg
Image taken from here: https://www.factorio.school/view/-LRiXaIKDuAdgArz5tuf