My trains keep trying to loop...

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
User avatar
Lizzy
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sun May 28, 2017 4:26 am
Contact:

My trains keep trying to loop...

Post by Lizzy »

...and that results in frequent deadlocks :(
Attachments
loop-de-doop.png
loop-de-doop.png (2.24 MiB) Viewed 7557 times
Koub
Global Moderator
Global Moderator
Posts: 7784
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: My trains keep trying to loop...

Post by Koub »

I find it hard to see on your screenshot, But what I can tell is that :
- I find roundabouts less efficient than corssings (I'm just starting to fiddle with trains so I'm a true noob on the topic)
- I think your roundabouts are too packed together. trains need space to work well, if your segments of tracks are too small for a train to fit, it's generally bad.
- This tutorial in invaluable to me, and it's my train bible : https://www.youtube.com/watch?v=3ZiL7_vfJtQ
Koub - Please consider English is not my native language.
User avatar
Tev
Fast Inserter
Fast Inserter
Posts: 149
Joined: Sun Aug 02, 2015 7:42 pm
Contact:

Re: My trains keep trying to loop...

Post by Tev »

Best advice is DO NOT USE LOOPS.

There are many people defending them vigorously, and if you'll work hard enough they are probably workable (possibly equal in limited systems), but I don't see (m)any benefits to them, and simple T-intersections (http://guide.factorio.com/img/51.jpg) and terminus stations have a lot less problems. Also loops scale extremely poorly, as roundabouts have no-matter-what like 15% smaller throughput in ideal scenario compared to Ts, and train pathfinding will make your life hell in large system with many loops and trains.

As an advice for inevitable loops (large expansion branches connecting, if you really really want single header trains etc.) - add train stations with standardized names (I use "_") to them to make trains avoid them when searching for path.
Kelderek
Filter Inserter
Filter Inserter
Posts: 250
Joined: Tue Nov 11, 2014 6:04 pm
Contact:

Re: My trains keep trying to loop...

Post by Kelderek »

Also, your loops are only halfway signaled. They should either have no signals inside the loop at all (making the entire loop a single block, safer, but reduces throughput) with signals only on the entry and exit lines or fully signal the entire thing using lots of chain signals on the loop itself and rail signals on exit lines.

Or as others have said, avoid using loops altogether to eliminate the issue entirely.
User avatar
Distelzombie
Filter Inserter
Filter Inserter
Posts: 336
Joined: Tue May 02, 2017 4:27 pm
Contact:

Re: My trains keep trying to loop...

Post by Distelzombie »

But still: The train shouldnt want to make a whole round in it. Theres some other mistake or bug here
Complete 2-Lane system as a Blueprint-Book! The perfect OCD reactor? Testing chained science lab efficiency Please use real prefixes and proper rounding!
User avatar
Lizzy
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sun May 28, 2017 4:26 am
Contact:

Re: My trains keep trying to loop...

Post by Lizzy »

Kelderek wrote:Also, your loops are only halfway signaled.
I wrote a long rant explaining why exactly you were wrong, and, in the middle of it, I realized that if I add four more chain signals in the diagonal junction of each roundabout, it might be enough to make these silly trains stop trying to go over themselves.

Yes, I realize the non-terminus stations and the too-short segments are bad. I said as much to my fellow players when they built those. They didn't think it was serious, and here we are. :)

I take ownership of all these bad designs when I bring that to you, but that still doesn't explain the loop.
Kelderek
Filter Inserter
Filter Inserter
Posts: 250
Joined: Tue Nov 11, 2014 6:04 pm
Contact:

Re: My trains keep trying to loop...

Post by Kelderek »

A significant part of this specific case is the size of the track sections. There simply isn't enough room for a full train in some of the sections. In particular the northern and southern roundabouts are very close together, there is only room for a single locomotive there.

The reason for this specific train trying to loop is probably due to a previous train in the area which may have blocked one path and this train then tried to find an alternate path (hence the counterclockwise heading on the roundabout). I'm guessing that the culprit is a train we don't even see in this picture, but was present at just the right moment to force this train to re-path. Again, since the track size is small enough relative to train length, I think that the tail end of that train is just over that track merger enough that he cannot path around to the east, so he is deadlocked from going north and east by himself. Remember, he's at a chain signal which will not allow the train to move past unless there is a clear path to the next rail signal, which, in this case, has been blocked by the train itself.
iceman_1212
Filter Inserter
Filter Inserter
Posts: 256
Joined: Wed Aug 17, 2016 9:49 am
Contact:

Re: My trains keep trying to loop...

Post by iceman_1212 »

A train is at risk of deadlocking in a roundabout that has chain signals regardless of block size / train size / etc. if it chooses to repath in the middle of the intersection, and, AFAIK, it is considered a bug to this day. See this thread and this post in particular for demonstration of a single-loco deadlocking in a massive roundabout with only two chain signals: viewtopic.php?f=41&t=26409#p232819

As you can see in aargha's big thread on train throughput, the "safe roundabout" has zero signals in it (and as expected, throughput is not great): viewtopic.php?f=194&t=46855
User avatar
Distelzombie
Filter Inserter
Filter Inserter
Posts: 336
Joined: Tue May 02, 2017 4:27 pm
Contact:

Re: My trains keep trying to loop...

Post by Distelzombie »

iceman_1212 wrote:A train is at risk of deadlocking in a roundabout that has chain signals regardless of block size / train size / etc. if it chooses to repath in the middle of the intersection, and, AFAIK, it is considered a bug to this day. See this thread and this post in particular for demonstration of a single-loco deadlocking in a massive roundabout with only two chain signals: viewtopic.php?f=41&t=26409#p232819

As you can see in aargha's big thread on train throughput, the "safe roundabout" has zero signals in it (and as expected, throughput is not great): viewtopic.php?f=194&t=46855
Wasnt there a change recently that could have solved this bug? Like a repathing every 5 second instead of 30s? Something in the trains changed in one of the recent versions definetely
Complete 2-Lane system as a Blueprint-Book! The perfect OCD reactor? Testing chained science lab efficiency Please use real prefixes and proper rounding!
iceman_1212
Filter Inserter
Filter Inserter
Posts: 256
Joined: Wed Aug 17, 2016 9:49 am
Contact:

Re: My trains keep trying to loop...

Post by iceman_1212 »

Distelzombie wrote:Wasnt there a change recently that could have solved this bug? Like a repathing every 5 second instead of 30s? Something in the trains changed in one of the recent versions definetely
This is the only change I've heard of (30s --> 5s) which I would think would result in roundabout deadlocks happening more frequently, since I have not heard anything re: changes in the conditions under which trains choose to repath. Maybe I'm misunderstanding?
Hoeloe
Inserter
Inserter
Posts: 30
Joined: Thu Jul 07, 2016 11:55 am
Contact:

Re: My trains keep trying to loop...

Post by Hoeloe »

In terms of fixing this situation fast and easy, why don't you build one big roundabout rather than four small ones?
Shokubai
Filter Inserter
Filter Inserter
Posts: 470
Joined: Mon May 02, 2016 3:17 pm
Contact:

Re: My trains keep trying to loop...

Post by Shokubai »

Or just make it a 3 way junction
Zavian
Smart Inserter
Smart Inserter
Posts: 1649
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: My trains keep trying to loop...

Post by Zavian »

To me the interesting thing is why are they trying to loop?
User avatar
Distelzombie
Filter Inserter
Filter Inserter
Posts: 336
Joined: Tue May 02, 2017 4:27 pm
Contact:

Re: My trains keep trying to loop...

Post by Distelzombie »

I had this question before.
Kelderek wrote:The reason for this specific train trying to loop is probably due to a previous train in the area which may have blocked one path and this train then tried to find an alternate path (hence the counterclockwise heading on the roundabout). I'm guessing that the culprit is a train we don't even see in this picture, but was present at just the right moment to force this train to re-path. Again, since the track size is small enough relative to train length, I think that the tail end of that train is just over that track merger enough that he cannot path around to the east, so he is deadlocked from going north and east by himself. Remember, he's at a chain signal which will not allow the train to move past unless there is a clear path to the next rail signal, which, in this case, has been blocked by the train itself.
Makes sense to me.
Complete 2-Lane system as a Blueprint-Book! The perfect OCD reactor? Testing chained science lab efficiency Please use real prefixes and proper rounding!
iceman_1212
Filter Inserter
Filter Inserter
Posts: 256
Joined: Wed Aug 17, 2016 9:49 am
Contact:

Re: My trains keep trying to loop...

Post by iceman_1212 »

Zavian wrote:To me the interesting thing is why are they trying to loop?
They are looping because they are repathing in the middle of the roundabout because of the chain signals. See my post above.
Zavian
Smart Inserter
Smart Inserter
Posts: 1649
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: My trains keep trying to loop...

Post by Zavian »

@Distelzombie: What you quoted doesn't make sense to me.

Note that because of the chain signals on the entrance to the roundabouts, the train should not have entered unless it had reserved it's route through the roundabout. Hence if what you quoted is correct, then for it to be stopped where it is, must have decided to re-path after entering the intersection, which also makes no sense to me.

@iceman : repathing in the middle of an intersection because of chain signals makes no sense to me. I fail to see why chain signals should cause a moving train to repath. There should be no need to repath whilst moving, and especially not whilst in an intersection. (Unless something else is somehow making the old path invalid by disabling/removing a station or something. And removing/disabling a station whilst a train is en-route to it is potentially a case of shooting yourself in the foot).

If the game did decide to repath whilst moving, then it absolutely should not allow a moving train that has passed a chain signal, and entered an intersection (or is moving too fast to stop and hence is committed to entering that intersection), but has not yet passed the regular signal that marks the end of the intersection, to give up it's already reserved path through those block(s), and pick another path if it cannot reserve the whole path through the intersection. That is enough more programmer work that it would be much simpler to simply limit repathing to stationary trains and any trains whose path somehow becomes invalid from someone disabling a station/mining track etc. If the game wants to be able to repath moving trains in an attempt to optimise throughput, then simply require that the new path has to start after a regular signal or after the last already reserved block of the existing path. ie after a point where the train could have come to a sensible stop.
iceman_1212
Filter Inserter
Filter Inserter
Posts: 256
Joined: Wed Aug 17, 2016 9:49 am
Contact:

Re: My trains keep trying to loop...

Post by iceman_1212 »

Zavian wrote:@iceman : repathing in the middle of an intersection because of chain signals makes no sense to me. I fail to see why chain signals should cause a moving train to repath. There should be no need to repath whilst moving, and especially not whilst in an intersection
exactly, which is why the thread that i linked is part of a bug report.
User avatar
Distelzombie
Filter Inserter
Filter Inserter
Posts: 336
Joined: Tue May 02, 2017 4:27 pm
Contact:

Re: My trains keep trying to loop...

Post by Distelzombie »

Zavian wrote:@Distelzombie: What you quoted doesn't make sense to me.

Note that because of the chain signals on the entrance to the roundabouts, the train should not have entered unless it had reserved it's route through the roundabout. Hence if what you quoted is correct, then for it to be stopped where it is, must have decided to re-path after entering the intersection, which also makes no sense to me.

If the game did decide to repath whilst moving, then it absolutely should not allow a moving train that has passed a chain signal, and entered an intersection (or is moving too fast to stop and hence is committed to entering that intersection), but has not yet passed the regular signal that marks the end of the intersection, to give up it's already reserved path through those block(s), and pick another path if it cannot reserve the whole path through the intersection...
I was always saying its a bug. The explanation why it happens just describes it as such. It does make no sense.
Complete 2-Lane system as a Blueprint-Book! The perfect OCD reactor? Testing chained science lab efficiency Please use real prefixes and proper rounding!
Post Reply

Return to “Gameplay Help”