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
mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

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

Post by mrvn »

Tallinu wrote:
mrvn wrote:I don't get your comment about multiple branches. In my suggestion each input would split right at the start into as many branches as there are outputs. Then you have buffer area for each. So the trains path gets decided before it enters the input buffer.
This is exactly what's done in most of the really high throughput junction designs. That concept was present even my old "Cross" design from before I had access to these great testing tools, and by now it's been pretty well refined, although there's certainly room for more innovation! :D

I'm not sure how well that idea would work in regards to a roundabout though, considering that they tend to put all traffic on the same circular path regardless of which exit a train is heading for. Having multiple paths onto the roundabout per entrance would be functionally equivalent to a stacker, as in an input buffer with multiple parking slots side by side, and all trains waiting at that entrance would be trying to use, or at least start out using, the same path through the roundabout. There's no way to know which train is heading for which exit unless there's a one to one correspondence between input buffers and accessible output buffers, and if all of a given set of input buffers merge onto the same roundabout track, then that's not the case. I don't think it's possible to make something for which that's true and which also qualifies as a roundabout (and not just something that resembles a roundabout visually, but can't actually be traversed in a full circle).

On the other hand, the idea of having a really huge roundabout with circuitry to help a train merge into the gaps might work, although detecting a gap large enough for an entire train and its track reservation to fit in might be difficult, and I can tell you from experience that it's also difficult to get trains to travel at a consistent speed and reliably do what you want them to do, even with some serious circuitry. But if you want to, you're welcome to have a look at the merge managers on a few of the MultiCross blueprints I posted recently for some circuitry that you might be able to modify to always prioritize one lane (the main roundabout path) over another (the entrance), or at least for an example idea of how I handled some of that detection and lane control.
The buffers won't work for a roundabout indeed. The idea was for a simple crossing.

For a roundabout you need all trains on the ring to move at the same (and hopefully full) speed. If you have identical trains that should be possible. Then it is "just" a matter of getting trains up to speed between the input buffers and joining the rings and timing it so they join in the smallest gap possible. But change the fuel or add a fluid wagon and your timing will be screwed. So a very fragile setup. Or if your timing is off by even one tick the error will cascade and probably collaps the whole system into chaos.

User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Jun 14, 2015 8:14 am
Contact:

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

Post by Tallinu »

mrvn wrote:The buffers won't work for a roundabout indeed. The idea was for a simple crossing.

For a roundabout you need all trains on the ring to move at the same (and hopefully full) speed. If you have identical trains that should be possible. Then it is "just" a matter of getting trains up to speed between the input buffers and joining the rings and timing it so they join in the smallest gap possible. But change the fuel or add a fluid wagon and your timing will be screwed. So a very fragile setup. Or if your timing is off by even one tick the error will cascade and probably collaps the whole system into chaos.
A train that can accelerate faster than the train ahead of it will simply match (approximately) that leading train's speed when its stopping point begins to reach the signal blocks still occupied by the rear of that train. There's no need for them to be identical. (The speed of the follower will be smoother if the blocks are shorter, or it will alternate between higher acceleration and braking if they are longer, which might waste a bit of fuel depending on how the game handles fuel consumption, I'm not sure.) And you don't get into actual differences in top speed (at least using rocket fuel) until you start talking about horrendously oversized trains that aren't of much practical use in Factorio, except perhaps in very specialized rare use cases. (I'm not just talking about something like 16 cars either, they have to be seriously huge -- "I don't even remember the exact number because I'll never need it" huge.)

It's not really necessary for trains making their way through the roundabout to be at top speed, nor is it very realistic to expect them to be. It takes quite some time for most trains to accelerate to 292 and they certainly aren't going to be anywhere near that when they enter the roundabout if there was any traffic using it which forced them to stop and wait, no matter how far back you stop them. And the farther away from the roundabout you actually make them stop, the harder it will be to manage and control their entry into the circle. So in my opinion it's far simpler to stop them just far enough back from it that you can easily give them some extra time to accelerate as the rear of the train blocking their path begins to clear the blocks leading to the merge point. With a one-way system like this where each lane has a single role rather than trying to give equal priority to both merging lanes, the circuitry to control the waiting train's signals should be far simpler to set up. I suspect that relatively few combinators would be needed, perhaps even none with clever enough signal reading logic.

User avatar
ridesdragons
Inserter
Inserter
Posts: 28
Joined: Sun Feb 05, 2017 9:30 am
Contact:

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

Post by ridesdragons »

I'm baaaaack *cue horror music sounds*

I've discovered the logistics train network mod. and by discovered I mean I finally got around to downloading it and considering using it. because of this I got around to making some horrifying structures like my ribcage train depot
ribcage train depot
however, I quickly realized that my typical 2-lane layout can't work like this. I can't just have 32 trains waiting on a single exit. that just won't work. so I decided to make a main-bus kind of thing. but this thing is big and requires a lot of resources and a lot of time to design, so I went into a different save and turned on cheat mode and got to work.

making the bus is easy. what's difficult was planning the intersections. including 4-way intersections. including my design, the reverse roundabout. but when I thought about it, there was just no way for me to make a working 8-lane reverse roundabout so I said "fine, only the left lane can turn around. everyone else has to go in one of three directions".

one thing led to another, and, well...
this thing is terrifying
it's too big to take a picture of in any mode except from space. I'm not even sure if I can actually use this for quite a while. I ran out of rails three times, and the sheer size means long periods between major intersections. thankfully most of my rails will still only be 2-lane, this will just be for the main bus.

by doing this, I'm only willing to have intersections off of the outer edge of the "highway". so if a train heads west and takes an exit north to a mine, and then returns back to the "highway", it will be heading west again. heading east would mean crossing all 8 tracks before merging with the far end, which I'm not ok with. so, instead, I made it so trains can turn around at specific points if they otherwise can't find a way to go east, but only from the central lanes. this way, the other lanes are not affected by trains turning around. meanwhile, a train stuck in the center lane can still turn left, right, or go straight if it wound up there on accident.

This thing is so big that I have to split this message into 2 because I go over the max character limit of 60k lol
Last edited by ridesdragons on Sat Oct 21, 2017 6:24 am, edited 2 times in total.

User avatar
ridesdragons
Inserter
Inserter
Posts: 28
Joined: Sun Feb 05, 2017 9:30 am
Contact:

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

Post by ridesdragons »

Massive 8-lane reverse roundabout
because of how bloody big this thing is, I'm only "pretty sure" that it's set up properly. as far as I've checked after doing several passes for signaling, this thing should work perfectly fine. it's designed for 6-car trains (E-E-C-C-C-C). the 4 entrances technically aren't necessary for the intersection itself, and are mainly just there to ensure trains have the chance to change lanes if they need to before entering and after leaving the intersection.

enjoy your first D-rank 8-laner lol

Jap2.0
Smart Inserter
Smart Inserter
Posts: 2339
Joined: Tue Jun 20, 2017 12:02 am
Contact:

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

Post by Jap2.0 »

Actually, I'd say due to the sheer size (and if it has fairly good throughput) you probably don't need that much space between them.
There are 10 types of people: those who get this joke and those who don't.

User avatar
olafthecat
Filter Inserter
Filter Inserter
Posts: 476
Joined: Fri Jul 07, 2017 4:37 pm

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

Post by olafthecat »

This nearly crashed my PC :D
Gonna start playing again with 0.16 build.
That's all.

User avatar
ridesdragons
Inserter
Inserter
Posts: 28
Joined: Sun Feb 05, 2017 9:30 am
Contact:

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

Post by ridesdragons »

too big? :lol: unfortunately I tried making it smaller, this is actually pretty small to begin with. I know, "massive", "small", yea, but the lanes are actually even closer than I'd normally prefer. instead of 2 spaces between the rails, there's only 1 in most of the area, with 2 spaces being pretty much just for the entrances/exits. the spacing between intersections is mainly for buffering. for example, 2 trains can fit in the buffers going straight or left, and 3 can fit going right. so at most, 28 trains can be inside of the intersection at any given time. wait that's wrong, it's 8-lane, so that's actually 92 trains at the same time lol (going left, 3 lanes, 2 trains each, 4 exits, 24. going straight, 3 lanes, 2 trains each, 4 exits, 24. going right, 3 lanes, 3 trains each, 4 exits, 36. left/central lane, going any direction, 4 entrances, 4 exits, so 8 trains). and of course 16 more waiting to enter the intersection.

shoot if I can fit that many trains into one intersection, I need more train depots, my 32-train depot's not gonna be enough lol

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

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

Post by mrvn »

Tallinu wrote:
mrvn wrote:The buffers won't work for a roundabout indeed. The idea was for a simple crossing.

For a roundabout you need all trains on the ring to move at the same (and hopefully full) speed. If you have identical trains that should be possible. Then it is "just" a matter of getting trains up to speed between the input buffers and joining the rings and timing it so they join in the smallest gap possible. But change the fuel or add a fluid wagon and your timing will be screwed. So a very fragile setup. Or if your timing is off by even one tick the error will cascade and probably collaps the whole system into chaos.
A train that can accelerate faster than the train ahead of it will simply match (approximately) that leading train's speed when its stopping point begins to reach the signal blocks still occupied by the rear of that train. There's no need for them to be identical. (The speed of the follower will be smoother if the blocks are shorter, or it will alternate between higher acceleration and braking if they are longer, which might waste a bit of fuel depending on how the game handles fuel consumption, I'm not sure.) And you don't get into actual differences in top speed (at least using rocket fuel) until you start talking about horrendously oversized trains that aren't of much practical use in Factorio, except perhaps in very specialized rare use cases. (I'm not just talking about something like 16 cars either, they have to be seriously huge -- "I don't even remember the exact number because I'll never need it" huge.)

It's not really necessary for trains making their way through the roundabout to be at top speed, nor is it very realistic to expect them to be. It takes quite some time for most trains to accelerate to 292 and they certainly aren't going to be anywhere near that when they enter the roundabout if there was any traffic using it which forced them to stop and wait, no matter how far back you stop them. And the farther away from the roundabout you actually make them stop, the harder it will be to manage and control their entry into the circle. So in my opinion it's far simpler to stop them just far enough back from it that you can easily give them some extra time to accelerate as the rear of the train blocking their path begins to clear the blocks leading to the merge point. With a one-way system like this where each lane has a single role rather than trying to give equal priority to both merging lanes, the circuitry to control the waiting train's signals should be far simpler to set up. I suspect that relatively few combinators would be needed, perhaps even none with clever enough signal reading logic.
You are right that with different speeds the faster train will slow down when its breaking point reaches the train before it. But then it will slow down below the speed of the train before it and fall back. Then it will speed up again to faster and catch up and swing back and forth. Normally that isn't a problem. But with the perfect timing for best throughput the next train will then also have its breaking point hit a block the train is still in and also break. And then accelerate again and break. The oscillation will spread and be chaotic. For the most throughput you want 0 ticks distance between trains and any oscillation would cascade to all trains and break the system. As I said: fragile.

If trains aren't at top speed entering the roundabout (as I assume they will be, the distance to reach full speed is just too great to be practical) then timing becomes more complex as distance traveled isn't linear and breaking distance isn't a constant. But it shouldn't complicate things too much. Just as long as all trains have the same fuel and weight.

If you look at any one point on the roundabout then it should be possible to have a LC train pass that point every 74 ticks. Less trains the shorter the acceleration distance is before entering the ring. I've tried to design this with a small ring yesterday but I had a problem with determining gaps. I tied it so that a train can enter the ring every 200 ticks (start slow :). So at every entry trains get stopped by a red signal and at T mod 200 == 0 a train may enter if I know there is a gap in the ring it will fit into. Problem is I don't know if there is a gap because I don't know when the train currently occupying the place will exit the ring. The acceleration distance is large enough that a train leaving at the exit before the next entry is still on the ring.

So do I make the ring larger or is there some trick I can use to tell me where a train is going? Would be nice to have a train sensor that could return a station ID for where the train is headed. Or even better read the path and output the ID of some kind of beacon along the path. You would place a beacon at each exit and the sensor would say which exit the train will take.

User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Jun 14, 2015 8:14 am
Contact:

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

Post by Tallinu »

Well, a train moving at even a moderate speed will reserve its path some distance ahead, which will include the exit track it intends to take once it is close enough to that track to do so. You can read the first signal of all the exit tracks for some advance warning of when an approaching train is about to turn off of the roundabout. That would tell you that a train which is waiting at the entrance is going to be able to occupy the space currently occupied by the train which is about to exit, and you could allow it to begin accelerating at that time. If you need even earlier warning that a train is exiting, just start the exit fork farther back along the roundabout so that the first signal gets triggered sooner, even if you don't need the extra buffer space on the exit track.

As soon as the signal goes yellow you know something is exiting, and you can be certain that there will be some other color interrupting the yellow before another train gets a chance to reserve the block because it will turn red as the first train passes through it, even if another train is right on its heels and the signal doesn't get a chance to read green before going from red to yellow again.

I still am pretty certain that it's not possible to realistically reach 100% of max theoretical throughput in a reliable way in typical use cases (rather than test cases), even if your trains are all perfectly identical... simply because of the time to accelerate combined with the unintelligent way trains behave when approaching signals where a moving train is passing by, and the fact that the trains going further around the roundabout will have had more time to accelerate and thus will be moving at higher speed than a train which has just entered and is taking the first exit, and the higher speed trains will either unexpectedly block the entry of other trains or will catch up to the newly entered trains and be forced to brake, creating the exact oscillation scenario that you said you were worried about with non-identical trains. Therefore I think it's wiser to allow enough room for error to make sure that trains can space themselves out a little more and let the oscillations smooth themselves out instead of risking situations that would result in trains braking to undesirably low speeds (or even halting). That's a situation I had to contend with a lot while working on my merge manager system and fine tuning it so that such over-braking would go away on its own instead of becoming worse was one of the most difficult aspects of that project.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

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

Post by mrvn »

Problem is that for a roundabout with 4 exits the exit lane can't start more than 1/4 turn and the outgoing train covers that distance faster than an incoming train needs to accelerate. Unless you make the roundabout huge. To big to be practical. But as an exercise it is fun.

I thought of a way to deal with different trains. I put signals around the inner ring and connect them all to a clock to turn red at different times so red signals moves around the ring at the desired speed. Each train will enter the ring and drive till the breaking point hits the red signals and then it will follow it at more of less the speed the red signal moves.

User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Jun 14, 2015 8:14 am
Contact:

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

Post by Tallinu »

That's a pretty good idea. Probably won't be top speed but like you said, it'd be hard to get trains entering at that speed anyway.

All this discussion got me thinking, and I ended up playing with "Not-A-Roundabout" designs for a few hours. The final result was something that might actually be useful.

This Whirlpool looks like a multi-lane roundabout but isn't. It ended up having some similarities to the Inscribed Square, I think. Paths from each entrance to each exit are unique and each uses its own track, with no way for a train to change paths inside the junction, much less decide it wants to make a 270 degree turn and go through itself. It would be possible to expand this to allow U-turns, but this version only allows the typical 3 way branching. (Correction: It turns out all I had to do to allow U-turns was add a single piece of curved rail to the last crossing before each exit. Didn't even need to adjust any signals! I've updated the blueprint string and added a screenshot of the changed location.)

The throughput is a surprisingly high 70-72 TPM with the testbed's stock 2-4-0 trains, even without an input buffer area. Adding one only raised it to 80 TPM so I decided to leave it off of this design. It's still faster than my old Cross or Windmill by a significant margin, despite having about the same length and width (although the total footprint is significantly greater due to all the diagonal buffer spaces).
Screenshots
Whirlpool RHD Blueprint String

User avatar
TRUEpicness
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Wed Aug 09, 2017 8:21 pm
Contact:

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

Post by TRUEpicness »

whats with the signals on both sides of the track on track at the entrances and exits?
1 more YouTube vid before bed *starts 24hr long vid*

User avatar
Tallinu
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Jun 14, 2015 8:14 am
Contact:

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

Post by Tallinu »

That's just part of how the testbed map works, all the tracks you connect your junction to have the signals on both sides so that you can test either RHD or LHD junctions without having to re-signal all of the tracks leading to the spawner/deleter stations at each end. I guess I made the screenshot slightly too large. I'm pretty sure I excluded those signals from the blueprint, though -- but let me know if I'm wrong about that.

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

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

Post by aaargha »

Apologies for the delay in testing, I've been seriously neglecting this project and that just won't do. I can't just leave all this awesome and/or crazy stuff untested, think of the science! :)

It seems like I've missed a lot of interesting discussion that I'll have to take a look at. That is for another time however, now I'll deal with the submissions I've missed. In order of appearance:

Multi-cross by Tallinu:
I really like the modular design as traffic is unlikely to be uniform in real setups, the short blueprint string is also a nice bonus. I've only tested the base multi-cross as I think I'd rather have the merge-o-matic as its own optimization. I think that would be the most fair as it can be applied to many different intersections. On that note, I think you really should consider making a post about it as it has uses beyond intersections, for example: it might help with stacker throughput in some cases.

This is a great set of intersections if you really need that extra 2-lane throughput.

"Greedy" Celtic Knot Junctions by noodlebox:
I will most likely not add the greedy variants as they cannot have correctly sized output blocks allowing trains to stop in the intersection. While that won't cause big problems in the tester, output will never back up, it may spread congestion to unrelated lines increasing the risk of a gridlock. Apart from that they look fine and I'll probably add non-greedy variants of the 4- and 8-lane versions.

Magic-roundabout by ERJHolton:
Despite the circuitry I'm pretty sure that the circles can still be saturated if you're unlucky so I'm going to rate this one F, that said it has no problems getting through testing and it will likely be fine in reality. I made the signalling a lot more aggressive on the outer ring, it made a surprisingly large difference. The improvement also seemed to get it closer to locking up so it's a bit double-edged.

Original signalling: set 1: 51 set 2: 48
Aggressive signalling: set 1: 73 set 2: 68

I also simplified the circuitry a bit to remove the combinators.

Priority roundabout by ERJHolton:
Pretty much the same as the last one, except the changes to the signalling were not as drastic.

Reverse roundabout by ridesdragons:
Oh man, I had how much work it was testing these 8-lane monstrosities :) While most of the signalling seemed correct there were some missing chain signals in the lane switchers effectively turning the while thing into a 2-lane intersection. Other than that I just made the signalling a bit more aggressive on some of the buffers and the outer parts. Unfortunately it still does not perform that well, especially considering the size of it. I'm not really sure if there is any easy ways to improve the design, the large clusters of crossings before the buffers seems like a major bottleneck but they're not really that easy to fix. I'd guess that the lane switchers may also become problematic if you manage to improve the intersection itself, there was some interference from switching but it didn't really affect the results of the current design as the bottleneck was elsewhere.

I hope that you'll continue to iterate on this design, I'd love to see if it's possible to make an 8-lane intersection with a roundabout that performs well.

Whirlpool by Tallinu:
I made the signalling a bit more aggressive on some of the inner buffers but nothing major.

Thank you all for the submissions, it's great to see that there are still new designs coming in!

User avatar
ridesdragons
Inserter
Inserter
Posts: 28
Joined: Sun Feb 05, 2017 9:30 am
Contact:

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

Post by ridesdragons »

aaargha wrote:Apologies for the delay in testing, I've been seriously neglecting this project and that just won't do. I can't just leave all this awesome and/or crazy stuff untested, think of the science! :)
Welcome back, I noticed that you hadn't been replying lately, but I also saw you updated your mod a few days ago and figured you'd probably be back soon.
aaargha wrote:Reverse roundabout by ridesdragons:
Oh man, I had how much work it was testing these 8-lane monstrosities :) While most of the signalling seemed correct there were some missing chain signals in the lane switchers effectively turning the while thing into a 2-lane intersection. Other than that I just made the signalling a bit more aggressive on some of the buffers and the outer parts. Unfortunately it still does not perform that well, especially considering the size of it. I'm not really sure if there is any easy ways to improve the design, the large clusters of crossings before the buffers seems like a major bottleneck but they're not really that easy to fix. I'd guess that the lane switchers may also become problematic if you manage to improve the intersection itself, there was some interference from switching but it didn't really affect the results of the current design as the bottleneck was elsewhere.

I hope that you'll continue to iterate on this design, I'd love to see if it's possible to make an 8-lane intersection with a roundabout that performs well.
thanks for catching the chain signals. the thing was so big that I had some issues finding every spot that needed signals. it's a shame it only supports twice the throughput. I had thought of making it so trains going straight didn't intersect and interfere with each other, but I found that rather than making it better, it would actually make the situation worse, as I'd have to add two more intersections on each direction (8 total). how much this would effect it is probably not as bad as I'm thinking, as the two new intersections would still appear before the first buffers/after the last buffers, but rather than going against the left turning of the trains to the right of the perspective, I thought it best to go as far along with its own left turning as possible before splitting off and merging with the left-hand train's left turning. it probably wouldn't have made much of a difference either way, though.

while I figured the cluster of crossings would be a bottleneck, I figured it'd be better to have it as grouped together as possible to allow more room for buffers and to cut down on the size of the intersection, and most of the rest of the intersection I mainly made to be less used (as its the only rail that allows turning around, so it should be primarily used by such trains). there's a possibility part of the performance hit was caused by the central lanes, as it's technically the shortest distance to cross, and so trains will prefer the inner lanes over the other three. That said, even then, only trains going straight or turning around should prefer that path, as it's quicker to turn left or right on the other lanes, meaning it shouldn't block other trains going straight any more than normal rails would (if a train's going N and takes a U-turn, trains can't go west, but they can go east, north, or south, and a train going north just prevents east as well).

unfortunately, the only way I see to make the 4 major intersections less of an issue would be to drastically spread it out even more, easily doubling or even tripling the size of the intersection to allow for buffers between each intersection.

that said, I'm happy with the 80/90 trains per minute for my own games anyway. I'll likely never see that many trains running that intersection at the same time, as I don't really do megabases (or at least I've never gotten to the point in the game where I could make one. I've yet to get farther than starting the automation of blue science in vanilla, several patches ago, and I'm getting slowed down even earlier with AAI/angels/bobs), and even then, 90 just sounds absurd to me to be in one intersection in the same minute (that sounds more like the total amount I'd have in the factory altogether).

I like roundabouts because I like to have a main rail line, and I often have stops heading eastward on the eastern portion of a line of track, and another heading westward on the western portion of the same track, with a train using both of those stops on its route, so I want the train to be able to turn around without having to pass through 5 intersections to do so (left, right, right, right, straight), and while there's the possibility of doing a T-junction into a cul-de-sac, this stops being feasible once you go over 2 lanes, as the train turning around will then need to cross 8 lines to reconnect with the "highway". overall, I feel the performance hit from allowing trains to turn around is much better than the performance hit from forcing a train to pass through 5 intersections instead of 1. going from A to Z will be much faster when it has to pass through B but not C, D, and E, after all.

I will look into a design that should be more performance-friendly, just... don't expect any miracles in regards to its size, and I'll probably crash a few toasters making it lol

User avatar
Divaya
Burner Inserter
Burner Inserter
Posts: 17
Joined: Mon Nov 06, 2017 3:57 am
Contact:

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

Post by Divaya »

nucleargen wrote:Not found in tested 4-lane intersections:
Image
Found in Steam guide 4.5 Guage Rails
Blueprint book: pastebin
I just saw this intersection in the Steam guides section for Factorio, and I really liked it. I did have a few things I wanted to change though:
  • Remove the U-turns entirely. Useful in a double header system, but I find it bad practice.
  • Enforce the lane rules stronger. I liked how only outer lanes could turn right, but didn't like that they couldn't go straight.
  • (Hopefully) balance out the inner/outer lanes. Outer lane can only turn right (after removing U-turns), but the left lane can go straight (much more important than U-turning) and go left.
After a few iterations, I've come up with this intersection:
Image

The idea was for the intersection to follow rules like a traditional car intersection.
  • Both inner and outer lane may go straight through
  • Only outer lane may right turn
  • Only inner lane may left turn
I ended up having to make it wider than the 4.5 gauge layout to get the left turns on the inside lanes however. This still needs lane changers between intersections like the 4.5 gauge version. Feedback always appreciated!

Code: Select all

0eNqlnd1OGzsUhV+lmuukGv+Mf3iDSufy3B1VVYCojQ4NVUirgyre/SSBACnbzfrcOxLIx7Jne7y9vMf5OVzefF9+26zW20+Xt7f/Dhc/X965Gy7+efVy/7vV1e368e271ef14mb/3vb+23K4GFbb5ddhNqwXX/evNovVzfAwG1br6+V/w4V7+DgbluvtartaPn7+8OL+0/r718vlZvcHJ5+cX31ZrNbzp/8xG77d3u0+ebve/7sdbe6m99NsuN/95Hc/PTzM3vD8M+9uuyN+/rKdHyQZrPhEShYnnOpqKqrnBEVZUPmdnknFpN9RktaqfNKo2XC92iyvHn8fDWpWtTn/O3FFE+cCU1efsVffNz+W1814OFLdKXMymG7kYRatNjuHw8PmeBofNiZonbX/O6uvrP53EYeHrW3ife5NUMJ9bnMy7XMbU3D/2JzK+2c0b6Ej7h+b42j/2BiP+8fmiLE93+u+P9wQToPbW9DI5q9yvHftfzrFOw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m, edited 1 time in total.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

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

Post by mrvn »

Divaya wrote:
nucleargen wrote:Not found in tested 4-lane intersections:
Image
Found in Steam guide 4.5 Guage Rails
Blueprint book: pastebin
I just saw this intersection in the Steam guides section for Factorio, and I really liked it. I did have a few things I wanted to change though:
  • Remove the U-turns entirely. Useful in a double header system, but I find it bad practice.
  • Enforce the lane rules stronger. I liked how only outer lanes could turn right, but didn't like that they couldn't go straight.
  • (Hopefully) balance out the inner/outer lanes. Outer lane can only turn right (after removing U-turns), but the left lane can go straight (much more important than U-turning) and go left.
After a few iterations, I've come up with this intersection:
Image

How about putting the lane changer in the middle too? So the N/S track has the lane changer in between the W/E going tracks. You need to signal it so two trains can go straight in parallel obviously so the intersection might have to spread a bit more.

The idea was for the intersection to follow rules like a traditional car intersection.
  • Both inner and outer lane may go straight through
  • Only outer lane may right turn
  • Only inner lane may left turn
I ended up having to make it wider than the 4.5 gauge layout to get the left turns on the inside lanes however. This still needs lane changers between intersections like the 4.5 gauge version. Feedback always appreciated!
How about putting the cross overs in the middle of the cross too? Might need to make this a bit bigger for that.
Last edited by mrvn on Thu Nov 09, 2017 11:12 am, edited 1 time in total.

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

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

Post by aaargha »

I really like the ideas you guys have on circuit controlling roundabout merges, though I do feel like these kinds of systems would be much easier to design if chain signals could be circuit controlled and trains could be relied upon to travel at least as far as they have reserved.

@mrvn: I think your post broke.

@ridesdragons: The important part is that you get something that fits your use-case. As 8-lane designs are quite tricky to get right, I wouldn't worry too much about it. That said, I'm always up for a good toaster pyre :D
Divaya wrote:I just saw this intersection in the Steam guides section for Factorio, and I really liked it. I did have a few things I wanted to change though:
  • Remove the U-turns entirely. Useful in a double header system, but I find it bad practice.
  • Enforce the lane rules stronger. I liked how only outer lanes could turn right, but didn't like that they couldn't go straight.
  • (Hopefully) balance out the inner/outer lanes. Outer lane can only turn right (after removing U-turns), but the left lane can go straight (much more important than U-turning) and go left.
After a few iterations, I've come up with this intersection:
*image*

The idea was for the intersection to follow rules like a traditional car intersection.
  • Both inner and outer lane may go straight through
  • Only outer lane may right turn
  • Only inner lane may left turn
I ended up having to make it wider than the 4.5 gauge layout to get the left turns on the inside lanes however. This still needs lane changers between intersections like the 4.5 gauge version. Feedback always appreciated!
I don't get very many designs that need lane changers to function so that's pretty interesting. I think an improvement you might want to make before I throw it in the tester is to "pull" the left turns closer to the entrances/exits so that opposing left turns don't intersect. By pulling them back you could also probably improve the deadlock rating from the current B (two opposing trains going straight change to left) to A, you might also be able to make it thinner that way.

I think a reason that most intersections allow turning from all lanes is that most lane changers introduce a bit of interference that can reduce throughput in some cases. For testing I'll be using the high performance lane changer that Tallinu posted a while back, so I don't really think it'll affect the test results that much, but if it's used with a regular simple lane changer it might be more noticeable. That said it likely won't be a problem unless you're running it pretty close to capacity.

I'll hold off on testing for now if you want to iterate further on the design first.

User avatar
Divaya
Burner Inserter
Burner Inserter
Posts: 17
Joined: Mon Nov 06, 2017 3:57 am
Contact:

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

Post by Divaya »

aaargha wrote: I don't get very many designs that need lane changers to function so that's pretty interesting. I think an improvement you might want to make before I throw it in the tester is to "pull" the left turns closer to the entrances/exits so that opposing left turns don't intersect. By pulling them back you could also probably improve the deadlock rating from the current B (two opposing trains going straight change to left) to A, you might also be able to make it thinner that way.

I think a reason that most intersections allow turning from all lanes is that most lane changers introduce a bit of interference that can reduce throughput in some cases. For testing I'll be using the high performance lane changer that Tallinu posted a while back, so I don't really think it'll affect the test results that much, but if it's used with a regular simple lane changer it might be more noticeable. That said it likely won't be a problem unless you're running it pretty close to capacity.

I'll hold off on testing for now if you want to iterate further on the design first.
Sure, I'll work on the design a little more. I definitely like the idea of allowing multiple trains to make left turns in the intersection.

Edit: Not as hard as I imagined it'd be! Here's the second iteration of the intersection, and it allows opposing trains to make left turns at the same time.

Code: Select all

0eNqlndlumzkSRl8l0LU84L74Gfpy7gaNQEmEbmEcObCdYIKG330k2/Ja9P8d+s7r0UeySBaLRfKf1ZeLn9sfV7v9zecvl5f/XZ3/8/ST69X5f559e/zd7uvl/v7H17u/9puL489ufv/Yrs5Xu5vt99V6td98P353tdldrG7Xq93+2/Z/q3N/++d6td3f7G522/v/v/vm9+f9z+9ftleHP3jxn2df/97s9mcPn7Fe/bi8Pvzn5f74cQfamc//yuvV78NX4fDV7e36DS888q5vDsS//r45u5NksNIDqVic+FLXUFFfEpRkQe09PVnFlPcoRStVfVGo9erb7mr79f73yaBWVZsP74lrmjgfmbr+iP368+rX9tvQHk5U/5KZDaZ33MySVWbvsXnYnEDtw8ZErbKOf2fVlVX/PmHzsLVlXufBBBVc5zan0jq3MQ3Xj83pvH6cOYQ6NCY/joC+D4ZkbuO2LmzjNibCQfCuXItmHriZ2/KyOF4dq/VO3itxwYIWNs22x7K312X3Fr7qptdO4JfYaGEbtugD1gKpc0C1q9Rq7+ioVdvaote0ZVuaNTtF2lEGyiK16AFH7xnFNg6zkJmYtC9ji7ZMLxZxIux2s1SLWUWfMjx6uf6Nh2P17thY7y4Q3yd99OMHmS4x95686TEmuHrwrOAp4C5uy4xIZoIqE+3ttkjUnxrUWPBQYousqNPTmkT96GkdcmfnixNGQt0oRKY9630qnOwgCVjddwsJYPWeFQLARh3rADZx90bBggUNabLCR1cFW2ewFgh4daTtwfIHtH3hbp5Z6uInOMvq9H4ELKjo3QgYUNF7EWj2Inci0uhyFyJK5Q5EKrXRyd+2zs4xi9qq3HWAxVe5H5FeXgP2T8x6rHGCs6xOX0AB06kZL8sUqu7pkVaX+w6Z16vceYgTUuW+RDymNrFmMsOEjU9ENifgSSIsr+obn3rccnyqJTqeu+XlfMsUGpbjDq3QgdhuHLROeop0emUh03DAeiCyTy63JJXd4WhLVxZa3Ytc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Lsjbi4+/QqH3//aXl3fe0ophdIPM2ANT4+wOot6dvfs63q1OXz0r+3n058OWLf/B7p/gu0=
Image


I tried a similar approach on the 4.5 guage rail distances, but I had trouble with tight areas around the left turns that made it unfeasible to signal.

Zijkhal
Inserter
Inserter
Posts: 20
Joined: Thu Sep 07, 2017 4:32 pm
Contact:

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

Post by Zijkhal »

So, I've done a bit of testing with the Pasta because I was dissatisfied with the 66 / 73 throughput values, and found that it can actually do up to 83 / 85. The problem is the exit of the intersection. With leaving a train's length after the exit, trains follow very far behind each other, limiting the throughput. With using the one signal every two cars method, the throughput improved to 80 in set 1. At this point I realized that the higher throughput I was consistently measuring was due to me putting signals as close to each other as possible on the exit line, so trains were following each other closer.
Anyway, I was thinking, does the 1 train long rail block has to be right after the exit merge of the intersection? As trains accelerate, there could easily be a gap longer than one train between them, and it could be used to unlimit the throughput while maintaining the behaviour that trains only exit the intersection if they can fully leave the exit merge, thus not blocking the entry, and not degrading the rating to B.

So, I have created this: https://pastebin.com/Dmq0Xvyh
In three trains length it ensures that trains only exit the intersection if they can fully leave it, but it does not limit the throughput of the exit line.

Aargha, could you please retest the Pasta with this merge thing attached?

Locked

Return to “Railway Setups”