Details about how LTN works

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

Post Reply
AceNZ
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Jul 15, 2018 4:30 am
Contact:

Details about how LTN works

Post by AceNZ »

In the process of converting my base to use LTN, I realized that I don't fully understand how it works. I spent a few hours reading the forum, reddit and various blueprints, and watching youtube tutorials, but a few details still escape me.

1. How does LTN manage provided amounts vs. requested? For example, if a provider says it has 1000 iron ore, and a requester says it needs 2000, with the threshold set at default (1000), LTN creates a schedule/route for a train at the depot, requesting 1000 be taken from the provider to the requester (subject to matching network numbers and train sizes). I get that much. However, after the schedule has been created, but before the train reaches its destination, the provided and requested signals remain. In fact, they will likely change as ore gets produced and used. Does the mod just re-sample the numbers again, every so often (if so, how often?), or what?

2. Does LTN know about or manage items that are en-route? If so, how/what does it do? Why and when would it schedule a route for an additional train? Does it know about and account for travel distance/time?

3. Does LTN ever schedule routes that are more than just depot to provider to requester and back to depot? Will it schedule a single train to more than one requester? Related: is there ever a reason why a train shouldn't be empty before it leaves a requester?

4. In my setup, I'm using stack filter inserters with fixed item settings at all of my unloaders, fixed-content chests at both providers and requesters (no mixed contents). Most of my trains are L-2C. I understand the positive amounts = available, negative = desired inputs to the signal lamp, which I compute based on current chest contents. Is there anything else I need to do to make things work smoothly and correctly? So many of the BPs out there, including in the design thread, seem to have logic that doesn't apply to me, but I feel like I'm missing something, so it's hard to be sure. For example, do I need to account for the content of the train? Or should I care about the "desired amount" signal from the LTN station's constant combinator?

5. I understand I need to make sure trains are empty before they leave the depot, and I've got re-fueling handled. Is there anything else I should be doing at the depot?

6. Are there any best practices for handling high-volume stations, such as ore and plates? Chest content can be emptied in a few seconds, and mining sites can be some distance away from smelters, so optimal flow can require having quite a few trains in transit at the same time.

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

Re: Details about how LTN works

Post by Optera »

I guess those answers got buried in the massive old thread so here's a quick rundown of the internals.

1) LTN internally keeps track of deliveries through train.id. Hance changing train composition will void deliveries. After a train leaves a requester, delivery counts are updated to actual train content.

2) yes, see above
In your example from 1) an additional train will be dispatched once the provider has another 1000 items ready again (assuming the train before wasn't overloaded and the requester not sits at 1001+ items)

3) no, multiple pickup/dropoff points would be too much of a headache to implement.
Trains leaving a requester empty only happens due to bad station design or feeding constant signals instead of actual station capacities to LTN.

4) Why do so many players think they have to preprocess signals?
- hook all buffer chest directly to LTN input
- hook a constant combinator with negative desired amount for requesters to the same network (optionally but highly recommended also use control signals)
- done
anything beyond that in my bp is logic to allow controlled item un-loading

5) As long as trains are emptied in the depot LTN will work fine. Refueling can happen anywhere.

6) Throughput is directly proportional to train capacity. L-2C trains are tiny, personally I use nuclear locomotives and heavy wagons from https://mods.factorio.com/mod/TrainOverhaul in L-6C-L trains (similar to 4L-9C in vanilla).
For pure vanilla designs check the Railway setups main forum viewforum.php?f=194
For modded stations I'd use wide chests + Loader or Miniloader. 41 tile long chests are highly efficient automatic balancers between 6 wagons.

AceNZ
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Jul 15, 2018 4:30 am
Contact:

Re: Details about how LTN works

Post by AceNZ »

Excellent. Pretty much as expected. Thanks!

Post Reply

Return to “Logistic Train Network”