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.
Locked
aaargha
Filter Inserter
Filter Inserter
Posts: 329
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by aaargha »

gyro2death wrote:Okay figured it out. I think your base BP string should contain the 3 rail signals and the wire needed to start the thing (with the spawning stop conditioned only to enable when the signal is green).

Second the key here lies in how to name the stops and assign stops between the trains.

IMO you have 3 stops and two trains.

First stop is the "train" stop, which is where your train to be used for testing stops at, the condition for leaving must also never be met. It's second stop is the place you want it to go on the main track network after i spawns at the...

Second stop, which is the "starting" stop. This is where trains will spawn from, and where you'll want to assign your second train without fuel to go to. It only needs to be sent to this starting stop and nothing else needs to be set.

The third and final stop is the end goal. Pretty simple.

I got hung up on figuring out the stop mechanics of which train I was to assign to where. And setting up the rail signals and configuring the stop to be 'enable disabled'. I thought I was missing a setting on the train selection stop.
As far as I can tell all the things that are needed, and can be blueprinted, are included in the blueprints for each example? The reason they are not included in the first example is that they are not needed to get the system to work, they should be in the second blueprint though.
gyro2death wrote:Side note, your testing map works great and I can now see why you thought adding a rail signal at the start wouldn't help, however, most train networks don't have rail signals every wagon length so it does help in that case. I created my own slight train testing map before I started using your save and found out that different intersections have a 'lane bias' which allows for traffic to flow out through certain lanes more often, which resulted in a network of 24 trains being nearly completely stuck behind 2 of the 4 intersections after nearly 12 minutes. This is something yours doesn't simulate as trains don't have to try to reenter the intersection. This ended up slowing the throughput in my own test down due to trains not coming from the other intersections as frequently since they ended up being empty. Overall though I find your testing map amazingly flexible for different trains of any length and setup as well as RHD and LHD all in one. Marvelous design work.
Yeah, that signal is already included when testing. I usually don't add it to the blueprint as, depending on network layout and train sizes, it may not always be safe to add.

The problem of lane bias is the same as what Miravlix discusses on page 5. And I believe you are correct in saying that it will be much more noticeable in a more "lifelike" situation, it still happens in the new test system but it does not have nearly as much of an impact as the trains will not run out. I do believe it is mitigated further by the fact that, in the new tester, after a while the stuck train will have the lowest train ID, which I believe is used to decide which train gets access first to a block two trains are waiting for.

It is an interesting problem, and I'd like to try to add some kind of details on it in the tests, but currently I don't think enough is known about it that I'd be confident doing so. It may be possible to estimate which lanes will have problems by counting how many other lines they need to cross to progress to the next buffer, and how many of those lines can overlap traffic. For example: If you manage to build an intersection that can buffer a train after every crossing I don't think this would ever be a problem, but I don't know for sure. I also currently don't know of a good way to prove that theory, maybe comparing the number of trains that are able to enter the intersection from each lane? It may also be the case that some designs can be fixed by adding circuit controlled traffic lights, though I'm not sure how these would need to be designed to make sure it will work.

gyro2death
Burner Inserter
Burner Inserter
Posts: 14
Joined: Mon Aug 29, 2016 3:14 am
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by gyro2death »

aaargha wrote:As far as I can tell all the things that are needed, and can be blueprinted, are included in the blueprints for each example? The reason they are not included in the first example is that they are not needed to get the system to work, they should be in the second blueprint though.
Maybe it's just because I got confused by the second picture and diagram but I thought it was missing pieces since second image shows a far more detailed setup. That combined quite realizing which trains need which stops made it so I couldn't figure out what went wrong until I saw the full example.
aaargha wrote:It is an interesting problem, and I'd like to try to add some kind of details on it in the tests, but currently I don't think enough is known about it that I'd be confident doing so. It may be possible to estimate which lanes will have problems by counting how many other lines they need to cross to progress to the next buffer, and how many of those lines can overlap traffic. For example: If you manage to build an intersection that can buffer a train after every crossing I don't think this would ever be a problem, but I don't know for sure. I also currently don't know of a good way to prove that theory, maybe comparing the number of trains that are able to enter the intersection from each lane? It may also be the case that some designs can be fixed by adding circuit controlled traffic lights, though I'm not sure how these would need to be designed to make sure it will work.
Yeah, creating a more realistic testing environment would most likely remove the incredible flexibility your system has in it. I do however think figuring out which lanes end up have better priority balance (or even how to bias it for one lane) would be quite useful for complex train networks. Still thanks for the testing map and mod. If I ever do upgrade my whole setup to 4 lanes I'll be sure to make more use of it. Currently it looks like 40ish is about as good as 2 lanes get without insane quad-lane input balancers that take up more space then my whole base. Though I'm kinda tempted to try to create a compact dual input buffer, but I really don't have any space inside my current base to expanding the intersections.

RulerOfHeck
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Jun 19, 2017 8:33 pm
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by RulerOfHeck »

Hello. I am unable to get your savefile to work with my intersection; no trains spawn after I replaced everything in the grey area. That's all it should take, right? and switch the green combinator?

Could you try it for me? It's a 1 lane cross that requires a train length of no more that 5u.

(I also have a 8-way 1 lane "roundabout" that I'm eager to try - it has 88 sections and requires 3k rails to build :) )

Code: Select all

0eNqlnduOFUcSRX/F6mewKu9Z/MrIGgFu2S1BG0HjGWTx79MNpw6XiaTXOjxZvrC8qzIj60Tkzsh/rl68en/95u3N7d3Vs3+ubl7+dfvu6tm//rl6d/PH7fNXD//s7sOb66tnVzd316+vnlzdPn/98Hdvn9+8uvr45Orm9vfr/149Sx9/e3J1fXt3c3dz/fnPf/qbD/++ff/6xfXb+//g/Cdfvn/79/XvTz8Bnly9+evd/Z/56/bhf3TPedqeXH24/0tP9+zfb95ev/z8L9vHJ/+HzN+Iefryz+c3t09PsgPwrwe6/to+Brhyxr27uwf+8efdSmM9QBGmsgct8XPWgNiosPwjXf3bt7V6T+Wb1/SotqFfWo7ETfuIIWVnj/h0HM/Y9u+fMQXYtOmH3CJ5KdmnjDFq3rf1s5YIzqNgnrj9W+qIqFVTJ9Da7LjcUyNOl+OywOBY6PEzRmtcmhbawYTe8Yt7mPufsPXxUc6bx/bHhzmny9b51uN1Pmf4KTot0a08vgxm/fG4f/KIA78eKZYWfiXt52OhrJtRKN8MwuOvD4fOYtEJH3xaaH08dLIIneN95sdDp2weWx8PnZL0tAx/O5Rs51CMwVGyWnaicS5VU/PjA134xyUd724DA909NoOB1r/DWvgLqtgfYgsMjpJVkEQDXTdN3R4f6MpjJJ2+sXU+PtA1a+z3aqOBrvxDk4XYqqdP+NO04qDZ4kcOh73bR0Yvckip37/HcC7p8Ilf437Zt3Yj39rGo6jyQWrJ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+5/mHX9Ivr57fXv9yCL7/939fv333uVlqrbnN2e7TtI8f/wd6wTvk

aaargha
Filter Inserter
Filter Inserter
Posts: 329
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by aaargha »

RulerOfHeck wrote:Hello. I am unable to get your savefile to work with my intersection; no trains spawn after I replaced everything in the grey area. That's all it should take, right? and switch the green combinator?

Could you try it for me? It's a 1 lane cross that requires a train length of no more that 5u.

(I also have a 8-way 1 lane "roundabout" that I'm eager to try - it has 88 sections and requires 3k rails to build :) )
Seems to be working for me at least, I'll give it a proper test in the evening once I've adapted it to 6-cart trains. If no trains spawn at all it may be that you've not selected a valid profile, P should be 1-3. If they spawn but have no path there are probably some leftover signals that make the tracks one way in the wrong direction somewhere, or some two-way signals that are not properly aligned. Checking around the area where the previous intersection joined the straight parts is usually a good idea. Or it could be that you've not hooked it up symmetrically.

aaargha
Filter Inserter
Filter Inserter
Posts: 329
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by aaargha »

RulerOfHeck wrote:Could you try it for me? It's a 1 lane cross that requires a train length of no more that 5u.
Added a 6-cart adaption as "Buffered compact attempt". It will do even better if you offset the left/right turns a bit, compare compact to compact attempt, so as to avoid the giant block at the entrances/exits.

RulerOfHeck
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Jun 19, 2017 8:33 pm
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by RulerOfHeck »

Thank you! Annoying that it did not perform as top one :(

I like that you invented the exact same T-junction as I did :) I considered using it as a 4-way junction but it's too large. For a really compact junction based on the same principles as these, try this one:

Code: Select all

0eNqdndFuGzkMRX9l4ec4GFHSSMqvLIpF2hqtgdQp0qS7RdF/X7sZZxODXN/jp6JpfcKRREpzSdE/V+/vnjZfH7a7x9XNz9X2w/3u2+rmz5+rb9tPu9u7w88ef3zdrG5W28fNl9XVanf75fC3h9vt3erX1Wq7+7j5Z3WTfl05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bqFStYSvVqjXsTMVqDduoWq1hO5WrNexgvRZSFjy0YScK+sVRJwowhtoXnD6iu8uAfg1gpetFC2SOQQ0DWJB6AwfiPXo7B+LqrUM9QKMOKAhIVNDeYRHZknBt13BZg99gxGhdQ4TJUJ5Mwu1rk2sbln5EKWgxSc9lfh8b6/BgFmEa6kCUlM6gnbb88TsHWYeF3AFm0B3DgqaecMeIMLSrj98eywZM4kQY3KbNb2dmgy7siAMXdoShbdoiDm7T5rfDs0Ezlz4nT7BNW4ShbdoiDm6j6bdTzLj1QcSBicgIQ9toRhzcRjMHzYBp+4+IA2/ZRBjaRjPgJHwvLehSixvhRxx4CIkw9MZMxMHxOWgHnGh8jjgwPkcYGp8jDo7PQTvpRONzwDEYnyMMjc8Rx1jz95LOC8LZaKyOOorDWB1hKmn+fvqE1UXS9mdBC3eDKYMIQ4/Ufpf8TDvTBxhwZX9JBAqdIDO4sb9QhZfTnA196crpt+k0l0nXv//lFzmjb/o5Nc1cJLxUEllGi6ZmZdgahApNUnPubH6H/7zjooseJUhn5oJLCoMvOYAvnREGfbtPEd7y82la+VyqsVQl15jVhPIxTV1mJfeScXrZ/wanXODpJ8LQw7z/hVy59IvS3Ye7VOeF6Exv0gdG1onWCFjgVbhVfvX3L9oqP8LkS3Luv5/uxBHeXT1/q97Nqy/hu1rd3b7f3O1/Vv6+/fHHw/3T7uPt+/unw7983zx8e563Uqz2Xuexd/x/AWzCdwA=
It is, unfortunatelly, 5u (1 loco 4 wagons) I'll try your save game again this weekend, I want to try my 8-way before I make it public.

BTW, by "6 cars" do you mean 2 locos 4 wagons, as in your save game? I tried to reduce the train length, perhaps that is what caused my problems.

aaargha
Filter Inserter
Filter Inserter
Posts: 329
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by aaargha »

RulerOfHeck wrote:Thank you! Annoying that it did not perform as top one :(

I like that you invented the exact same T-junction as I did :) I considered using it as a 4-way junction but it's too large. For a really compact junction based on the same principles as these, try this one:

*Blueprint*

It is, unfortunatelly, 5u (1 loco 4 wagons) I'll try your save game again this weekend, I want to try my 8-way before I make it public.

BTW, by "6 cars" do you mean 2 locos 4 wagons, as in your save game? I tried to reduce the train length, perhaps that is what caused my problems.
That design deadlocks once you get four trains turning left into it, see image below, so I will not try to test its throughput as that will be way too much clean-up once it locks up. To make sure that a loop will not deadlock you need to ensure that it is impossible for every waiting area to become occupied at the same time, this usually involves some pretty awkward,throughput reducing, signalling, see "Buffered roundabout" for an implementation that is mostly deadlock free.

Yeah all tests are done using 2-4 trains on rocket fuel, there used to be a blurb about that in the OP but I see now that it did not survive the rewrite for the new test bench.

If you have changed the train size you also need to make sure to put the template trains back in auto so they actually wait at the station and are not just sitting by it.
Attachments
regular.png
regular.png (1.03 MiB) Viewed 13193 times

Rapier31
Inserter
Inserter
Posts: 34
Joined: Mon Apr 25, 2016 4:00 pm
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by Rapier31 »

Here is yet another 4 lane 4 way I made. Can you test it please? There is a problem I'm aware of with left turns. There isn't enough room for a signal in the triangle area, but I don't feel like building it bigger. Its working very well for me at the moment.
Attachments
4 Lane 4 way BP.txt
(8.47 KiB) Downloaded 291 times
4 Lane 4 way map view.png
4 Lane 4 way map view.png (305.81 KiB) Viewed 13134 times
4 Lane 4 way overview.png
4 Lane 4 way overview.png (2.15 MiB) Viewed 13134 times
4 lane 4 way.png
4 lane 4 way.png (2.72 MiB) Viewed 13134 times

aaargha
Filter Inserter
Filter Inserter
Posts: 329
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by aaargha »

Rapier31 wrote:Here is yet another 4 lane 4 way I made. Can you test it please? There is a problem I'm aware of with left turns. There isn't enough room for a signal in the triangle area, but I don't feel like building it bigger. Its working very well for me at the moment.
Added as "Wavy".

Also added "Fresh cross MK2" and "Double wide bubble cross", the latter one is much more stable than its deadlock rating would imply.

In other news I might have to improve the throughput setup once again as I've managed to design a 2-lane crossing that has a throughput of 80+ and there are many times where at least one lane is not saturated. If anyone has some ideas for/links to a parallel acceleration setup they want to share I'd be very grateful.

Also a heads up that I'll be leaving civilisation for a few weeks starting next week, I'll take a look at any submissions made during that time when I get back though.

Xtrafresh
Fast Inserter
Fast Inserter
Posts: 103
Joined: Mon Jun 12, 2017 4:57 pm
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by Xtrafresh »

Awesome! thanks for the test, and I'm pretty happy with the result. I feel like I won something, lol.

AntiBlueQuirk
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Wed May 03, 2017 2:57 pm
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by AntiBlueQuirk »

I spent a silly amount of time getting this crammed in, but I'm pretty happy with it. It may look small, but every path actually has some buffer space (for 6 wagon trains). I haven't seen any deadlocks yet, and I was getting some pretty good results. It's a 2-lane, and it's also chunk-aligned, if you're into that sort of thing. (I am!)

I call it the Spinabout! (An earlier version was called the Squarewave, but it was a lot less twisty back then.)
spinabout.txt
(4.2 KiB) Downloaded 167 times

aaargha
Filter Inserter
Filter Inserter
Posts: 329
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by aaargha »

AntiBlueQuirk wrote:I spent a silly amount of time getting this crammed in, but I'm pretty happy with it. It may look small, but every path actually has some buffer space (for 6 wagon trains). I haven't seen any deadlocks yet, and I was getting some pretty good results. It's a 2-lane, and it's also chunk-aligned, if you're into that sort of thing. (I am!)

I call it the Spinabout! (An earlier version was called the Squarewave, but it was a lot less twisty back then.)
Added to the list with some slight signal changes. It does really well, if you're looking to improve it further there is a block (magenta) that is a bit too large, impossible to signal, linking two of the left and right turns, see first image. Two of the output blocks (black) are really long (straight north/south), if you can extend them a bit further they could become another buffer block which would make the straight paths a bit quicker.
too large block.png
too large block.png (245.08 KiB) Viewed 13068 times
strange size block.png
strange size block.png (540.64 KiB) Viewed 13068 times

AntiBlueQuirk
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Wed May 03, 2017 2:57 pm
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by AntiBlueQuirk »

Alright, so I worked on these problems a bit. I started with the first one, since it seemed easier.
aaargha wrote:...there is a block (magenta) that is a bit too large, impossible to signal, linking two of the left and right turns, see first image.
Turns out, you were correct, it was impossible to signal. So I ended up abandoning that, which I'll get back to later.
aaargha wrote:Two of the output blocks (black) are really long (straight north/south)
This was actually a known problem. With how the center twist was setup, I had to sacrifice space in one corner to make room for the buffer on the other. Originally, I thought there just wasn't enough room for another buffer there, and it would lead directly out of the intersection anyway, so I didn't really try that hard. I actually did manage to make it fit, but it still doesn't get used a whole lot.

The biggest change I made was to remove the offending left turns from the E/W tracks. Instead, they flow into and around the center now, instead of immedately turning left. There was enough space in the middle to make some extra room for them, and removing them from the outside relaxes the other tracks in the center a little. This design doesn't really seem to handle left turns very well, but then, I don't think there are many designs at this size that could say they do. Trains turning left from the east or west can sometimes take quite a while to make it through.

Anyway, here's v2 of the Spinabout!
spinabout2.txt
(4.27 KiB) Downloaded 169 times
I do hope I didn't forget any signals again.

aaargha
Filter Inserter
Filter Inserter
Posts: 329
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by aaargha »

AntiBlueQuirk wrote:The biggest change I made was to remove the offending left turns from the E/W tracks. Instead, they flow into and around the center now, instead of immedately turning left. There was enough space in the middle to make some extra room for them, and removing them from the outside relaxes the other tracks in the center a little. This design doesn't really seem to handle left turns very well, but then, I don't think there are many designs at this size that could say they do. Trains turning left from the east or west can sometimes take quite a while to make it through.

Anyway, here's v2 of the Spinabout!
Hmm, it seems like the left turn problems outweigh the fixes, at least for the traffic sets I'm using. It may be better than version 1 if you've planned the routes enough to have almost no trains turning left. I think this design also has one of those "when the starts align" 2-train straight-to-left soft locks on the E/W lines, though it requires the inner buffers to already be occupied, so this is more of "academical" interest.

Set 1: 44 Set 2: 51
Deadlock rating: B

I'll keep the first version in the OP as it seems better overall.

AntiBlueQuirk
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Wed May 03, 2017 2:57 pm
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by AntiBlueQuirk »

aaargha wrote:Hmm, it seems like the left turn problems outweigh the fixes, at least for the traffic sets I'm using.
Yeah, I was getting that too. It seems to do really well most of the time, but then occasionally and left-turner will come through and wait like a whole minute for the intersection to clear, traffic piling up behind it. You'd think the buffer would protect you from that, but there's usually another train that wants to turn left too. :roll:

I will poke it some more!

AntiBlueQuirk
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Wed May 03, 2017 2:57 pm
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by AntiBlueQuirk »

aaargha wrote:I think this design also has one of those "when the starts align" 2-train straight-to-left soft locks on the E/W lines, though it requires the inner buffers to already be occupied, so this is more of "academical" interest.
I think I might see what you mean here. Trains that enter simultaneously turning left from the north and south end up waiting on each other, but since they fit in the center buffers, as soon as one or both of them stop, the other can advance. The clearance on some of the buffers in here is really tight. The tail end of trains turning left from N/S are sitting on the signal that separates them from the block behind them, and crossing traffic behind it is incredibly close to clipping it.

Anyway, I made a 3rd version, but I think this is probably about as good as it gets. The upper end of performance on this one is pretty heavily luck based. If you get a train stuck a long time trying to turn left from the N/S, traffic is going to pile up behind it, and I don't think there's anything I can do about it. I was interested to see what would happen if i prioritized left-turning traffic, but Factorio doesn't really have a good way to prioritize traffic. (At least without circuit networks.) It would also be better if Factorio prioritized trains that have been waiting longer. (Is there a feature request for that?) All that being said, I think most of the issues with the intersection only occur when it it literally at capacity. I think as long as there's a little gap between trains, it might do better, because older trains will be able to get through.

So I think this is the final version. For now, anyway:
spinabout3.txt
(4.2 KiB) Downloaded 192 times
Also, I made a high precision timer for your throughput tester. It uses a little fixed point math to get the trains per second (instead of per minute) and then converts this to trains per minute. So it's always accurate, instead of just at the beginning of each minute. I think, theoretically, you could use it to limit the number of trains into the intersection, but I haven't tried yet. It intersects with part of your design so you can see the hookups, but I wouldn't paste it directly over, since I don't know if it would actually hook up right. (The important bit is the 5 combinators on the left.)
High Precision Timer
Last edited by AntiBlueQuirk on Thu Jun 29, 2017 6:59 pm, edited 1 time in total.

User avatar
Nexarius
Filter Inserter
Filter Inserter
Posts: 271
Joined: Sat May 09, 2015 7:34 pm
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by Nexarius »

Can you test my intersection?
Image
blueprint

aaargha
Filter Inserter
Filter Inserter
Posts: 329
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: 4-way intersection testing: Throughput and deadlocks

Post by aaargha »

AntiBlueQuirk wrote:Anyway, I made a 3rd version, but I think this is probably about as good as it gets. The upper end of performance on this one is pretty heavily luck based. If you get a train stuck a long time trying to turn left from the N/S, traffic is going to pile up behind it, and I don't think there's anything I can do about it. I was interested to see what would happen if i prioritized left-turning traffic, but Factorio doesn't really have a good way to prioritize traffic. (At least without circuit networks.) It would also be better if Factorio prioritized trains that have been waiting longer. (Is there a feature request for that?) All that being said, I think most of the issues with the intersection only occur when it it literally at capacity. I think as long as there's a little gap between trains, it might do better, because older trains will be able to get through.
Added, mucked about with the signals just a smidge, can't help it.

It is possible to give priority to certain paths merging into the same block depending on whether they have chain or rail signals leading into the block. It only works if what is preventing progress is the path they are merging into is occupied so it may not help too much in an intersection with multiple intersecting paths. I think there was some discussion on this a few pages back.
AntiBlueQuirk wrote:Also, I made a high precision timer for your throughput tester. It uses a little fixed point math to get the trains per second (instead of per minute) and then converts this to trains per minute. So it's always accurate, instead of just at the beginning of each minute. I think, theoretically, you could use it to limit the number of trains into the intersection, but I haven't tried yet. It intersects with part of your design so you can see the hookups, but I wouldn't paste it directly over, since I don't know if it would actually hook up right. (The important bit is the 5 combinators on the left.)
Thanks, I'll have to take a look at that one. Currently I'm not really using the rate counter, just checking the train count by the 15 min mark, running it in a calculator, and applying some arbitrary rounding :)
Nexarius wrote:Can you test my intersection?
Added as "Encircled knot".

Also added "Buffered roundabout MK2" which I think may actually, much as it pains me to say it, be a pretty decent deadlock free roundabout, excluding loop deadlocks made possible by using many of them, of course. Hopefully someone will find a way to deadlock it so order can be restored :)

User avatar
Nexarius
Filter Inserter
Filter Inserter
Posts: 271
Joined: Sat May 09, 2015 7:34 pm
Contact:

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

Post by Nexarius »

aaargha wrote:
Nexarius wrote:Can you test my intersection?
Added as "Encircled knot".)
Thanks :)

Can you test those intersections too?
blueprint

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

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

Post by Zavian »

Also I'm curious to know whether the train fixes in 0.15.27 have effectively fixed the deadlocks with roundabouts.

Locked

Return to “Railway Setups”