Page 1 of 2

Train Length Lookahead Signal

Posted: Sun May 07, 2017 10:40 pm
by Vegemeister
It is known that, in order for an intersection to be deadlock-free, the the first normal signaled track block after the intersection has to be long enough to hold any train that might pass through it.

Problems:
  1. This is a hassle to set up. Every time I build an intersection, I have to pull out my exit block meter blueprint (a line of lights spaced 1 train car apart), and carefully measure out the length. This doesn't work on curved track, so in that case I have to lay down signals at spacing 5 (the longest train the game is willing to show hints for), and then go back and rip up the extras.
  2. I have to decide the length of the longest train I will ever want to run in early-mid-game, when I first start using trains. If I ever want to run a longer train on the tracks than initially designed, that requires re-measuring every intersection on the map.
  3. Trains shorter than the maximum length fail to benefit from their shortness. For example, if two intersections are too close together for the longest train to wait in between, their exit blocks toward each other have to use chain signals. So a short train can't wait in the space between intersections even if it would fit. Or if a train is waiting after the intersection, and there's not enough space behind it for a maximum-length train, then a short train can't proceed through even if it would fit.
Solution: Train length lookahead signals. The way this signal would work is that, in order for a train to pass it, it would have to reserve however many blocks forward it would need to get its ass-end fully out of the block before the lookahead signal.

Example: A length-5 train approaches an intersection. The exit block signal of that intersection is a lookahead signal, and every signal from the entrance to the exit is a chain signal. Signals on the main line are 3 car-lengths apart. In order to enter the intersection, the train must reserve a path through the lookahead signal. The lookahead signal will only be (green? purple?) if there are 2 clear segments after the intersection.

Example 2: Same as before, except there aren't 2 segments of normal signals after the intersection. Instead, there is 1 segment of normal signals, then another intersection. In this case, the length-5 train will not enter the first intersection until it can reserve a path through both intersections.

Why is this nice?
  1. Train intersections are now more blueprintable. Just put train length lookahead signals on all the exits, and you can plunk it down anywhere without faffing around with the exit block meter.
  2. You can upgrade the length of trains on high-traffic routes without re-doing your entire train system.
I suspect that it might be possible to do this without adding a third type of signal. Instead, you could change the behavior of existing chain signals, so that they would keep chaining until they had reserved enough consecutive normally-signaled segments to fit the train, instead of stopping at the first normal signal.

Re: Train Length Lookahead Signal

Posted: Mon May 08, 2017 6:44 am
by tuttifrectte
I had the exact same idea the other day. Needless to say I support this idea.

I wonder what should chain signals before the lookahead signal display though.

Re: Train Length Lookahead Signal

Posted: Mon May 08, 2017 8:59 am
by Vegemeister
They could assume the the longest train on all connected track was going to come through, and display red/blue/green as usual based on that.

Re: Train Length Lookahead Signal

Posted: Mon May 08, 2017 6:05 pm
by SupplyDepoo
Sounds good to me, but rather than adding a new entity to the game maybe this should be an option in the chain signal GUI? (please don't make it default, though - there are some neat tricks you can do with chain signals and short exit blocks!)

Re: Train Length Lookahead Signal

Posted: Mon May 08, 2017 8:37 pm
by Vegemeister
SupplyDepoo wrote:Sounds good to me, but rather than adding a new entity to the game maybe this should be an option in the chain signal GUI? (please don't make it default, though - there are some neat tricks you can do with chain signals and short exit blocks!)
What tricks?

Re: Train Length Lookahead Signal

Posted: Tue May 09, 2017 10:11 pm
by ssilk
Hm. I would play around with it a bit but I think in the end I would use the two current signals, cause it is just so much simpler to make the tracks so, that any train fits in.
But that is just my opinion. :)

Re: Train Length Lookahead Signal

Posted: Wed May 10, 2017 8:25 am
by tuttifrectte
ssilk wrote:Hm. I would play around with it a bit but I think in the end I would use the two current signals, cause it is just so much simpler to make the tracks so, that any train fits in.
But that is just my opinion. :)
The current two signals does not do the job, unless maybe some complex circuit network. For example in the following setup (image below), it is impossible to put signals in such a way that trains will exit back to the main line as long as they fit. Since the stations are 'injecting' into the main line at different points.
Image

I think it can be implemented as a tickbox option for chain signal.

Re: Train Length Lookahead Signal

Posted: Wed May 10, 2017 2:25 pm
by Lav
Perhaps the OP's problem could be resolved by UI fixes instead of gameplay change?

Like tweaking signal placement UI to automatically snap signals every wagon-length or so when you drag the mouse with button down, similar to how power poles are currently auto-spaced.

Re: Train Length Lookahead Signal

Posted: Wed May 10, 2017 10:00 pm
by ssilk
tuttifrectte wrote:The current two signals does not do the job, unless maybe some complex circuit network. For example in the following setup (image below), it is impossible to put signals in such a way that trains will exit back to the main line as long as they fit. Since the stations are 'injecting' into the main line at different points.
Image
I can always argue, that you build the setup much too narrow. If you made that wider it would work perfect.

That was is btw. a general rule for Factorio's trains: The more distance between switches, the better.

Re: Train Length Lookahead Signal

Posted: Wed May 10, 2017 11:17 pm
by tuttifrectte
ssilk wrote:
tuttifrectte wrote:The current two signals does not do the job, unless maybe some complex circuit network. For example in the following setup (image below), it is impossible to put signals in such a way that trains will exit back to the main line as long as they fit. Since the stations are 'injecting' into the main line at different points.
Image
I can always argue, that you build the setup much too narrow. If you made that wider it would work perfect.

That was is btw. a general rule for Factorio's trains: The more distance between switches, the better.
Having a gap of one train length between the two tracks looks ugly.

It is like arguing you don't need chain signals, since you can always make sure between every single crossing in an intersection there is enough space in between to fit all the trains (at the same time) in your network. I think OP's suggestion does solve a problem which is currently impractical to solve.

Re: Train Length Lookahead Signal

Posted: Thu May 11, 2017 12:24 am
by Vegemeister
ssilk wrote:Hm. I would play around with it a bit but I think in the end I would use the two current signals, cause it is just so much simpler to make the tracks so, that any train fits in.
But that is just my opinion. :)
Making the exit blocks long enough to fit any train on the network is what I do now, but it's still a big hassle to measure out the exit blocks every time I lay down a new intersection.

And what do you do if you want to build a new train that's longer than any train was at the time you built the tracks?

Re: Train Length Lookahead Signal

Posted: Thu May 11, 2017 2:12 am
by AndrewIRL
Vegemeister wrote:I suspect that it might be possible to do this without adding a third type of signal. Instead, you could change the behavior of existing chain signals, so that they would keep chaining until they had reserved enough consecutive normally-signaled segments to fit the train, instead of stopping at the first normal signal.
This would be the way to do it, introducing a new signal adds complexity. Just relax the rule that says "1 block" = "1 train" and allow a train to use 2 consecutive blocks if it needs them.

Re: Train Length Lookahead Signal

Posted: Thu May 11, 2017 10:53 am
by ratchetfreak
If I condense the proposal down I get the impression that you want a checkbox to decide whether a chain signal allows a train through only if the tail can clear the next normal signal instead of getting the nose past the next normal signal.

Re: Train Length Lookahead Signal

Posted: Sun May 14, 2017 9:56 pm
by ssilk
@tuttifrectte: I didn't say to make the tracks wider, I said it's too narrow and that it is a general rule to increase the distances between switches to more than a train length.

In the case above for example: Instead of 4 train stations, each with an own connection to the track, just one connection to the track and a much larger set-up-area before and after the four stations.

Some example of how I do it (:
Screen Shot 2017-05-14 at 23.30.57.png
Screen Shot 2017-05-14 at 23.30.57.png (47.99 KiB) Viewed 7175 times
Screen Shot 2017-05-14 at 23.30.04.png
Screen Shot 2017-05-14 at 23.30.04.png (43.9 KiB) Viewed 7175 times
Between main-track and the left (right) curve are about 200-300 tiles.

The size of those constructions depends on the max-length of the train. So there is an optimum for the train length, and the player needs to find this optimum. And that is the case, why I think this will not be implemented, cause it's part of the game.

Re: Train Length Lookahead Signal

Posted: Fri May 19, 2017 7:20 pm
by Vegemeister
ssilk wrote:@tuttifrectte: I didn't say to make the tracks wider, I said it's too narrow and that it is a general rule to increase the distances between switches to more than a train length.

In the case above for example: Instead of 4 train stations, each with an own connection to the track, just one connection to the track and a much larger set-up-area before and after the four stations.

Some example of how I do it (:

(snip)

(snip)

Between main-track and the left (right) curve are about 200-300 tiles.

The size of those constructions depends on the max-length of the train. So there is an optimum for the train length, and the player needs to find this optimum. And that is the case, why I think this will not be implemented, cause it's part of the game.
The optimal train length depends on what the train is transporting and how far its going. And it's not really an optimum, just a number of tradeoffs (How much do you care about station size? Are you willing to build 4-lane track?). Which is good for gameplay. There's a wrong way to do it (short trains for anything that isn't oil or nuclear fuel), but multiple right ways to do it.

The part that's bad gameplay is that the max-length of trains is essentially fixed once you've laid down a few junctions. Changing it requires re-signaling every exit block on the map. It's very difficult to actually experiment with different train lengths to find the optimum. And even building them in the first place is an incredible hassle, because when placing signals the game only shows a length-5 ghost train, which is much too short for ore trains.

Also, looking at your screenshots,

In the first one, the left exit block from the tee junction toward the station almost certainly needs to be a chain signal, assuming your stations aren't way longer than necessary. That'd require a change from the junction blueprint. Also the bottom leg of the tee is probably just barely long enough. If you want to run a train longer than the current max, those exit blocks will have to be re-signaled.

In the second screenshot, all of those junctions on the left are too close together to have normal signal exit blocks. That one's easier because they're obviously too close without any measurement, and I'm sure you've already replaced them with chain signals, but that's still a change from the junction blueprint.

Re: Train Length Lookahead Signal

Posted: Mon May 22, 2017 2:37 pm
by ssilk
Can we say it so: Optimal placing of signals is a science of it's own in Factorio and much more in reality. In reality for example there are much more locking situations that couldn't be solved by automatic. And it is really, really hard or - I would also claim - impossible to make the train network in Factorio deadlock-free for any case.
This suggestion doesn't change that.
The part that's bad gameplay is that the max-length of trains is essentially fixed once you've laid down a few junctions. Changing it requires re-signaling every exit block on the map. It's very difficult to actually experiment with different train lengths to find the optimum. And even building them in the first place is an incredible hassle, because when placing signals the game only shows a length-5 ghost train, which is much too short for ore trains.
More or less agreed. But even if you are not building with optimal train length then the factory is working.

And is for the majority of Factorio player not worth to think deep into. They try it for their first game with L-C trains for example and find out, that this is a bad idea. Then they change it, either in the current game or with the next.

I still think it's part of the game. The basic wrong thinking you are making is, that you think the reconfiguration is a lot of hassle. I would say it's an optimization task, that can be quite interesting. The alternative is introduction of a new signal-type at a point where many players have already problems to understand the current. :)


PS: And yes, I know, that the showed stations are not perfect. But they work good enough to handle 10-12 LLCCCC trains per minute without blocking that is worth to mention. Much more is possible, but not needed, even in extreme situations.

Re: Train Length Lookahead Signal

Posted: Tue May 23, 2017 8:11 am
by Tev
I agree with ssilk, nothing OP perceives as problem is actual problem in the game. Biggest hassle in redesigning train lengths are existing stations (esp. their waiting bays), which this doesn't even touch. Also, longer trains are super overpowered anyway, why not leave the little hassle about them in the game.

Re: Train Length Lookahead Signal

Posted: Sun Sep 10, 2023 3:35 pm
by hhoodt
ratchetfreak wrote:
Thu May 11, 2017 10:53 am
If I condense the proposal down I get the impression that you want a checkbox to decide whether a chain signal allows a train through only if the tail can clear the next normal signal instead of getting the nose past the next normal signal.
I know this is an old thread but this really seems the right way to do this. If there was a mod that added such a signal, for example, even if not in the main game, it would be awesome

Re: Train Length Lookahead Signal

Posted: Tue Sep 12, 2023 9:58 am
by quyxkh
Set your interface preference for train visualization length, then use the white outlines to tell you exactly how far from the exit to place the second signal.

Re: Train Length Lookahead Signal

Posted: Thu Sep 14, 2023 9:42 pm
by BicycleEater
Yeah, this would actually be a really cool addition.