# Efficient on-ramp for 2 rail lanes

In my current factory I use a very clean train setup: there is one very long main 2+2 line consisting of 2 rails per direction which connects all mining outposts with the main factory in a linear fashion. From this main line, secondary 1+1 lines branch off to close-by outposts.

All these branches are partial T-junctions, i.e., if the main line goes West-East, with the factory in the east, and the outpost is to the South, then trains can go West->East, East->West, East->South or South->East, but not South->West or West->South.

This is the simpler version I have, where the trains come from the East, go South to the outpost, then join the main line again towards the East:

Often trains can also come from the East and cross to the South - but this case should be ignored for this question to keep it manageable. If you look closely, as regarding this questions, both designs are equivalent. I want to solve the problem of a West->East and a South->East train conflicting.

So far so good, connecting everything with signals and chain signals so it's correctly signaled is easy. The problem occurs when a train wants to travel South->East and another train goes West->East. When the stars align just wrongly, either train stops to let the other pass and a lot of time is lost.

To battle this, I am placing regular lane switches along the main line - i.e. places where a train going West->East can switch between the two rails going in that direction. I've placed one switch before each of these junctions. A human driver coming along in the West->East direction would see the other train coming from the South, and quickly hop onto the North rail, leaving the junction open for the other train.

Unfortunately, in some tests I've done, it doesn't seem like the trains are "getting it", all the time; i.e. often the train speeding along West->East sticks to the South rail, forcing the other train to stop and wait (or vice versa); frustratingly, it could just as well switch to the North rail at little to no cost.

Is there a way to encourage this to happen more frequently?

• Some pictures wouldn't hurt... Commented Feb 6, 2023 at 15:01
• Done, @Kyralessa.
– AnoE
Commented Feb 6, 2023 at 16:36

As a general rule, trains don't change their routes “in real time” in response to what other trains are doing — they make a plan when they start moving and then update it only if they're actually blocked from continuing (or a few other cases). If you want your tracks to be used differently, you'll have to change their length or connectivity.

I'm not sure if this will actually be more efficient, but here is an idea to attempt to improve the behavior: Instead of treating your 2 tracks equivalently (any train can enter any track), make the outer (north) track “slow” and the inner (south) track “fast”.

1. Remove the part of the junction that allows the train heading south→east to use the north track, so it always enters onto the south track.
2. Make the south track artificially slightly longer (add an unnecessary curve down and up in various places) so that trains prefer the north track if there's space on it.
• Thanks, I will try that, @KevinReid. Regarding trains not changing in "real time"... now that you bring that point up, I seem to remember to read somewhere that they do "micro-planning" when encountering a chain signal (i.e., to recalculate the path towards the exit, AKA the next regular signal), but I guess I remember wrongly. I will try as you suggest to make the outer lane less attractive.
– AnoE
Commented Feb 7, 2023 at 8:12
• "I seem to remember to read somewhere" — perhaps they do; it's been years since I really studied train behavior. Commented Feb 7, 2023 at 15:55
• I tried your approach, i.e., use tricks to make the trains go primarily onto the inner rail for the long haul... I found that didn't really increase throughput on average for me. Eventually I ended up adding more parallel rails (a few screens north/south), and everything coming together in a gigantic buffered intersection. So, 1/3rd of the "local" traffic is fine on my original tracks, and the buffering on the large one works wonders to avoid this style of locally halting trains.
– AnoE
Commented Apr 11, 2023 at 10:45