3 and 4 way intersections

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.
causa-sui
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Sat Sep 12, 2020 4:23 am
Contact:

Re: 3 and 4 way intersections

Post by causa-sui »

Based on a little bit of my testing it seems that many buffered intersections out there encourage trains to turn rather than go straight. This may be because of the longer paths inside the intersection from the buffering. Regardless, it leads to high scores on the testbench, where only a single intersection is being tested, but I suspect it degrades overall rail network performance in practical situations where there are many intersections (especially in city block or city brick configurations).

Does anyone have thoughts on this, or how an intersection might "hint" to a train that it should or should not turn?

Edit: You'll see the performance degradation in scenarios where the entrance or exit are placed diagonally relative to each other, because trains that could have pathed around the outer edge of the rectangle between both points will attempt to path diagonally instead; and therefore there is more risk that they cross paths.
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 3 and 4 way intersections

Post by hansjoachim »

causa-sui wrote: Mon Apr 11, 2022 1:33 pm Based on a little bit of my testing it seems that many buffered intersections out there encourage trains to turn rather than go straight. This may be because of the longer paths inside the intersection from the buffering. Regardless, it leads to high scores on the testbench, where only a single intersection is being tested, but I suspect it degrades overall rail network performance in practical situations where there are many intersections (especially in city block or city brick configurations).
What do you mean with network performance? Like I want an definition related to Factorio with metrics.
You suspecting something is a reason to try to figure it out yourself. You can set up test to test your idea.

The downside to an buffered intersection compared to smaller intersections is that you need to have more trains in your network to transport the same number of resources since the distance the train have to travel gets longer or only a bit longer depending on how far they had to go in the first place. That is what you mean with turns right? That trains have to take a longer path. You probably know but trains don't lose speed in curves in Factorio like they do in transport tycoon. The only other time I have heard people caring about curves vs straights are players that come from openTTD.
causa-sui
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Sat Sep 12, 2020 4:23 am
Contact:

Re: 3 and 4 way intersections

Post by causa-sui »

hansjoachim wrote: Tue Apr 12, 2022 8:07 am
causa-sui wrote: Mon Apr 11, 2022 1:33 pm Based on a little bit of my testing it seems that many buffered intersections out there encourage trains to turn rather than go straight. This may be because of the longer paths inside the intersection from the buffering. Regardless, it leads to high scores on the testbench, where only a single intersection is being tested, but I suspect it degrades overall rail network performance in practical situations where there are many intersections (especially in city block or city brick configurations).
What do you mean with network performance? Like I want an definition related to Factorio with metrics.
At the moment I'm not sure the best way to gather metrics, so I'm seeking advice on that as well.

I was able to confirm that this is not a property of buffered intersections specifically, but rather how trains path in general. Here's an example:
unknown.png
unknown.png (123.96 KiB) Viewed 6702 times
My goal is to get trains to take the straight path rather than this "step" pattern, since that should result in fewer crossed paths.
hansjoachim wrote: Tue Apr 12, 2022 8:07 am You suspecting something is a reason to try to figure it out yourself. You can set up test to test your idea.
I don't know why you're being so defensive. I have a problem and I'm hoping folks here might be able to help with it. You aren't obligated to respond.
hansjoachim wrote: Tue Apr 12, 2022 8:07 am The downside to an buffered intersection compared to smaller intersections is that you need to have more trains in your network to transport the same number of resources since the distance the train have to travel gets longer or only a bit longer depending on how far they had to go in the first place. That is what you mean with turns right? That trains have to take a longer path. You probably know but trains don't lose speed in curves in Factorio like they do in transport tycoon. The only other time I have heard people caring about curves vs straights are players that come from openTTD.
I hope the explanation above clarifies this, but my concern isn't with making the path as short as possible or with prohibiting turns generally, since I know momentum is conserved like you explained.
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 3 and 4 way intersections

Post by hansjoachim »

causa-sui wrote: Tue Apr 12, 2022 2:00 pm At the moment I'm not sure the best way to gather metrics, so I'm seeking advice on that as well.

I was able to confirm that this is not a property of buffered intersections specifically, but rather how trains path in general. Here's an example:

unknown.png

My goal is to get trains to take the straight path rather than this "step" pattern, since that should result in fewer crossed paths.
There isn't really a test and set metric to test networks. It would be cool to make an network that can make 2k spm or more and the limiting factor being the the intersections. That way we could sort of find how to make a good network and set a score for each setup. It would be very artificial though.
Sorry didn't mean to be defensive.
Trains picks the route with the least cost. I think red lights increase cost and maybe stopped trains, have to check that.
If there is congestion trains will take a longer path. So I don't see the problem. Getting trains to go as straight as possible is possible if you add cost to each turn. For example trainstops on each turn or combinator blocked rail signal that turns green on approach.
This intersecion should disccourage turns without impacting throughput.
https://factoriobin.com/post/nXuR2K9_
Attachments
render-b2b3166ade0069cc.jpg
render-b2b3166ade0069cc.jpg (255.04 KiB) Viewed 6682 times
Kano96
Burner Inserter
Burner Inserter
Posts: 17
Joined: Wed Nov 17, 2021 12:39 pm
Contact:

Re: 3 and 4 way intersections

Post by Kano96 »

causa-sui wrote: Mon Apr 11, 2022 1:33 pm You'll see the performance degradation in scenarios where the entrance or exit are placed diagonally relative to each other, because trains that could have pathed around the outer edge of the rectangle between both points will attempt to path diagonally instead; and therefore there is more risk that they cross paths.
Technically, they don't actually cross more paths, because a left turn and a straight both cross 4 paths in LHD. In your example, all of the outside rails are dead tho, which would obviously change this.

As for performance, I don't think it would be such a big issue. As HansJoachim already mentioned, once the traffic accumulates in the center, the trains will naturally avoid the area and move further and further to the outside until they probably grid lock. This usually works, but also isn't perfect.

If you want to take a more active role in managing your trains, you could try to work with penalties. The easiest way to apply these are train stations, because these don't interrupt traffic and count as a solid 2000 tiles of track. For example you could have some sort of highway lane running through your grid and then place a penalty on every entry into the finer inner grid.
Grid with outside highway and penalty stations on the entires
Grid with outside highway and penalty stations on the entires
factorio_2022-04-13_20-58-58.png (36.04 KiB) Viewed 6426 times
causa-sui
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Sat Sep 12, 2020 4:23 am
Contact:

Re: 3 and 4 way intersections

Post by causa-sui »

After some additional testing I've thoroughly convinced myself that you are right and this is not a property of buffered intersections at all, but rather it's a consequence of how trains path in factorio more generally. That means this problem, while real, is off topic for this thread. Therefore, I'll take some of your suggestions into account and develop solutions elsewhere. Sorry for the detour, and thanks for everything y'all have contributed here. :)
Zaflis
Filter Inserter
Filter Inserter
Posts: 512
Joined: Sun Apr 24, 2016 12:51 am
Contact:

Re: 3 and 4 way intersections

Post by Zaflis »

SaiMoen wrote: Thu Nov 25, 2021 4:58 pm Testbench v4.2.1, Factorio v1.1.46
3-Way, 2-Lane, Unbuffered, spacing is 4 everywhere. Currently better than the only thing listed on that section.
R452736.png

Results with exit blocks; 1:45, 2:27, s:36.
This is really the way, i was wondering why posted 3-ways are still unoptimized at the center. When 3 rails form a triangle, only 1 train can pass at the time. It doesn't add any benefits putting chain signals in it, but instead shrink the rails to form a "star". It makes chain-rail pairs closer together and lets trains clear the crossing faster.
User avatar
Hovedgade
Burner Inserter
Burner Inserter
Posts: 16
Joined: Mon Jan 25, 2021 7:32 pm
Contact:

Re: 3 and 4 way intersections

Post by Hovedgade »

I am back with more intersections. :)
I took some inspiration from my blitz roundabout but then i rotated it 45°and added frontend buffers. The first design does not use parallel buffers for the same direction and it scored slightly better than Windmill MK2. The second design has more parallel buffers than absolutely necessary which made it score about the same as Hurricane 1.2. The intersections does look somewhat similar to mosaic tiles and hence the reasoning behind the names.

Mosaic MK1
RHT, Size: 176x176, Spacing: 4 tiles, Train length: 1 to 6 cars
LHT, Size: 176x176, Spacing: 4 tiles, Train length: 1 to 6 cars
image
Mosaic MK2
RHT, Size: 220x220, Spacing: 4 tiles, Train length: 1 to 6 cars
LHT, Size: 224x224, Spacing: 4 tiles, Train length: 1 to 6 cars
Image

There was an accident while designing the intersections which made this beautiful pattern that I'd like to share.
Mosaic ball.JPG
Avona
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Sun Dec 26, 2021 8:50 am
Contact:

Re: 3 and 4 way intersections

Post by Avona »

Zaflis wrote: Fri May 27, 2022 5:05 pmi was wondering why posted 3-ways are still unoptimized at the center.
They were probably made to be converted into a symmetrical cross. So they were "optimized" for ease of use. I don't believe the score is much different anyhow which is why I personally didn't change it but I could optimize them for tpm after I get the parts for my computer since it died...
Hovedgade wrote: Fri May 27, 2022 7:09 pm I am back with more intersections. :)
They look cool! It might take me a bit to get around to testing (unless another gets to it first!) because of the aforementioned computer issues... :/
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 3 and 4 way intersections

Post by hansjoachim »

Hovedgade wrote: Fri May 27, 2022 7:09 pm I am back with more intersections. :)
I took some inspiration from my blitz roundabout but then i rotated it 45°and added frontend buffers. The first design does not use parallel buffers for the same direction and it scored slightly better than Windmill MK2. The second design has more parallel buffers than absolutely necessary which made it score about the same as Hurricane 1.2. The intersections does look somewhat similar to mosaic tiles and hence the reasoning behind the names.

Mosaic MK1
RHT, Size: 176x176, Spacing: 4 tiles, Train length: 1 to 6 cars
LHT, Size: 176x176, Spacing: 4 tiles, Train length: 1 to 6 cars
image
Mosaic MK2
RHT, Size: 220x220, Spacing: 4 tiles, Train length: 1 to 6 cars
LHT, Size: 224x224, Spacing: 4 tiles, Train length: 1 to 6 cars
Image

There was an accident while designing the intersections which made this beautiful pattern that I'd like to share.
Mosaic ball.JPG
Great as always Hovedgade, I like those intersections. I tested them and got the same score as you. Thanks again for the formula, its in use with the TPM adjuster.
farcast
Long Handed Inserter
Long Handed Inserter
Posts: 87
Joined: Fri Jul 06, 2018 8:25 am
Contact:

Re: 3 and 4 way intersections

Post by farcast »

Abstract 4-lane 3-way
Abstract in action.gif
Abstract in action.gif (432.77 KiB) Viewed 5932 times
I've done it! I've made a working junction out of scribbles!

Using Throughput tester v5.0.7

RHT/LHT (When did D become T? What does T stand for?)
Score: 112/110

Set1: 115/114
Set2: 110/107

I couldn't get it to be perfectly stable like with clockwork, so the score you get will be rather sensitive to signal spacing on the input lines, but the given score is what you should get if you don't bother with that and just rely on the provided entrance buffers. This junction was designed for a signal spacing of 60-ish tiles, or roughly 8 to 9 cars long.
Abstract construction guide
Resizing it is easier than it looks because it's actually made out of equilateral triangles, so you just need to resize four different connecting segments. Aside from that, there are the three places that cross in parallel instead of merge (red), three places that merge instead of cross (green), and three places where the outer lane splits and merges into an exit (blue).
2-coloring
I thought of using constant combinators to find a good 2-coloring first, then building that 2-coloring with rails. As you can guess, my attempts at step 2 were rather unsuccessful until I realized the whole thing was made of triangles.

Continuing my investigations into this synchronous behavior, I made a graph on desmos that calculates the expected TPM per lane for synchronous crossings across different buffer lengths, for a given train design and crossing length in meters. It includes the special cases where the train hits max speed, and when it's max speed from the start. The train stats used were found through a bit of research and a lot of experimentation. The units are all SI units.

-Thrust, (b)raking force, and friction are in Newtons.
-(d) is braking distance.
-Drag is in Newtons per (meters per second), or Newton-seconds per meter.
-t0 : the back of the train is against the rail signal behind it with the stop point at the chain signal in front.

-t1a: the time it takes for the stop point to reach the chain signal of the next crossing.
-t2a: the time it takes for the brakes to slow the train back to v0.
-switches to tb if the train would hit max speed before the stop point reaches the next crossing
-t1b: the time needed to reach max speed from v0.
-t2b: the time it takes after t1b for the train to be fully within the next buffer.
-t3b: the time it takes for the brakes to slow the train back to v0.

I'd love to say I know exactly how the formulas for distance/velocity/acceleration over time come about, but the truth is I found the velocity formula while experimenting with regressions in desmos and guessing at where the variables should go.

So, did this graph help me understand synchronous crossings?

... not really, no. I thought maybe using the buffer length with the most throughput would translate to being the most stable, but building abstract like that was just as unstable as the one used here. At this point I'm kind of out of ideas as to how to figure out what makes it stable.

Edit: Updated scores and added a rail signal to the LHT version.

Abstract RHT & LHT
Last edited by farcast on Wed Jun 01, 2022 9:34 pm, edited 2 times in total.
Efficient inefficient design.
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 3 and 4 way intersections

Post by hansjoachim »

farcast wrote: Wed Jun 01, 2022 2:05 am [
RHT/LHT (When did D become T? What does T stand for?)
Score: 109/111

Set1: 115/114
Set2: 104/108
Hey Farcast, what a cool intersection! I'll test it later. RHD is a term describing where the wheel is placed in a car so cars with RHD drives on the left side of the road. Since our use of RHD/LHD is completely wrong and opposite to real life, we decided to use a better term which is Right Hand Traffic and Left Hand Traffic. Which are precise and correct terms.
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: 3 and 4 way intersections

Post by FuryoftheStars »

hansjoachim wrote: Wed Jun 01, 2022 1:34 pm RHD drives on the left side of the road
Shouldn't that be right side?
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 3 and 4 way intersections

Post by hansjoachim »

FuryoftheStars wrote: Wed Jun 01, 2022 1:56 pm
hansjoachim wrote: Wed Jun 01, 2022 1:34 pm RHD drives on the left side of the road
Shouldn't that be right side?
In my language we say translated rightdriving/leftdriving where rightdriving is driving on the right.
But in English right hand drive means the steering wheel is on the right side of the car. And cars with the steering wheel on the right side are made for driving on the left side of the road.
Source:
https://dictionary.cambridge.org/dictio ... hand-drive
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: 3 and 4 way intersections

Post by FuryoftheStars »

hansjoachim wrote: Wed Jun 01, 2022 2:01 pm
FuryoftheStars wrote: Wed Jun 01, 2022 1:56 pm
hansjoachim wrote: Wed Jun 01, 2022 1:34 pm RHD drives on the left side of the road
Shouldn't that be right side?
In my language we say translated rightdriving/leftdriving where rightdriving is driving on the right.
But in English right hand drive means the steering wheel is on the right side of the car. And cars with the steering wheel on the right side are made for driving on the left side of the road.
Source:
https://dictionary.cambridge.org/dictio ... hand-drive
Erm, ok. I'm a native English speaker and I've always understood RHD/LHD to be the side of the road you're driving on, not the steering wheel. Dunno, maybe I learned differently? I don't have anyone to compare with.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 3 and 4 way intersections

Post by hansjoachim »

FuryoftheStars wrote: Wed Jun 01, 2022 2:04 pm
hansjoachim wrote: Wed Jun 01, 2022 2:01 pm
FuryoftheStars wrote: Wed Jun 01, 2022 1:56 pm
hansjoachim wrote: Wed Jun 01, 2022 1:34 pm RHD drives on the left side of the road
Shouldn't that be right side?
In my language we say translated rightdriving/leftdriving where rightdriving is driving on the right.
But in English right hand drive means the steering wheel is on the right side of the car. And cars with the steering wheel on the right side are made for driving on the left side of the road.
Source:
https://dictionary.cambridge.org/dictio ... hand-drive
Erm, ok. I'm a native English speaker and I've always understood RHD/LHD to be the side of the road you're driving on, not the steering wheel. Dunno, maybe I learned differently? I don't have anyone to compare with.
On the old 4 way forum aaargha used RHD/LHD wrong and I think many learned it from there. I think especially us that are non native English speakers didn't question it. I didn't question it before I saw multiple times in the Factorio discord chat that we are using RHD/LHD wrong.
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: 3 and 4 way intersections

Post by FuryoftheStars »

hansjoachim wrote: Wed Jun 01, 2022 2:24 pm On the old 4 way forum aaargha used RHD/LHD wrong and I think many learned it from there. I think especially us that are non native English speakers didn't question it. I didn't question it before I saw multiple times in the Factorio discord chat that we are using RHD/LHD wrong.
Huh, ok. I just got through doing some googling, too, and yeah, you're right. :/ Will probably take me a while to unlearn that....
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 3 and 4 way intersections

Post by hansjoachim »

FuryoftheStars wrote: Wed Jun 01, 2022 2:30 pm
hansjoachim wrote: Wed Jun 01, 2022 2:24 pm On the old 4 way forum aaargha used RHD/LHD wrong and I think many learned it from there. I think especially us that are non native English speakers didn't question it. I didn't question it before I saw multiple times in the Factorio discord chat that we are using RHD/LHD wrong.
Huh, ok. I just got through doing some googling, too, and yeah, you're right. :/ Will probably take me a while to unlearn that....
I think the terms can live side by side. Switching LHD with RHD would make chaos, so going to RHT and LHT is easier since it's only changing a letter
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: 3 and 4 way intersections

Post by FuryoftheStars »

hansjoachim wrote: Wed Jun 01, 2022 3:12 pm
FuryoftheStars wrote: Wed Jun 01, 2022 2:30 pm
hansjoachim wrote: Wed Jun 01, 2022 2:24 pm On the old 4 way forum aaargha used RHD/LHD wrong and I think many learned it from there. I think especially us that are non native English speakers didn't question it. I didn't question it before I saw multiple times in the Factorio discord chat that we are using RHD/LHD wrong.
Huh, ok. I just got through doing some googling, too, and yeah, you're right. :/ Will probably take me a while to unlearn that....
I think the terms can live side by side. Switching LHD with RHD would make chaos, so going to RHT and LHT is easier since it's only changing a letter
Agreed, I get that. I'm just saying it's going to take me a while to unlearn (or relearn) what LHD and RHD really mean.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 3 and 4 way intersections

Post by hansjoachim »

FuryoftheStars wrote: Wed Jun 01, 2022 3:16 pm
hansjoachim wrote: Wed Jun 01, 2022 3:12 pm
FuryoftheStars wrote: Wed Jun 01, 2022 2:30 pm
hansjoachim wrote: Wed Jun 01, 2022 2:24 pm On the old 4 way forum aaargha used RHD/LHD wrong and I think many learned it from there. I think especially us that are non native English speakers didn't question it. I didn't question it before I saw multiple times in the Factorio discord chat that we are using RHD/LHD wrong.
Huh, ok. I just got through doing some googling, too, and yeah, you're right. :/ Will probably take me a while to unlearn that....
I think the terms can live side by side. Switching LHD with RHD would make chaos, so going to RHT and LHT is easier since it's only changing a letter
Agreed, I get that. I'm just saying it's going to take me a while to unlearn (or relearn) what LHD and RHD really mean.
I don't think you need to, since people will use RHD for RHT in Factorio for years to come. I'm pretty sure no one will call "RHT" for LHD.
Post Reply

Return to “Railway Setups”