Express train lanes?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
avatar8481
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Oct 23, 2018 4:57 pm
Contact:

Express train lanes?

Post by avatar8481 »

Is there a way (in either vanilla or with a mod) to build an 'express rail lane' system? I'm thinking analsgously of 4-track systems where the inner 2-way pair has fewer stops or off ramps? I think you'd need some way of creating non-intersecting overlapping rails, so I think it would have to be a mod unless you designed around the limitation?

I found results on pathfinding etc, but nothing about how to force long-haul trains on to express lanes...

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5201
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Express train lanes?

Post by eradicator »

avatar8481 wrote: ↑
Tue Oct 23, 2018 5:04 pm
I think you'd need some way of creating non-intersecting overlapping rails, [...]
Impossible. Just stop wasting time thinking about it. If you want to waste time or don't believe me you can search for "tunnel" or "bridge" on the forums.

I've personally had some success with using unnamed stops. This abuses the fact that stations have a large penalty on pathfinding, so every train tries to use the inner lanes, except for those that have no other choice.
unnamed.jpg
unnamed.jpg (163.87 KiB) Viewed 2952 times
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

avatar8481
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Oct 23, 2018 4:57 pm
Contact:

Re: Express train lanes?

Post by avatar8481 »

Yeah, that's what I figured, and I see the long history of 'underground trains etc' questions. Your solution is interesting, and I suppose you could design the system around a constraint of making the whole 'express lane' thing one-sided (i.e. never having crossing tracks over your center express lanes).

zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1112
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Express train lanes?

Post by zOldBulldog »

I don't know how to do it but I can positively tell you that it can be done.

If you play with the main 8-chunk segments from this blueprint book (https://factorioprints.com/view/-LPOOJ-GsdY4h7KTnHgc) you will notice that the trains stubbornly insist on running on the outer lanes.

The trick is clearly to understand the pathfinder and what design elements make it prefer a particular set of tracks.

Of course, I have yet to figure that out, but if you find any good information please point me to it. I would love to tweak those blueprints to make the 2nd set of tracks from the center the preferred one, so that it only goes to the center lanes for returns or when congested, and only goes to the exit lanes when... exiting. Throughput for that design has been better than I expected, but it frustrates my OCD that I can't force the trains to prefer the tracks I want them to use.

Maybe Eradicator's unnamed stop idea is the answer.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5201
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Express train lanes?

Post by eradicator »

zOldBulldog wrote: ↑
Wed Oct 24, 2018 8:38 am
If you play with the main 8-chunk segments from this blueprint book (https://factorioprints.com/view/-LPOOJ-GsdY4h7KTnHgc) you will notice that the trains stubbornly insist on running on the outer lanes.
(If that page has more pictures than that one thumbnail i don't see them, so based on that.)
Preferring the outer lanes is trivial. Because the outer lanes are closer to the exit branches, and thus they're always the shortest route (unless blocked by other trains). So by applying a penalty to the outer route i make the inner route "shorter".
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1112
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Express train lanes?

Post by zOldBulldog »

eradicator wrote: ↑
Wed Oct 24, 2018 9:18 am
zOldBulldog wrote: ↑
Wed Oct 24, 2018 8:38 am
If you play with the main 8-chunk segments from this blueprint book (https://factorioprints.com/view/-LPOOJ-GsdY4h7KTnHgc) you will notice that the trains stubbornly insist on running on the outer lanes.
(If that page has more pictures than that one thumbnail i don't see them, so based on that.)
Preferring the outer lanes is trivial. Because the outer lanes are closer to the exit branches, and thus they're always the shortest route (unless blocked by other trains). So by applying a penalty to the outer route i make the inner route "shorter".
Except that it chooses the outer lanes even when the ultimate destination is only reachable through the inner ones (only switching to the inner at the last segment) . There has to be a reason why it does that, and I bet that understanding that reason would make it easier to force the pathfinder to prefer any desired lane, even without an unnamed stop.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5201
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Express train lanes?

Post by eradicator »

zOldBulldog wrote: ↑
Wed Oct 24, 2018 11:19 am
eradicator wrote: ↑
Wed Oct 24, 2018 9:18 am
zOldBulldog wrote: ↑
Wed Oct 24, 2018 8:38 am
If you play with the main 8-chunk segments from this blueprint book (https://factorioprints.com/view/-LPOOJ-GsdY4h7KTnHgc) you will notice that the trains stubbornly insist on running on the outer lanes.
(If that page has more pictures than that one thumbnail i don't see them, so based on that.)
Preferring the outer lanes is trivial. Because the outer lanes are closer to the exit branches, and thus they're always the shortest route (unless blocked by other trains). So by applying a penalty to the outer route i make the inner route "shorter".
Except that it chooses the outer lanes even when the ultimate destination is only reachable through the inner ones (only switching to the inner at the last segment) . There has to be a reason why it does that, and I bet that understanding that reason would make it easier to force the pathfinder to prefer any desired lane, even without an unnamed stop.
If trains work similar to biters than the path graph is an A* weighted graph. So the reason it "prefers" the outer lanes is that it enters the system from the outer lanes. There's no magic involved. It's all about path length == cost.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1112
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Express train lanes?

Post by zOldBulldog »

eradicator wrote: ↑
Wed Oct 24, 2018 2:42 pm
zOldBulldog wrote: ↑
Wed Oct 24, 2018 11:19 am
eradicator wrote: ↑
Wed Oct 24, 2018 9:18 am
zOldBulldog wrote: ↑
Wed Oct 24, 2018 8:38 am
If you play with the main 8-chunk segments from this blueprint book (https://factorioprints.com/view/-LPOOJ-GsdY4h7KTnHgc) you will notice that the trains stubbornly insist on running on the outer lanes.
(If that page has more pictures than that one thumbnail i don't see them, so based on that.)
Preferring the outer lanes is trivial. Because the outer lanes are closer to the exit branches, and thus they're always the shortest route (unless blocked by other trains). So by applying a penalty to the outer route i make the inner route "shorter".
Except that it chooses the outer lanes even when the ultimate destination is only reachable through the inner ones (only switching to the inner at the last segment) . There has to be a reason why it does that, and I bet that understanding that reason would make it easier to force the pathfinder to prefer any desired lane, even without an unnamed stop.
If trains work similar to biters than the path graph is an A* weighted graph. So the reason it "prefers" the outer lanes is that it enters the system from the outer lanes. There's no magic involved. It's all about path length == cost.
That's the easy grand statement. We all know that.

The tricky bit is to figure out *exactly* how it does it, then we will be able to make it do exactly what we want.

I eventually will figure it out, but I have so many other projects in the hopper right now that it is a low priority for me (I still pay attention to it when I see it in discussion but I'm not actively working on it as my main focus).

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5201
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Express train lanes?

Post by eradicator »

zOldBulldog wrote: ↑
Wed Oct 24, 2018 3:16 pm
The tricky bit is to figure out *exactly* how it does it, then we will be able to make it do exactly what we want.

I eventually will figure it out, but I have so many other projects in the hopper right now that it is a low priority for me (I still pay attention to it when I see it in discussion but I'm not actively working on it as my main focus).
I was going to suggest just asking a dev, but then i googled and someone already did.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1112
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Express train lanes?

Post by zOldBulldog »

eradicator wrote: ↑
Wed Oct 24, 2018 3:47 pm
zOldBulldog wrote: ↑
Wed Oct 24, 2018 3:16 pm
The tricky bit is to figure out *exactly* how it does it, then we will be able to make it do exactly what we want.

I eventually will figure it out, but I have so many other projects in the hopper right now that it is a low priority for me (I still pay attention to it when I see it in discussion but I'm not actively working on it as my main focus).
I was going to suggest just asking a dev, but then i googled and someone already did.
Cool. That thread looks with studying.

quyxkh
Filter Inserter
Filter Inserter
Posts: 903
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Express train lanes?

Post by quyxkh »

avatar8481 wrote: ↑
Tue Oct 23, 2018 5:04 pm
Is there a way (in either vanilla or with a mod) to build an 'express rail lane' system? I'm thinking analsgously of 4-track systems where the inner 2-way pair has fewer stops or off ramps? I think you'd need some way of creating non-intersecting overlapping rails, so I think it would have to be a mod unless you designed around the limitation?
It's going to depend on exactly what effects you're after. Here's a proof-of-concept design that imposes a mild lane-switching cost, so every train will try to route on the lane it starts out closest to, its local-traffic lane. A train will reroute and switch to the other lane if it ever has to brake and (a) switching avoids the need to brake and (b) there's an opportunity to switch back later. Trains plan their entire route on departure so this won't strictly maintain fast-lane/slow-lane dynamics, every train that routes while any train would switch to the inner lane will likely also plan its route through the inner lane, but if it turns out that introduces congestion they'll try to repath when they hit it.
snap@T906498=2336x896+3.5-48.5,z2.jpg
snap@T906498=2336x896+3.5-48.5,z2.jpg (133.04 KiB) Viewed 2737 times
You have to understand what this does: it only makes keeping the same lane a little more attractive, there's no congestion-planning foresight wired in to this. If you make your local-traffic routes a bit longer than the straight express route, put some unavoidable wiggles into the local blocks not shown above, trains will prefer to switch to the express lane for destinations farther away.

*edit: took irrelevant bits out of picture
Last edited by quyxkh on Thu Oct 25, 2018 12:42 pm, edited 1 time in total.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5201
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Express train lanes?

Post by eradicator »

@quyxkh:
That lane switch happens to be exactly what i use in combination with the above mentiond unnamed stops. Minus the four signals on the middle straights. ^^
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1112
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Express train lanes?

Post by zOldBulldog »

quyxkh wrote: ↑
Wed Oct 24, 2018 4:09 pm
avatar8481 wrote: ↑
Tue Oct 23, 2018 5:04 pm
Is there a way (in either vanilla or with a mod) to build an 'express rail lane' system? I'm thinking analsgously of 4-track systems where the inner 2-way pair has fewer stops or off ramps? I think you'd need some way of creating non-intersecting overlapping rails, so I think it would have to be a mod unless you designed around the limitation?
It's going to depend on exactly what effects you're after. Here's a proof-of-concept design that imposes a mild lane-switching cost, so every train will try to route on the lane it starts out closest to, its local-traffic lane. A train will reroute and switch to the other lane if it ever has to brake and (a) switching avoids the need to brake and (b) there's an opportunity to switch back later. Trains plan their entire route on departure so this won't strictly maintain fast-lane/slow-lane dynamics, every train that routes while any train would switch to the inner lane will likely also plan its route through the inner lane, but if it turns out that introduces congestion they'll try to repath when they hit it.snap@T222307=2336x864-1.5-56.5,z2.jpg

You have to understand what this does: it only makes keeping the same lane a little more attractive, there's no congestion-planning foresight wired in to this. If you make your local-traffic routes a bit longer than the straight express route, put some unavoidable wiggles into the local blocks not shown above, trains will prefer to switch to the express lane for destinations farther away.
I assume the "stay in your lane" priority increase comes from the wired signal. Could you explain how it does it?

Thanks.

quyxkh
Filter Inserter
Filter Inserter
Posts: 903
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Express train lanes?

Post by quyxkh »

zOldBulldog wrote: ↑
Wed Oct 24, 2018 4:22 pm
I assume the "stay in your lane" priority increase comes from the wired signal. Could you explain how it does it?
Not the signal, didn't intend to include that wiring, sorry, it's purely the extra path length from the wiggle.

evopwr
Fast Inserter
Fast Inserter
Posts: 159
Joined: Fri Apr 28, 2017 1:45 am
Contact:

Re: Express train lanes?

Post by evopwr »

aha! I saw your wiggle lane changer a week ago on a different thread, and it confused me - thinking, why on earth have you done that when you can make the intersection much smaller etc. Now I understand!

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

Re: Express train lanes?

Post by mrvn »

quyxkh wrote: ↑
Wed Oct 24, 2018 4:09 pm
avatar8481 wrote: ↑
Tue Oct 23, 2018 5:04 pm
Is there a way (in either vanilla or with a mod) to build an 'express rail lane' system? I'm thinking analsgously of 4-track systems where the inner 2-way pair has fewer stops or off ramps? I think you'd need some way of creating non-intersecting overlapping rails, so I think it would have to be a mod unless you designed around the limitation?
It's going to depend on exactly what effects you're after. Here's a proof-of-concept design that imposes a mild lane-switching cost, so every train will try to route on the lane it starts out closest to, its local-traffic lane. A train will reroute and switch to the other lane if it ever has to brake and (a) switching avoids the need to brake and (b) there's an opportunity to switch back later. Trains plan their entire route on departure so this won't strictly maintain fast-lane/slow-lane dynamics, every train that routes while any train would switch to the inner lane will likely also plan its route through the inner lane, but if it turns out that introduces congestion they'll try to repath when they hit it.snap@T222307=2336x864-1.5-56.5,z2.jpg

You have to understand what this does: it only makes keeping the same lane a little more attractive, there's no congestion-planning foresight wired in to this. If you make your local-traffic routes a bit longer than the straight express route, put some unavoidable wiggles into the local blocks not shown above, trains will prefer to switch to the express lane for destinations farther away.
What are the circuit connections set to?

quyxkh
Filter Inserter
Filter Inserter
Posts: 903
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Express train lanes?

Post by quyxkh »

mrvn wrote: ↑
Thu Oct 25, 2018 9:31 am
What are the circuit connections set to?
They're irrelevant, didn't mean to include them, I fixed the picture.

Ace_W
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Tue Oct 04, 2016 12:13 am
Contact:

Re: Express train lanes?

Post by Ace_W »

Off topic: I wonder. Could we get a signal that mimics the station penalty but not act as a signal? Or a way to force a chain signal or rail signal to do the same via the circuit network.

It sounds like it's possible to do in game.

As for designating a "fast lane" you could abuse chain signals with circuits. Forcing certain trains to turn onto certain paths.
"No! This one goes there! That one goes There! Right?!"

quyxkh
Filter Inserter
Filter Inserter
Posts: 903
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Express train lanes?

Post by quyxkh »

Ace_W wrote: ↑
Fri Oct 26, 2018 4:51 am
It sounds like it's possible to do in game.
Easiest is wire two signals right next to each other, set the back one to no-readout, close if everything = 0, set the front one to no-close, no signal on green. I use this on roro exits, it makes through trains not loop through the roro when there's a turnaround anywhere nearby unless a train's currently leaving the stop (and in that case, yay anyway; I'm trying to prevent a clogged stop and that won't happen when nothing's stopping). That's not a general solution, to add a circuit penalty you need quiet track. An express route at capacity, I don't think it's practical, the ideal there is every signal block reserved or occupied.

evopwr
Fast Inserter
Fast Inserter
Posts: 159
Joined: Fri Apr 28, 2017 1:45 am
Contact:

Re: Express train lanes?

Post by evopwr »

Ace_W wrote: ↑
Fri Oct 26, 2018 4:51 am
Off topic: I wonder. Could we get a signal that mimics the station penalty but not act as a signal? Or a way to force a chain signal or rail signal to do the same via the circuit network.

It sounds like it's possible to do in game.

As for designating a "fast lane" you could abuse chain signals with circuits. Forcing certain trains to turn onto certain paths.
Would be a handy mod. Something you can place, and click on it, and enter your custom penalty value.

Post Reply

Return to β€œGameplay Help”