Add double headed train stops

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12716
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Add double headed train stops

Post by ssilk »

mrvn wrote:
Mon Oct 11, 2021 3:35 pm
In reality the train driver just backs up into the fueling station. Can't do that in factorio.
In reality the train is fueled in several ways. E.g. a tank-train comes nearby or the train is uncoupled and drives to the fueling station alone and much more variants.

And backing up into a station isn’t possible. Yet! I mean that would be much more intuitive than this, if shunting would be possible. Because it’s of course quite complex, but it would allow so much more possibilities with trains than yet.
As to why I would do something like that? Saves me half the buffer of fuel. Also because I can. The refueling stop was just the first example I could remember I had so I could make a quick screenshot with a single headed train.
Ok, you want to add a mechanism that is really hard to understand, because it introduces a quite big complexity (you seem to ignore it), only to … spare some stored fuel?? :shock:
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

robot256
Filter Inserter
Filter Inserter
Posts: 428
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Add double headed train stops

Post by robot256 »

mrvn's use case could almost be solved with vanilla circuit-controlled train limits, because the vanilla train stop can output how many trains are currently pathing to it (the number that should be <= the train limit; which I believe was first implemented in the Train Supply Manager mod). If combinators were instant, you could lower one stop's train limit when a train paths to the other one and not allow any more paths to be created on the same tick.

But because of the combinator delay, if both directions have a train limit of 1, it is possible for two trains to path to them on the same tick and the combinator cannot disable the lefthand one before a train paths to the righthand one, for example. It might work if you have at least one stacker slot in each direction, I'm pretty sure that defeats the purpose.

So another, slightly different way to achieve mrvn's goal would be to have a "global train limit" that would apply to all train stops with the same name with zero delay.

The behavior of Lua-created permanent rail segment destination is also almost what they want, because they can be approached from either direction by default, but there is no way to put a train limit on a particular section of rail.

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

Re: Add double headed train stops

Post by mrvn »

robot256 wrote:
Sat Oct 16, 2021 4:51 pm
mrvn's use case could almost be solved with vanilla circuit-controlled train limits, because the vanilla train stop can output how many trains are currently pathing to it (the number that should be <= the train limit; which I believe was first implemented in the Train Supply Manager mod). If combinators were instant, you could lower one stop's train limit when a train paths to the other one and not allow any more paths to be created on the same tick.

But because of the combinator delay, if both directions have a train limit of 1, it is possible for two trains to path to them on the same tick and the combinator cannot disable the lefthand one before a train paths to the righthand one, for example. It might work if you have at least one stacker slot in each direction, I'm pretty sure that defeats the purpose.
The solution I tried is to disable the other station when the first gets a train count. But there is a delay between a train pathing to the station on the other getting disabled, even without any combinators. Just a straight wire between the stations. That delay makes any circuit solution impossible.
robot256 wrote:
Sat Oct 16, 2021 4:51 pm
So another, slightly different way to achieve mrvn's goal would be to have a "global train limit" that would apply to all train stops with the same name with zero delay.

The behavior of Lua-created permanent rail segment destination is also almost what they want, because they can be approached from either direction by default, but there is no way to put a train limit on a particular section of rail.
A global train limit for all stations would limit you greatly. For the bidirectional stations you have many stations with the same name in pairs. Each pair has a train limit of 1. Without the "pair" connection the global limit makes little sense.


And yes, the rail target record has no train limit count, afaik. Add that and you have the double headed train stops I asked for with a bit of scripting.

robot256
Filter Inserter
Filter Inserter
Posts: 428
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Add double headed train stops

Post by robot256 »

How would you handle the fact that the double headed stop becomes "open" as soon as the train passes it and goes to the real stop? By setting the train limit to 0 when the signal block is occupied?

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

Re: Add double headed train stops

Post by mrvn »

robot256 wrote:
Mon Oct 18, 2021 2:34 am
How would you handle the fact that the double headed stop becomes "open" as soon as the train passes it and goes to the real stop? By setting the train limit to 0 when the signal block is occupied?
Exactly. There is enough delay between the signal turning and the stop opening to handle that with circuit logic.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12716
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Add double headed train stops

Post by ssilk »

It’s a primary target of the development, that Factorio is playable without circuit logic.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

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

Re: Add double headed train stops

Post by mrvn »

And you can play without double headed train stops. Or just use them as waypoints. Only the special case of using them to implement a train limit for double headed or otherwise combined train stops requires some wires.

It would be nice to have stations made of multiple stops with train limit without extra circuit logic but that would require far more changes and new concepts for factorio. On the GUI side a way to mark stops as belonging to a shared train limit. If you prefer that more work then go for it. I tried to suggest something with minimal change that mods can then use to finish the work.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 1198
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Add double headed train stops

Post by FuryoftheStars »

mrvn wrote:
Thu Oct 07, 2021 7:00 pm
The addition of a double headed train stop would allow placing them in the middle of the station as a waypoint. Circuit logic can then be used to allow 1 train to target the waypoint and then set the train limit to 0 until the train has left the station so no other train uses the same waypoint till it is clear again.
So wait... are you proposing adding this in addition to the normal 2 train stops? So you'd still have your two separated train stops, but then this new 2-way stop placed between them, such that the train schedule would target the 2-way stop as a waypoint first, then the actual stop? And as such, it (hopefully) gives the circuit network that extra tick to set/change the train limit on the 2-way stop to 0 until the train leaves the other stop?

Sorry, just trying to wrap my head around this.

Edit: Or is it more it is the stop for one direction, but the waypoint prior to the actual stop in the other direction?

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

Re: Add double headed train stops

Post by mrvn »

Yes, there would be single sided train stops and double headed train stops. You could just put a double headed train stop anywhere and use it as a waypoint that works in both directions. There is no requirement to have an actual train station where you put a train stop. The double headed train stop is basically just 2 train stops on opposite sites. Except they have only one train limit (the critical point you can't do any other way), one train counter, one circuit connector to output or input signals.

If you want to build a full double headed station then the idea would be to use the double headed train stop like this in it's simplest form:
station.png
station.png (495.59 KiB) Viewed 319 times
At most 1 train can go to the double headed stop from either direction. As soon as it reserves the final segment the train limit drops to 0. The train then continues past the double headed stop, which is just a waypoint, and stops at one of the outer stops for loading or unloading. As soon as it clears the segment for the station the train limit goes back to 1 and the next train can target the station.

Setups for more trains will require more circuit magic. The double headed train stop I suggested here has one and only job that can't be done without: Atomically count trains coming from either direction. It's the only thing that can't be done in vanilla already.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 1198
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Add double headed train stops

Post by FuryoftheStars »

Thanks. This helps me understand better. I was going to post something else… not against, but not for. While I understood the problem you were trying to overcome (the train limit), I think I was failing to understood how this was supposed to be used for that. Then I reread your OP and caught that detail I quoted and so asked. Now that I understand better, I’m actually in support of this idea.

+1

I think it might help others to grasp the concept better if it was called a double headed “waypoint” or something instead of a stop? That mock up image in your last post I feel helps a lot better, too, than the others.

Post Reply

Return to “Ideas and Suggestions”