trains getting stuck
-
- Burner Inserter
- Posts: 7
- Joined: Thu Nov 19, 2020 12:35 pm
- Contact:
trains getting stuck
why does this happen? they keep getting stuck like this, the upper train could take the red path but it just doesn't want to
- Attachments
-
- Screenshot_61.png (3.75 MiB) Viewed 3342 times
Re: trains getting stuck
https://wiki.factorio.com/Railway/Train_path_finding
In particular the following bit.
In particular the following bit.
When the path includes a train stop that is not the destination -> Add a penalty of 2000.
-
- Filter Inserter
- Posts: 261
- Joined: Sun Sep 16, 2018 10:44 pm
- Contact:
Re: trains getting stuck
It’s best to place your train stations off of the travel lanes so that all trains that are not using the station can bypass it, and also trains that use the station will not block traffic.
Factorio Towns... https://youtube.com/playlist?list=PLf5d ... -ps9WNZOCe
Re: trains getting stuck
Why do you have the train signals set to be two-directional in this roundabout?
If you make the roundabout one-directional, you won't have this issue – irrespective if there is a train stop on the roundabout.
In any case, keep the rails coming from the south and from the east two-directional.
If you make the roundabout one-directional, you won't have this issue – irrespective if there is a train stop on the roundabout.
In any case, keep the rails coming from the south and from the east two-directional.
Re: trains getting stuck
Can you post the save for that? The train should not be getting stuck there. They upper train should sit there for 30 seconds max before repathing.
Yes, but there is this penalty.Zavian wrote: ↑Thu Nov 19, 2020 12:57 pm https://wiki.factorio.com/Railway/Train_path_finding
In particular the following bit.When the path includes a train stop that is not the destination -> Add a penalty of 2000.
Given that there is no distance to the start of the occupied block, it's effectively infinite path cost, so it will be greater cost than pathing through the train depot. At the next 30 second repath event for waiting at chain signals, that train should be taking the top path.When the rail block is occupied by a train -> Add a penalty of 2 * length of the block divided by block distance from the start, so the far away occupied paths don't matter much.
Re: trains getting stuck
The divisor can never go below 1:Zanthra wrote: ↑Sat Nov 21, 2020 4:55 am Yes, but there is this penalty.
Given that there is no distance to the start of the occupied block, it's effectively infinite path cost, so it will be greater cost than pathing through the train depot. At the next 30 second repath event for waiting at chain signals, that train should be taking the top path.When the rail block is occupied by a train -> Add a penalty of 2 * length of the block divided by block distance from the start, so the far away occupied paths don't matter much.
Code: Select all
// Neighbor segment penalties
if (!neighborSegment->getBlock()->isFree(request.train))
costFromStart += (2 * neighborSegment->getLength()) / (currentNode->blockDistanceFromStart + 1);
Re: trains getting stuck
Ah so it is distance +1 which is very different in a situation like this.Loewchen wrote: ↑Sat Nov 21, 2020 5:19 amThe divisor can never go below 1:Zanthra wrote: ↑Sat Nov 21, 2020 4:55 am Yes, but there is this penalty.
Given that there is no distance to the start of the occupied block, it's effectively infinite path cost, so it will be greater cost than pathing through the train depot. At the next 30 second repath event for waiting at chain signals, that train should be taking the top path.When the rail block is occupied by a train -> Add a penalty of 2 * length of the block divided by block distance from the start, so the far away occupied paths don't matter much.Code: Select all
// Neighbor segment penalties if (!neighborSegment->getBlock()->isFree(request.train)) costFromStart += (2 * neighborSegment->getLength()) / (currentNode->blockDistanceFromStart + 1);
PS: It should however eventually clear up due to this condition.
Unless I am misunderstanding that one too.
When the path includes a train currently waiting at a rail signal -> Add a penalty of 100 + 0.1 for every tick the train has already waited.
Re: trains getting stuck
Yes. After 5 - 6 minutes it should repath.
Re: trains getting stuck
Which, i'll admit, would look like they are getting stuck.
Since the southwest bound trains are very reluctant to use the trainstop as a bypass, you either need another bypass, or you need to signal the main line as you would if the trainstop rail was not there. Replace the standard signals on the bidirectional route with chain sginals to force any trains to reserve the entire route before they enter. The only standard signal in that screenshot that can stay is the top left one direction signal that leads to the train stop.
-
- Burner Inserter
- Posts: 7
- Joined: Thu Nov 19, 2020 12:35 pm
- Contact:
Re: trains getting stuck
yes, it resolves itself after 30 seconds or so. I just didn't wait long enough to see that until you pointed it out.
I'll post the save when I figure out how to do it :P
-
- Burner Inserter
- Posts: 7
- Joined: Thu Nov 19, 2020 12:35 pm
- Contact:
Re: trains getting stuck
here's the save file
- Attachments
-
- sp10.15.zip
- (9.55 MiB) Downloaded 84 times
Re: trains getting stuck
I set it up so that trains meet at that location, and it did take more than 5 minutes to clear on it's own, which could hurt throughput a fair bit.altaykilic wrote: ↑Sat Nov 21, 2020 2:27 pmyes, it resolves itself after 30 seconds or so. I just didn't wait long enough to see that until you pointed it out.
I'll post the save when I figure out how to do it
In this image the red marks are regular signals on the main bidirectional trunk highlighted in green that you may want to replace with chain signals.