After playing for a bit with railways I have discovered that there are always alignment problems. Like, for example, never enough space for a station or a crossing. The answer to that were modular systems but I could never force my modules to place power poles and signals consistently and my inner OCD screamed alot. Also, there was way more hand-routing rails than I would prefer. I have solved all of those problems though with modular railway blueprint system that is additionally chunk-aligned. Yes, you do have to use f5 to correctly align building blocks, but it gives you major speedup in rail-laying, great ease of rail planning and is very OCD-friendly.
What I'm presenting below is in no way optimal, complete nor finished, but it's what I'm using right now and does the job really well for me.
The modules are as follows (left to right, top to bottom): straight rails, end loop, 3-way crossing, unloading station base, outpost station for ores, unloading station bay module, outpost station for crude oil. There is no 4-way crossing becouse I couldn't fit it in one chunk though surprisingly I never felt like I need one. There is also no 90-degree turn, but, again, never needed one. I prefered to make long straight rails finishing with loops and branch from those. Loading stations are meant for 1 train only, that's why no waiting bays. Unloading station has got a small waiting bay in form of this curvy-loopy rail, it holds 5 trains. Everything is fitted for 1-2 trains.
modules
modules with grid turned on
Below there is a map I've been playing, developing and testing those railways; about . Becouse on my map there is not very much water, I did not need any 90-degree turns. Most of rails were laid after claiming the area for ease of player transportation, that's why they don't lead anywhere. About building outposts, I simply make a branch from main railway, place few straight blocks, then outpost station and a loop.
map
A few random associated thoughts:
You could do a train stop at the end of every loop. Those are usual locations you go to when passenger-driving.
I wish that Big Electric Poles were of wire reach 32 (chunk size) not 30. Same for substations, 16 reach instead of 14... Things should have power-of-two sizes/ranges
You do like radars to see your trains and placing them along rails (every 7 chunks) is an excellent method of doing that.
Chunk-aligned main bus style factory modules are not that stupid. Haven't tested.
For the last part, blueprint book to load from Foreman tool.
do local _={blueprints={{name="Railways_0",data="H4sIAAAAAAAA/5XT4W6DIBAH8FcxfoamjEm7NLzEXsA4vTgSCgbpVkN496Euq0ZS3Dcj/vzD3dHoTOq6klnJnai16rlzvWhVJbmzQwc8FxauOVLVNTybSsjc\nI6EauHPiPQJlhRUwqscXeP5Bjjrdh1WtuLtzfDwUaOCY0EPhUSMM1NPSi0e/tL6ZL2jwlLGmMyRLxtK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pVeXjUHyoW0OmQHMfK3k59P\nCR7dH87130v2H7SS6y4PYN+vYtenshM6NU258Qp5cBfZ1peZuvJ95JLFuIuGe5I5KuUCcVlZIy6aVpMorO+2NvPKDdk2id/N2WZ1KmZ+vgomzgmWx7LgLuCt\n2wtiGOgf2CzPnGEIes8DwGIYLIHBsAE2XQ1jBw2f7kX9t1R+SeQp/+L7ZNO/MSI6Vr/s30hd/geAq0ccnR4AAA==\n"}},name="Railways_forum"};return _;end
Re: Chunk-aligned modular railway system
Posted: Sun Feb 19, 2017 12:27 pm
by Nilaus
I am myself struggling a bit with the proper rail setups, so it is nice to be inspired.
I like the idea of aligning it to chunks. The loops at the end of each can generate detours as I see it: When a train is done loading at an outpost it has 2 options for returning; Taking the returning track or continuing to the loop and then returning. It doesn't happen often when the train network is not fully utilised, but as it get more congested strange pathing happens. However, your setup will not jam.
Additionally, I think you need stackers by your unloading stations (this is a hint to me that it is not particularly congested train network)
You main line below your base can be rather crowded with only 2 tracks. Is that a problem you are seeing? My experience is that 4 tracks is where the problems with jamming and pathfinding really starts happening
Re: Chunk-aligned modular railway system
Posted: Sun Feb 19, 2017 6:31 pm
by quinor
Detours are not a problem at all. No jams, that's VERY big deal for me Lack of stack inserters on outpost station loading from belt is just resource optimisation, you don't need those while loading from belt to chests with multiple inserters. There are though (or should be) stack inserters everywhere else. I don't have enough trains on the main line to jam yet. When this base turns into a megabase and I might have bottlenecks on "main" line I will probably move to a different system. From what I know 4-track system due to pathing isn't at all 2x better from 2-track one and I would be rather smartly placing unloading stations (ie. separate "main" lines for copper and iron) to reduce load of the critical lines.
Re: Chunk-aligned modular railway system
Posted: Mon Feb 20, 2017 2:10 pm
by Deadly-Bagel
Your intersection is pretty similar to mine:
Three Way Intersection
Not as compact as yours but symmetrical, and I use regular signals where rails split (still use chain for merges and crosses) because a train stuck behind you is stuck behind you no matter where you park. Just means they can creep forward a little more.
Hard to tell at a glance but do your power poles form a sort of grid that you base all the rail locations off? So that if you loop around something you guarantee it will meet up on the other side (should you want to).
Re: Chunk-aligned modular railway system
Posted: Mon Feb 20, 2017 3:45 pm
by quinor
I might have been inspired by your design among others. About "normal" signals inside: I want a train entering the intersection to leave it asap, that's why no regular signals inside. Matter of throughout and reliability. Also, blocks should be longer than your longest train to prevent deadlocks - again reliability. And a couple of tiles doesn't really make a difference in overall efficiency.
Re: Chunk-aligned modular railway system
Posted: Wed May 10, 2017 11:07 pm
by sparr
Can you elaborate on why chunk alignment is relevant here? What will go wrong if I use your system but just offset everything by 3 tiles east and 7 tiles north?
Re: Chunk-aligned modular railway system
Posted: Thu May 11, 2017 1:07 am
by iceman_1212
sparr wrote:Can you elaborate on why chunk alignment is relevant here? What will go wrong if I use your system but just offset everything by 3 tiles east and 7 tiles north?
i am also curious about this. is it purely for aesthetics when playing with grid debug option turned on?
also, these three signals can be rail signals, in case folks are still using this version of the intersection. just need to leave sufficient space until the following rail signal.
Re: Chunk-aligned modular railway system
Posted: Thu May 11, 2017 7:25 am
by quinor
sparr wrote:Can you elaborate on why chunk alignment is relevant here? What will go wrong if I use your system but just offset everything by 3 tiles east and 7 tiles north?
Nothing, it will work just as well as long as you keep the offset on every chunk the same. The deal is, if you chunk-align it, you can start building rails from two sides and they'll match anyway. Every time. Brainless. Also, if you use map view you can leave x chunks of free space and if you know your build is x chunks wide it will fit perfectly. For example, 2x2 chunk solars+roboport or chunk-aligned walls
I've also made (for my game) other chunk-aligned peices of factory. I was inspired by viewtopic.php?f=8&t=8377 and wanted to extend that concept into entire game.
Re: Chunk-aligned modular railway system
Posted: Thu May 11, 2017 9:11 am
by Aeternus
What's the deal with that weird S track? I don't see how that is useful.
Re: Chunk-aligned modular railway system
Posted: Thu May 11, 2017 9:18 am
by sparr
Aeternus wrote:What's the deal with that weird S track? I don't see how that is useful.
Without that, that side of the station connection would extend outside the chunk to the left.
Re: Chunk-aligned modular railway system
Posted: Thu May 11, 2017 9:28 am
by quinor
Ahh, almost. It's the waiting bay for trains, fits 3 1-2 trains afair.
Re: Chunk-aligned modular railway system
Posted: Thu May 11, 2017 3:27 pm
by Shokubai
Deadly-Bagel wrote:Your intersection is pretty similar to mine:
Three Way Intersection
Not as compact as yours but symmetrical, and I use regular signals where rails split (still use chain for merges and crosses) because a train stuck behind you is stuck behind you no matter where you park. Just means they can creep forward a little more.
Hard to tell at a glance but do your power poles form a sort of grid that you base all the rail locations off? So that if you loop around something you guarantee it will meet up on the other side (should you want to).
Your signals are in the wrong order. Your chains should be regular and your regular should be chains except for those center chains.
Re: Chunk-aligned modular railway system
Posted: Thu May 11, 2017 4:26 pm
by quinor
I see, it's weird though I haven't noticed it earlier...
Re: Chunk-aligned modular railway system
Posted: Fri May 12, 2017 1:37 pm
by Deadly-Bagel
iceman_1212 wrote:also, these three signals can be rail signals, in case folks are still using this version of the intersection. just need to leave sufficient space until the following rail signal.
Shokubai wrote:Your signals are in the wrong order. Your chains should be regular and your regular should be chains except for those center chains.
No, this is exactly as it needs to be. Chain Signals are required directly before where the rails cross and I additionally use chains for every signal after the intersection to ensure there is enough room for the train to stop at the next regular signal without blocking the junction. It's mainly to allow two of these to be placed next to each other or for tight loops that would otherwise leave a signal very close to the junction and allow the junction to be blocked, I've done this as a result of trial and error. It's safer this way.
The outer signals (eg Southbound turning West) don't need to be chains because there isn't an intersection, it doesn't matter if the train queues up on the side there as it wouldn't be blocking anything that wouldn't be blocked anyway. I've used this intersection design heavily and never had any problems, the only issue is if you put two next to each other (for a pseudo-four-way junction) and you have a bunch of loops and your trains like changing direction mid-intersection then it can get deadlocked but that's a problem with Factorio itself, not the intersection.
Re: Chunk-aligned modular railway system
Posted: Thu May 18, 2017 10:09 pm
by iceman_1212
Deadly-Bagel wrote:
iceman_1212 wrote:also, these three signals can be rail signals, in case folks are still using this version of the intersection. just need to leave sufficient space until the following rail signal.
Shokubai wrote:Your signals are in the wrong order. Your chains should be regular and your regular should be chains except for those center chains.
No, this is exactly as it needs to be. Chain Signals are required directly before where the rails cross and I additionally use chains for every signal after the intersection to ensure there is enough room for the train to stop at the next regular signal without blocking the junction. It's mainly to allow two of these to be placed next to each other or for tight loops that would otherwise leave a signal very close to the junction and allow the junction to be blocked, I've done this as a result of trial and error. It's safer this way.
Agree that chains are required directly before crossings to prevent deadlock. Only in very specific situations are chains required after the crossing to prevent deadlock in a 2-rail network and I guess I disagree re: including them in a blueprint that will be used everywhere.
Re: Chunk-aligned modular railway system
Posted: Fri May 19, 2017 4:59 am
by Miravlix
iceman_1212 wrote:Agree that chains are required directly before crossings to prevent deadlock. Only in very specific situations are chains required after the crossing to prevent deadlock in a 2-rail network and I guess I disagree re: including them in a blueprint that will be used everywhere.
I've mentioned it before. Chain signals creates deadlocks.
Two way rail:
Chain -> North/south line -> rail signal
rail signal <- North/south line <- chain
Have a train come and reserve the east->west lane, before it leaves a train arrives from west and reserves the line, then another east train reserve the line, over and over and North/South is now deadlocked, unable to get access past the other trains.
You might call it a soft deadlock, because maybe the deadlocked direction will someday get an opening, if the traffic allows it, but it is something touted to be the way to go for inexperienced train operators, when it should be avoided at all cost, unless you're a train expert and know what you're doing. You definitely should never ever recommend usage of chain signals without a BIG FAT disclaimer about the problems of them.
Re: Chunk-aligned modular railway system
Posted: Fri May 19, 2017 1:03 pm
by Deadly-Bagel
Miravlix wrote:Have a train come and reserve the east->west lane, before it leaves a train arrives from west and reserves the line, then another east train reserve the line, over and over and North/South is now deadlocked, unable to get access past the other trains.
You're going to need to provide a screenshot or something, even of just the intersection.
Chain signals don't cause any more deadlocks than regular signals - functionally they are identical to moving the next regular signal up other than that they allow travel within the same chunk (so to speak) as long as the paths don't intersect. The only problem with them is that trains can change their path mid-intersection and suddenly stop somewhere they shouldn't, but that's a pathing issue rather than an issue with chain signals.
iceman_1212 wrote:I guess I disagree re: including them in a blueprint that will be used everywhere.
Why not? The impact on throughput is virtually nonexistent and this solves any problems related to having regular signals too close for whatever reason, or the rare occasion a train runs out of fuel just past the intersection. On the occasion you do need them due to nearby signals or w/e you don't need to put them in, they're already there.
Going more in-depth on the throughput (which is really the only negative), it just means trains can't follow each other quite as closely. Given the speed they travel at you're only slowing the second train by something like 0.3s total for the entire route (as once the gap is established it's irrelevant if further intesections have these signals), not nearly enough to make a quantifiable difference. In high-throughput train networks where an intersection might see 30+ trains every minute yeah this becomes more of an issue but given that circumstance you would be better off designing a better rail network.