Express train lanes?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Express train lanes?

Post by zOldBulldog »

quyxkh wrote: Sun Oct 28, 2018 12:41 pm
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.
I am currently using the approach of naming a stop with a space. But it still shows the stop as a dot in the map and I'd rather avoid it. So I tried to follow your instructions.

This is what I understood "overall":
signals.jpg
signals.jpg (192.97 KiB) Viewed 2527 times
For the rear signal configuration I understood this:
signalRear.jpg
signalRear.jpg (22.65 KiB) Viewed 2527 times
But for the front one I don't quite get it. Setting to not Close but instead Read makes sense. But it does not have an option to set it to no signal on green:
signalFront.jpg
signalFront.jpg (24.68 KiB) Viewed 2527 times
So I tried to achieve it by putting a Decider Combinator between them (which I guessed is what you meant):
signalCombinator.jpg
signalCombinator.jpg (23.97 KiB) Viewed 2527 times
Except that when I do this... the rear signal becomes red when the front is green... making the track permanently red.

Questions:

1) I clearly misunderstood you. What exactly were you saying?

2) I suspect that maybe you didn't mean to put them in the same track, but rather the "rear" signal on the upper track and the "front" signal on the middle track (names that I used for the screenshots). But even then... it would disable the upper track when the lower one is free, and I still want local trains (headed to an exit) to be able to go to the low priority track. So... how would you use signals and/or circuits (instead of unnamed stops) to somehow lower the priority of the upper track?

Basically, when both tracks are free I want the middle track to get used, when it is occupied the lower track to be used, when both are occupied overflow to the top one, and finally... when a train needs to take an exit hanging off the top branch then it also takes the top one. Currently that happens when I place a "space" named stop on the top branch, but it shows in the map:
blankStop.jpg
blankStop.jpg (266.64 KiB) Viewed 2526 times
quyxkh
Smart Inserter
Smart Inserter
Posts: 1031
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Express train lanes?

Post by quyxkh »

Right-click the green signal readout on the front signal, the readouts are completely configurable, you can set them to anything you want. Set it to no output at all for green condition with that right click.
Attachments
Screenshot from 2018-10-29 14-57-55.png
Screenshot from 2018-10-29 14-57-55.png (59.48 KiB) Viewed 2519 times
zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Express train lanes?

Post by zOldBulldog »

quyxkh wrote: Mon Oct 29, 2018 9:55 pm Right-click the green signal readout on the front signal, the readouts are completely configurable, you can set them to anything you want. Set it to no output at all for green condition with that right click.
Cool, that saves from using a combinator, a simple wire now connects the two signals. But it still makes the rear signal red. Also, I am now fairly certain that you meant to put one signal on each track, with the red one on the track to close.

Except... I didn't want to close the track, just make it less likely to be picked than the other one (unless that other one was already occupied).

Did I miss something, or is this a cool solution that might not quite apply in this case? Is the blank stop solution the only viable one, or is there some other way to use signals and circuits to raise/lower the priority of a track?
quyxkh
Smart Inserter
Smart Inserter
Posts: 1031
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Express train lanes?

Post by quyxkh »

nono, as soon as a train reserves the front signal, there's a nonzero circuit signal and the back rail signal opens.
zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Express train lanes?

Post by zOldBulldog »

quyxkh wrote: Mon Oct 29, 2018 10:09 pm nono, as soon as a train reserves the front signal, there's a nonzero circuit signal and the back rail signal opens.
I understand that. But it is not quite what I need (which I *think* is also what the OP asked for).

What I need is a slightly more complex set of scenarios:

- One track to be the "preferred" track.
- Trains usually take the preferred track.
- Both tracks to be available all the time, especially in these cases:
--- The preferred track is occupied. Then the non-preferred track is used as "overflow".
--- The train is headed to a stop that is on the non-preferred track, or on a stop that can only be reached by going through the non-preferred track.

The very last screenshot does exactly that, but relies on a train stop to achieve it. I would like to do it with signals/circuits if it is possible. Specifically in the screenshot:
- The top lane is the lowest priority lane. It is used almost exclusively for exits to the factory stations. That is why it is not a continuous lane, it isn't supposed to be used except for local traffic.
- The next one is the high priority lane.
- The 3rd lane (center of the 6-lane tracks) is both overflow when the high priority lane is occupied and also to "change direction without crossing lanes".
quyxkh
Smart Inserter
Smart Inserter
Posts: 1031
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Express train lanes?

Post by quyxkh »

The problem you're going to have there is trains path only (excepting non-train interference) when they have to brake, or at intervals at chain signals, or when they depart after stopping. The full details are sensible, but beyond gory.

This simple signal's set to discourage pathing on that branch, and it satisifies all your conditions except the "use this if the other one's occupied". To fix that, you can include the other path's entry signal(s) on the blocker circuit, so the blocker signal sees a train's presence on _either_ path as reason to open. Trains will still do their initial pathing with the circuit conditions they see at departure, always preferring the, uh, preferred path if it's open, but when they approach they'll start reserving blocks on that path, and the other path will open, and if the approaching train's braking point reaches a red signal on the preferred path while it still has the option to take the (now not penalized) other path, it'll take that instead.

You can force a repath by showing a train a red signal for a tick or three, one tick would do it but to get exactly one you have to know exactly how fast a train's going and exactly where it is, not an easy feat with the 60Hz and 1m sample strobe limits and train acceleration and all. Best I've been able to find that I think guarantees a repath I did myself, but I have more fun inventing and playing so I could perhaps too easily have missed something good. Anyway, here's mine. The description there's got a boner in it, accelerating trains see too much red not too little, but the device works as advertised. If you want every train to take the best path according to the conditions near its time of arrival, you'll have to show it some red. But really, is that necessary for your use? It's not really for most of mine, if it plotted a path that looked shorter at the time and the path still looks open, it's generally fine to just let it take that path, no?
Last edited by quyxkh on Mon Oct 29, 2018 10:57 pm, edited 1 time in total.
zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Express train lanes?

Post by zOldBulldog »

Sounds like the "unnamed Stop" might be the best (and simpler) solution after all, by adding something like 1000 blocks to the path as penalty. Bummer.

This is what I ended up doing:



It is not perfect so my OCD isn't going to be happy, but good enough for government work. And it behaves correctly. :)
quyxkh
Smart Inserter
Smart Inserter
Posts: 1031
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Express train lanes?

Post by quyxkh »

Yeah, I guess it just depends on how much you want the immediate-repath-if-there's-a-preferable-route-available behavior. In OpenTTD as I understand it that's automatic and always on, that's what OpenTTD does, is route trains. With Factorio's trains where every-train-repaths-every-tick would eat into all the other things the engine's busy with, the permanent 2km station penalty is just kinda there, so you'd have to wire up the line to provoke a repath that has the effect you want, meaning you'd have to specify the exact effect you want and then figure out how to wire the signals to detect that. I'm idly working on a route-utilization-maximizing circuit and that's giving me fits.
avatar8481
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Oct 23, 2018 4:57 pm
Contact:

Re: Express train lanes?

Post by avatar8481 »

I've not played with it, but the unnamed stop idea should be the answer, though I love the idea of a mod that creates an penalty object.

The operational objective was an inner long-haul pair and an outer pair for local traffic, say local branches every 150-200 spaces and long haul crossovers every 1000. The theory being that splitting the traffic wouldn't just double capacity but decrease total travel times. The penalty stations would be after each entry to the express lanes (on the local lanes), so the only trains willing to operate on local rails would be the ones that had to in order to reach their exit.

with adjustable penalties you could tune the behavior for how 'long' a trip got shunted to the express lanes.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Express train lanes?

Post by eradicator »

avatar8481 wrote: Wed Oct 31, 2018 4:21 pm I've not played with it, but the unnamed stop idea should be the answer, though I love the idea of a mod that creates an penalty object.
You mean invisible unnamed stations ;p? Making the penalty variable is out of any mods hand though. Unless the game doesn't go totally crazy if one tried to spawn two stations in the same spot. But i bet it does.
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.
Post Reply

Return to “Gameplay Help”