4-way intersections: Throughput and deadlocks [image heavy]

Smart setups of railway stations, intelligent routing, solutions to complex train-routing problems.
Please provide - only if it makes sense of course - a blueprint of your creation.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by impetus maximus »

Zavian wrote:Also I'm curious to know whether the train fixes in 0.15.27 have effectively fixed the deadlocks with roundabouts.
there has been a fix for roundabouts for a long time.
don't use them.
Zavian
Smart Inserter
Smart Inserter
Posts: 1649
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by Zavian »

Typically I use double headed trains. But I have played on multiplayer servers which used roundabouts. And I have never seen a roundabout cause an actual problem. But aaargha has rated them "D - Can deadlock if a train changes path in the intersection" so I'm curious if the fix in 0.15.27 changes that.

Also I don't consider "Don't use them" to be a fix, just a workaround.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by impetus maximus »

the only reason i can see using a roundabout is to have a train turn around and go back the direction it came from.
which you don't need if you send the train in the right direction to begin with.
User avatar
Nexarius
Filter Inserter
Filter Inserter
Posts: 275
Joined: Sat May 09, 2015 7:34 pm
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by Nexarius »

Roundabout still don't work because train sometimes decicde to make a 270° turn and cant move because they are blocking themselves.
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Jun 14, 2015 8:14 am
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by Tallinu »

So I randomly stumbled across this thread somehow, and was rather tickled when I realized one of my designs was at the top of the two-lane A list and another was in second place. :D
db48x wrote:Nice. I just used your map to test an intersection. I tested the 4-lane variant of the Cross intersection, as posted to imgur by tallinu at http://imgur.com/a/CxXxd, and got 55 trains/minute over 15 minutes. As I had suspected, the modifications to make it a 4-lane intersections make it worse than the 2-lane Cross, which was measured at 58 trains/minute.
Very interesting! Not a huge difference but the fact that it gets worse instead of better is surprising. But that's what this kind of testing is for! ;)
aaargha wrote:I've been meaning to test the ones in that album, or at least the windmill one, since I was linked it a few days ago.

I'd have guessed that it would perform about the same in 2-lane and 4-lane configurations, which I guess it kinda does, though from your screenshot it kind of looks like the entry/exit part is incorrectly implemented, the train in the outer lane looks like it's waiting in the wrong spot and blocking the inner train from using straight/left turn parts, but it's pretty hard to tell from the map view.
Any advice you could give on "correct implementation" of the entry/exit part of the 4-lane configuration would be appreciated, as I'm not really certain what the problem is. I had originally been considering leaving out some of the lane-switch pieces so that the inner and outer lanes would have different turning options (outer lane could make a non-crossing turn or go straight, inner lane could only make a crossing turn), thinking that this would ensure that trains would approach the intersection while already being in a lane appropriate to the direction they needed to go and would avoid lane-changing shenanigans slowing it down. I can't remember exactly why I didn't post that version, but I know doing that would require either a lane-change option further back along each approach (if there's a long straightaway) or at/after the exit from the previous intersection (if it's relatively nearby) for full connectivity. I don't know whether this approach would help or harm throughput, though based on examining the "Flower Mk3" design, I suspect it would help.

I am curious what the test results would be for the "Fairly compact 4-way" (listed after the one you've catalogued as "pleasing") though. I'll have to see if I can figure out how to use your test setup... (Edit: And it refuses to load with creative mode installed... I've posted details in the other thread.)


Edit: I'm also curious if the High-Performace Double Threeway two-lane design in your list could have its throughput improved by making the connection between the two junctions a full four lanes (since there are already four tracks approaching that connection from either direction) so that certain paths didn't require merging back onto the center pair of lanes. (It would still need all the existing track pieces as lane-switchers to allow full connectivity, of course.)
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Jun 14, 2015 8:14 am
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by Tallinu »

I got your testbed map running on a copy of a version of factorio that doesn't break Creative Mode, finally figured out how to get Automatic Train Deployment to once again recognize the template trains after modifying their length, and have been playing around with it... A LOT... expanding and modifying my previous designs, hoping to push them to even greater heights of dizzying train ballet! Along the way, I discovered several interesting things.

1. Making 4-lane interchanges that perform worse than 2-lane interchanges is easy.

2. Making 4-lane interchanges that perform better than a good 2-lane interchange is hard.

3. Trying to convert a good 2-lane interchange into a good 4-lane interchange? Might as well just start over from scratch instead!

4. Resizing an interchange to handle larger trains invariably reduces its throughput.

Simply a result of each individual train taking up a larger section of track and, as a result, proportionally fewer trains cross a given length of track in a given amount of time. The number of cargo wagons moved per minute may be a more useful metric to compare intersections set up for different sized trains, and some simple multiplication and division will convert TPM to WPM if you know how many wagons were on the trains used in a given test. (It might also be interesting to measure, for instance, the wagons per minute throughput of a 2-4 versus a 1-5 or a 1-4-1 on intersections spaced for six cars, or a 2-6-2 versus a 2-8 and a 3-4-3 for a ten car spacing.)

5. And finally, 2-lane interchanges for shorter trains like the default 2-4's on your test map can go surprisingly fast when built to sufficient scale and with enough ingenuity.

The two designs of mine that turned out the best performance in your tests were in the 53 to 62 trains per minute range. Now... I've just "finished" putting some polish on an upgraded and evolved one that spits out 86 to 88 TPM (on P1 and P3, for LHD), which seems to be getting pretty close to the limit of the rate at which the spawners can produce trains (since they have to accelerate and clear the station before another can spawn)! The only thing that seems to slow down this interchange is having the randomly picked routes from each spawner all converge on one exit in a big cluster from time to time, and even then it tends to mostly catch up once the RNG evens out! Just sitting here and watching this thing run on P3 traffic distribution is almost mesmerizing, the way the central traffic regularly alternates between crossing one way and then the other with the turns going in both directions around the outside of it...

So without further ado, I present the Windmill Mark 2... or perhaps the Pinwheel? This thing measures 164 track tiles across in each direction (or 328 small tiles), and consists of 1.7k track, 192 regular and 36 chain signals. (This is for left-hand drive, although it should be possible to convert... but I have no plans to do so myself.)
Screenshot
Blueprint String
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by impetus maximus »

Tallinu wrote:I got your testbed map running on a copy of a version of factorio that doesn't break Creative Mode, [snip]
creative mode mod fix posted here.
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Jun 14, 2015 8:14 am
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by Tallinu »

Thanks, I'll look into that.

And it looks like I've figured out how to get decent performance out of a four-lane interchange. Well... I say "decent" but I've been comparing my other attempts to my two-lane designs, and as a result finding them rather underwhelming for the significant extra work and materials that were required.

The test results when I fired this thing up blew me away. Around 157 trains per minute on P3... and 170 on P1. (With the default 2-4 trains.) Did I just trounce everything but the 8-lane Flower Mk3? With a 4-lane? :shock:

I'll just leave this here, in case anyone else wants to try it... or check my test results! :D

MultiCross 4-lane LHD for 6-car trains
Screenshot
Blueprint String
User avatar
db48x
Fast Inserter
Fast Inserter
Posts: 106
Joined: Wed Mar 13, 2013 12:15 pm
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by db48x »

Tallinu wrote: The test results when I fired this thing up blew me away. Around 157 trains per minute on P3... and 170 on P1. (With the default 2-4 trains.) Did I just trounce everything but the 8-lane Flower Mk3? With a 4-lane? :shock:

I'll just leave this here, in case anyone else wants to try it... or check my test results! :D

MultiCross 4-lane LHD for 6-car trains
That's _really_ nice-looking; I'm going to try it out.

Also, I like your idea of wagons-per-minute rather than trains-per-minute. It would be much clearer when planning.
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Jun 14, 2015 8:14 am
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by Tallinu »

Thanks! :D

I just got done resizing this thing for 14 car trains like 3-8-3 or 4-10 layouts. Initial test with the latter counted 86 TPM on P1, which scores 860 wagons per minute. Since 170 TPM was with 4 wagons for 680 WPM, that's 26% more cargo moved, but my word this thing is gargantuan at that scale! Even though I removed one of the extra buffer zones which I've decided is unnecessary in the process. I can't even put the entire blueprint string in a post here because the post ends up being 930 characters over the limit of 60,000. :lol:

Also, a 4-10 only moving 26% more cargo than a 2-4 implies that a 3-8-3 (lacking the extra two cars to give it 25% more cargo) would be no better than a 2-4 in terms of cargo throughput, at least on an interchange like this one. Some system where trains aren't having to stop to avoid other trains might fare better but if you had a system like that you wouldn't be using an interchange like this! :) I think part of the problem is that none of the trains can get anywhere near top speed, with 2.5 wagons per active locomotive compared to 2.0 with a 2-4, and a 3-8-3 would suffer even more from reduced acceleration since it would be dragging the weight of 14 wagons using just 3 locomotives for 4.66 per loco (nearly double the 4-10, and more than double the 2-4's ratio).

MultiCross LHD 4L 14C
Screenshot
User avatar
nucleargen
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Sat May 07, 2016 4:51 pm
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by nucleargen »

Not found in tested 4-lane intersections:
Image
Found in Steam guide 4.5 Guage Rails
Blueprint book: pastebin
The brightest future in the center of a nuclear explosion...2003©nucleargen
TBTerra2
Inserter
Inserter
Posts: 49
Joined: Wed Apr 05, 2017 12:57 pm
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by TBTerra2 »

Tallinu wrote:The test results when I fired this thing up blew me away. Around 157 trains per minute on P3... and 170 on P1. (With the default 2-4 trains.) Did I just trounce everything but the 8-lane Flower Mk3? With a 4-lane? :shock:
I took your idea and turned it up to 11 (well 8 actually). its huge and while completely unoptimized is getting 257ish on P1 (it can be pushed higher as i could get 235 with only 6 lanes). also by scaling down the idea you can make a quite slim (although rather long) 2lane with a p1 throughput of 90 and p3 of 83, again not fully optimised

ill try and get some pictures and blueprints once ive cleaned them up and got some numbers from longer tests
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Jun 14, 2015 8:14 am
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by Tallinu »

TBTerra2 wrote:I took your idea and turned it up to 11 (well 8 actually).
:lol: Sounds great, looking forward to the screenshot!
TBTerra2 wrote:its huge and while completely unoptimized is getting 257ish on P1 (it can be pushed higher as i could get 235 with only 6 lanes). also by scaling down the idea you can make a quite slim (although rather long) 2lane with a p1 throughput of 90 and p3 of 83, again not fully optimised
The first one I posted here a few days ago is a two-lane with similar performance and "slim" profile to what you've stated (although I haven't revisited it since doing the four-lane, and I could probably improve it now). I don't know whether it's possible to get more than 80-90 TPS out of a two-lane using 2-4 trains that the map comes with, since the acceleration time required for them to clear the station and allow a new train to spawn is a limiting factor. It would be interesting to see how your design compares to it.

I don't think six or eight lanes of traffic are that plausible or even necessary when you think about the amount of traffic that an interchange like this manages to squeeze through four lanes (or even two). The only reason to use more lanes is to increase the throughput, but you can't get that many trains onto or off of all those tracks if your highest-traffic interchange can't handle them. As a result, It seems to me that interchange optimizations like these should come before track expansion, allowing you to make the most of the tracks you have.

But when people find that their tracks are clogging up and can't handle the traffic, their first thought seems to be "add more tracks." But they stick with the terrible-throughput compact interchanges that are the source of the problem (without even seeming to realize that they ARE the source), so the upgrade doesn't actually solve anything, and sometimes even makes the situation worse due to more trains blocking each other's paths as they cross or stopping the traffic behind them as they wait to cross. The more lanes you have, the more important it is to avoid that.

On the other hand, figuring out how to make a design handle that sheer weight of traffic on that many lanes is without a doubt a good way to figure out how to speed up "smaller," more common (and realistic) sizes as well! I certainly learned something from observing the Mark 2 and 3 "flower" designs, and was able to combine that with the right turn crossing over from my Windmill design to keep those trains out of the central crossing's cycle, reducing it from a 4-cycle at worst -- each train possibly having to wait for trains to cross along three other paths before getting a chance to go -- to a 2-cycle, ensuring that through-traffic only ever had to wait for perpendicular through-traffic, and I think those optimizations combined are what got the two and four lane interchanges I posted up to such high throughput rates. It will be interesting to learn if there are other ways to improve beyond that...
nucleargen wrote:Not found in tested 4-lane intersections:
This looks interesting. At a glance, it allows U-turns (so people who avoid loops won't want to use it), and segregates those and right turns onto the right lane, while allowing only the inner lane to continue through or turn left, with the option to swap to the outer lane. All turns end up on the outer lane, making it impossible for them to do anything but turn right or U-turn at the next one of these they encounter unless lane swap sections are included between these. Testing it as a four-lane intersection would require adding additional lane-changers before and after each side of it so that trains entering from each side can actually reach all six possible destinations, which is most likely to put it in the same throughput range as two-lane interchanges or the more "compact" 4-lanes.
evildogbot100
Fast Inserter
Fast Inserter
Posts: 152
Joined: Sun Dec 18, 2016 3:02 pm
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by evildogbot100 »

Hello, I tried 2-lane compact at aarghaa's train test save but on running it for 15 mins, I got nowhere like 40-41 trains/min as advertised. I consistently only get 31-32 trains/min even sub 30 sometimes, has anyone else find the same result?
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Jun 14, 2015 8:14 am
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by Tallinu »

TBTerra, you got me wondering... and I just had to try it. ;) The result is the ridiculous behemoth of which I have attached a picture below.

Running a throughput test on this thing drops my UPS to 45, or "only" 55 if I zoom way in so I can hardly see anything at all, just from how many trains are driving everywhere! I left the test running while I ate dinner, and when I came back over 45 minutes and 16k trains later, it was showing a (P1) rate of 344 trains per minute. :shock:

At something like 411 track tiles wide, this thing overflowed the grey tiled area by at least 25% (although the tiles aren't quite centered so it varies). 19K straight rail, 1.5k signals and 816 chain signals. It has a lovely branching pattern that reminds me of fractals although I don't think it qualifies as one, but you can see the progression from single lanes crossing, to two lanes, to four, and then eight, as you approach the center.
Map Screenshot
Also, I added a couple of profiles to my local copy of the map testing world, set up for testing three-way junctions and lane-change areas (although it only supports four lane tracks -- other sizes would require crating additional separate profiles), and put together the lane-changer design I'd been planning based on my recent experience working on these big junctions. This four-lane version sized for the map's default 2-4 trains supports over 80 trains per minute (40+ in each direction), even with a 50% chance of each incoming train needing to swap from its starting lane to the other lane. This compares favorably to the 6-car 4-lane version of MultiCross that I posted a few days back, if you take into account the fact that only two directions are being measured instead of four -- I believe it should easily keep up with practically any four-lane junction.
Screenshot
Blueprint String
Last edited by Tallinu on Mon Jul 17, 2017 7:49 am, edited 4 times in total.
User avatar
db48x
Fast Inserter
Fast Inserter
Posts: 106
Joined: Wed Mar 13, 2013 12:15 pm
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by db48x »

Tallinu wrote:TBTerra, you got me wondering... and I just had to try it. ;) The result is the ridiculous behemoth of which I have attached a picture below.

Running a throughput test on this thing drops my UPS to 45, or "only" 55 if I zoom way in so I can hardly see anything at all, just from how many trains are driving everywhere! I left the test running while I ate dinner, and when I came back over 45 minutes and 16k trains later, it was showing a (P1) rate of 344 trains per minute. :shock:
Wow. Looking at the screenshot, that looks fairly close to the capacity of the test setup; there aren't many trains waiting around.
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Jun 14, 2015 8:14 am
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by Tallinu »

evildogbot100 wrote:Hello, I tried 2-lane compact at aarghaa's train test save but on running it for 15 mins, I got nowhere like 40-41 trains/min as advertised. I consistently only get 31-32 trains/min even sub 30 sometimes, has anyone else find the same result?
That's odd, I tried it for a few minutes and actually saw a rating of up to 49 TPM -- more than advertised instead of less!

Do you have plenty of signals along the tracks leading to the junction? Long lengths of track without signals can slow down trains, I usually place one every two car-lengths, or at least once per train length. Are you rotating the inserter after you start seeing trains arrive at the counters, rather than doing it the moment you toggle the green constant to begin sending trains? The latter would result in some amount of dead lead-time being included in the averaging, which could bias it toward displaying a lower throughput than you're actually getting.
db48x wrote:Wow. Looking at the screenshot, that looks fairly close to the capacity of the test setup; there aren't many trains waiting around.
Yeah, I have a feeling "capacity" for the 2-4 trains that the map comes with is approximately 90 trains per minute per lane, based on observations of my various designs -- when a good two-lane is being fed evenly distributed traffic on P1, that's about what it seems to cap out at. I should try just having a straight track's throughput measured to be sure, but I don't think the spawners can pop them out any faster than that since the trains take time to accelerate and the last car has to clear the station before another will spawn.
User avatar
db48x
Fast Inserter
Fast Inserter
Posts: 106
Joined: Wed Mar 13, 2013 12:15 pm
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by db48x »

Tallinu wrote:
evildogbot100 wrote:
db48x wrote:Wow. Looking at the screenshot, that looks fairly close to the capacity of the test setup; there aren't many trains waiting around.
Yeah, I have a feeling "capacity" for the 2-4 trains that the map comes with is approximately 90 trains per minute per lane, based on observations of my various designs -- when a good two-lane is being fed evenly distributed traffic on P1, that's about what it seems to cap out at. I should try just having a straight track's throughput measured to be sure, but I don't think the spawners can pop them out any faster than that since the trains take time to accelerate and the last car has to clear the station before another will spawn.
90 per minute per lane? That would be 90*4*4=1440 TPM. Perhaps you Mean 90 per minute from each of the four arms?
mrvn
Smart Inserter
Smart Inserter
Posts: 5884
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by mrvn »

aaargha wrote:
lockthatpl wrote:I'm using the little arrow that points on the top right corner in my blueprint book is this right ? :o Or is there another manipulation to do that i'm not aware ?

Maybe this one will work (this one is from the blueprint alone, not in a book) :
That one worked, I think you can do individual blueprints from a book if you click the arrow when editing a blueprint. The provided signalling is indeed faulty, the picture below is after about 3 minutes of traffic. It was pretty funny to see how close it got to deadlocking a few times but always seemed to right itself at the last second, until it didn't :). I've added an entry with corrected signalling as "Wide B", as it's basically the same as "Wide".
Entries should always use chain signals before the first split or crossing. Seems there are no signals at all before the first splits and then full signals in the middle.
User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 143
Joined: Sun Jun 14, 2015 8:14 am
Contact:

Re: 4-way intersectios: Throughput and deadlocks [image heavy]

Post by Tallinu »

db48x wrote:90 per minute per lane? That would be 90*4*4=1440 TPM. Perhaps you Mean 90 per minute from each of the four arms?
I meant neither of those, although the difference from the first is still a factor of four. :)

When talking about how many lanes a junction has, you don't generally count up all the entrance and exit lanes and add them together, not even if your junction doesn't have the same number of lanes on every side (like one that has four lanes on one end but two on the others, meant for a location where a lot of traffic branches out from and returns in one particular direction). You talk about how many tracks go in and come out in each direction.
More details related to the test map
So when I said per lane, I meant it in that commonly used sense (or "per set of one-way input/output lanes in use by the junction"), ie, "it's a 2-lane junction," not in the "per spawner/exit pair" sense, which would be one quarter of that, about 22.5 TPM, instead. So, if a 2-lane junction that passes trains as fast as the spawners produce them can get up to 90 TPM, then a 4-lane could be up to 180, and an 8-lane, up to 360. That's 90 per lane (of a four-way junction -- when testing a three-way or some sort of two-way pass-through like the lane swapper I posted, the expected values would be around 3/4 or 1/2 of that). And, of course, different train lengths and speeds would result in different maximum rates.
Locked

Return to “Railway Setups”