LTN Adding Train Schedules on Non-Depot Stop

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

Post Reply
bcwhite
Inserter
Inserter
Posts: 42
Joined: Thu Jan 31, 2019 10:37 pm
Contact:

LTN Adding Train Schedules on Non-Depot Stop

Post by bcwhite »

Factorio 1.1.6
LTN v1.15.0

It seems that LTN will add schedules to trains at stops that were depots but are no longer.

I have a circuit that only sets the "depot" signal when there are no train contents at the train stop. The goal is to stop a non-empty train from going out again and delivering contents somewhere they're not desired.

Now new schedules are being added to trains even after that signal has been removed. This is true even when the signal has been off for >1s.

Here's a video showing the problem:
https://drive.google.com/file/d/1lj6A-X ... sp=sharing
Part of it runs 1/10th speed so I can visually verify the signals to the LTN stop (replicated to the electrical pole there).

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

Re: LTN Adding Train Schedules on Non-Depot Stop

Post by Optera »

Trains arriving at depots will be cached as available the same tick they arrive.
The decider will remove the depot signal one tick later.
With lots of stops it can take LTN over a second to update signals.

To be perfectly safe the logic would need to be reversed, outputting a depot signal only when detecting an empty train.

bcwhite
Inserter
Inserter
Posts: 42
Joined: Thu Jan 31, 2019 10:37 pm
Contact:

Re: LTN Adding Train Schedules on Non-Depot Stop

Post by bcwhite »

It's too bad that LTN can't double-check the "depot" signal before doing the final assignment.

Do you have a recommended circuit for this? I haven't figured out a circuit that's less than three gates while it takes only one gate to turn it off if non-empty.

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

Re: LTN Adding Train Schedules on Non-Depot Stop

Post by Optera »

It's not that I can't, I just don't want that overhead.

As for a circuit outputting depot = 1 when empty train is in depot, 2 combinators should work.
Untested in practice. I never needed a circuit like it and don't play Factorio any more.

bcwhite
Inserter
Inserter
Posts: 42
Joined: Thu Jan 31, 2019 10:37 pm
Contact:

Re: LTN Adding Train Schedules on Non-Depot Stop

Post by bcwhite »

I looked at something similar but, if I'm not mistaken, it'll still output the depot signal for a single tick. If the caching of the value was done the tick before (when the train landed) then presumably that is sufficient?

bcwhite
Inserter
Inserter
Posts: 42
Joined: Thu Jan 31, 2019 10:37 pm
Contact:

Re: LTN Adding Train Schedules on Non-Depot Stop

Post by bcwhite »

Back to this...

I have a circuit that sets the depot signal only when the train is present, similar to the example you provided. However, without the depot signal, trains will still go to these stops because the name matches the return stop in their schedule. They arrive, depot signal remains absent (because items still in the cars), don't get their schedules reset, and then repeat their loop.

I tried adding a signal in front of the LTN stop with a "close" condition of "depot <= 0" but though that stops the train from looping, it also stops all legitimate trains because as soon as LTN gives it a schedule and the train tries to leave, the depot signal is removed and train signal deactivates.

Any ideas?

I still think the ideal solution is for LTN, upon deciding on a train to use, to verify that it's cached value still matches the current condition. It would take a few extra cycles when launching a train but you wouldn't have to do periodic scans on those stops that are enabled because a change to disabled would be caught when preparing to load a new schedule.

Post Reply

Return to “Logistic Train Network”