Why do temporary stops have a condition?

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

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

Why do temporary stops have a condition?

Post by mrvn »

When LTN picks a station for either pickup or delivery it adds a temporary stop on the rail the stop is connected too. This ensures the train goes to the location of the stop first and only then picks the actual stop to drive to, which is the stop right there because it is nearest. Normally. Not so if one has bidirectional stations. Then the stop might be on the wrong side of the track and the opposite stop is used instead.

But why does LTN add a condition to the temporary stop? The condition, even a time passed = 0, makes the train slow down and stop at the temporary stop. For single direction stations it doesn't matter because it stops right in front of the stop. But for bidirectional stops, when it comes from the wrong direction, it then has drive to the opposite stop. Without a condition the temporary stop is removed as soon as the breaking distance hits the spot and then it can delay breaking for the real stop.

So any reason the condition is needed? Could it be removed or made a config option?

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2848
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Why do temporary stops have a condition?

Post by Optera »

I was certain stops require at least one condition.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2848
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Why do temporary stops have a condition?

Post by Optera »

Without wait condition trains will overshoot and path to a wrong stop when there's multiple stops with the same name.

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

Re: Why do temporary stops have a condition?

Post by mrvn »

Yes and no.

What actually happens is that if there is no wait_condition then the game tries to find a station that will extend the current path of the train and is at least 2 rails long, one of those overlaps the current path. The stop that we want the train to go to has a path with only 1 rail because the train is already at the destination and is not a valid stop. If another stop with the same name exists then that becomes the new destination.

To remove the wait condition the rail target would have to be the rail before the train stop. This might change in the near future.

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

Re: Why do temporary stops have a condition?

Post by ssilk »

See also viewtopic.php?p=556633#p556633

Which brings me to thinking this can get quite tricky if I put a switch directly in front of a LTN-stop. In that case the current method might be more useful.
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: Why do temporary stops have a condition?

Post by mrvn »

Yeah. The rail before the stop doesn't have to be unique. But you can't make a proper train stop with a switch. 1) that would make it 2 stops depending on where the train comes from and 2) the alignment with a curve doesn't work quite right, fluid wagons don't work at all. The straight rail before a stop is probably the one you want even with a switch.

But the code might change soon so I would just wait and see before adding something complex that might become uneccessary.

Post Reply

Return to “Logistic Train Network”