Trying to reacrate LTN's 'pull' system

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

gargamel9
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Oct 26, 2019 5:40 pm
Contact:

Trying to reacrate LTN's 'pull' system

Post by gargamel9 »

Hi there
I've been trying to recreate the dinamic trains we had with LTN in pre factorio 2.0 For me its a must because the factory is based around a city block designed for trains with dinamic schedules. I realize that there is a LTN for 2.0 but the stations keep sending the signals for all trains in the depot and I didnt manage to find the error so Im thinking it is a bug so I uninstalled it and decided it to replicate myself :o
As I couldn't find the use of a 'push' system with dynamic trains I wanted one like LTN, with empty trains waiting at depo's until a request is made so the train is send to pick up cargo then deliver then back to depot. I manage to create one without using wildcards, with and interrupt for each type of cargo, but it is not really LTN and not being able to copy interrupts makes it tedious.
As I understand it, wildcard only gets created when it read the cargo already in a train.
Is there any way that a wildcard would be created once a request station is open? so I can then use the wildcard to send the train to those stations?
thx
mergele
Fast Inserter
Fast Inserter
Posts: 204
Joined: Sat Aug 20, 2016 5:45 am
Contact:

Re: Trying to reacrate LTN's 'pull' system

Post by mergele »

You don't need a pull system. A push system with dynamic trains is dead simple in vanilla 2.0.
Interrupts:
If cargo empty, go to station Load, wait until full
If has cargo, go to station Unload [cargo], wait until empty
Done.
Add an interrupt for refueling and going to depot if destination full or unreachable.
gargamel9
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Oct 26, 2019 5:40 pm
Contact:

Re: Trying to reacrate LTN's 'pull' system

Post by gargamel9 »

To me using dinamic trains in a push system is a way of complicating what you already have with a train for each resource, that why I wanted to recreate how it worked in LTN.
It's just my opinion :mrgreen: Im not trying to convince anybody here.
Tertius
Smart Inserter
Smart Inserter
Posts: 1190
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Trying to reacrate LTN's 'pull' system

Post by Tertius »

Please forget LTN. Please forget the LTN approach.

LTN stems from ancient times in early access when train limits weren't available. Train limits were introduced with game version 1.1, and everybody who just knows Factorio 1.1 and later don't understand what LTN is about and why one would even need it, because with proper use of train limits you get perfect train distribution out of the box.
LTN tries to solve the issues you had when multiple trains want to drive to the same station and there is no limit. A thing that was perfectly solved by introducing train limits in game version 1.1. The other thing LTN does is hardcoding the way trains are sent along to the various stations according to material status. That's something you can solve by dynamically set train limits instead of using static limits, but that's not really improving train behavior. It's just increasing complexity.

This all is possible as of 1.1 and is even improved with 2.0 by using train groups, interrupts, and the green wildcard symbols.

The current train best practice is this:
- name all loading stations that use the same train layout the same. Give them train limit 1 or 2 (if 2, add a waiting area)
- give all unloading stations a specific name that includes the material it expects. Give them train limit 1 or 2 (if 2, add a waiting area)
- create many trains with the same layout and the same train group
- create 1 static schedule entry to make the train group go to the loading station
- create 1 interrupt with the cargo wildcard to read train content if a train is full, as destination use the destination name where you replace the material in the station name with the wildcard. It will be substituted if this interrupt triggers and the train will go to the station that expects the cargo the train is currently carrying.

This can be seen in the fff articles: #389 and #395.
gargamel9
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Oct 26, 2019 5:40 pm
Contact:

Re: Trying to reacrate LTN's 'pull' system

Post by gargamel9 »

The problem is that to read the wildcard the train has to have that on cargo so only push systems can be done.
I was hoping to have the trains empty and go to loading only for the needed thing stated by the wildcard. But I dont know how to generate a wildcard that is not part of the cargo of a train.
Tertius
Smart Inserter
Smart Inserter
Posts: 1190
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Trying to reacrate LTN's 'pull' system

Post by Tertius »

Why would you want to send an empty train when item demand arises? This introduces huge latency. The train has to drive to the loading station, then it needs to be loaded, then drive to the unloading station. Takes a very long time until actual delivery. In the meantime, the unloading station is running empty.

With a train limit controlled system, trains are constantly being loaded and available for unloading. If there is no station requiring a new train, the trains are waiting at the loading station (or in the waiting area in front of the unloading station if station limit 2). If it's necessary to get a new full train, it's already there! Either waiting to drive to the station or already in the waiting area. That's less than half the delay you have with any pull system.
gargamel9
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Oct 26, 2019 5:40 pm
Contact:

Re: Trying to reacrate LTN's 'pull' system

Post by gargamel9 »

Im sure you are right. In fact the devs implemented a push not a pull system and Im guessing not just because it is more complex :lol:
It would be nice to have old LTN, because for the factory with city blocks and train delivery that I have (which the guy that design it. nilhaus, doesnt use in space age by the way :lol: ).
There must be a way thou to send the wildcard from an open requester station to an empty train, however I fail to find it and it is the only solution I can think off.
robot256
Smart Inserter
Smart Inserter
Posts: 1139
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Trying to reacrate LTN's 'pull' system

Post by robot256 »

gargamel9 wrote: Mon Apr 07, 2025 8:55 pm Im sure you are right. In fact the devs implemented a push not a pull system and Im guessing not just because it is more complex :lol:
The system the devs implemented is simpler in terms of information storage and transparency to the user. There are no hidden variables that we need another mod (LTN Manager) to keep track of. It would be simpler still if it were designed to accommodate only one style of dispatching, like LTN does, but thankfully we have many styles that are possible. Just not that one :lol:
There must be a way thou to send the wildcard from an open requester station to an empty train, however I fail to find it and it is the only solution I can think off.
There's always a way, but it will involve recreating rhe entire LTN logic with combinators. The problem is one of information size: the base game only ever stores one reservation per train, but LTN store *two*. It's impossible to recreate the LTN behavior without adding memory somewhere that records that "Train A is dispatched Stop B and then Stop C". Then whatever logic is dispatching trains has to read thay memory to see which stops still need trains dispatched, so it can't be vanilla either.
mergele
Fast Inserter
Fast Inserter
Posts: 204
Joined: Sat Aug 20, 2016 5:45 am
Contact:

Re: Trying to reacrate LTN's 'pull' system

Post by mergele »

You can use the circuit and the item wildcard system. Is it a good solution? Heck no, but it is technically possible. But if you insist on it it can be done.
ndh
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sat Apr 29, 2023 7:19 pm
Contact:

Re: Trying to reacrate LTN's 'pull' system

Post by ndh »

The downside of a push system is that it requires more trains.

Let's say you have 5 providers of iron, 1 requester. Also 1 provider and 1 requester of copper. You put 3 trains into the system.

If the iron providers produce (even just a little) more than what is used by the requesters, eventually all trains will end up waiting at iron providers (waiting for a requester), and copper will starve.

With a pull system the number of trains depends on the actual capacity required for transport.

-----

gargamel, have you considered that you can add multiple stops in a single interrupt? If the interrupt triggers, you can add both provider and requester to the schedule, and you can use this for matching the station name. Exemplified in https://www.youtube.com/watch?v=C3HBa20a5Io.

With this system, the downside is that the station train limit only applies when the train is en route to that station, not when the interrupt triggers. Such a system has no way of telling a requester that a train is currently en route to a provider, and eventually will arrive at the requester. So a requester might get double booked for two trains going to two different providers, and the same over-allocation as above can happen.
robot256
Smart Inserter
Smart Inserter
Posts: 1139
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Trying to reacrate LTN's 'pull' system

Post by robot256 »

Counterpoint: if your push system operates with fewer trains than you have stations, then you have too many stations for your current production rate :P

Waiting trains have virtually no UPS penalty, no space penalty (the station track where loaded trains wait is already there) and very little resource penalty (unless you insist on only legendary trains). Wanting a push system is entirely about aesthetics at this point, not that there's anything wrong with that.
Tertius
Smart Inserter
Smart Inserter
Posts: 1190
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Trying to reacrate LTN's 'pull' system

Post by Tertius »

ndh wrote: Fri Apr 11, 2025 6:37 pm If the iron providers produce (even just a little) more than what is used by the requesters, eventually all trains will end up waiting at iron providers (waiting for a requester), and copper will starve.
If your copper starves, you don't have enough trains. Add the train limit of all your stations (loading + unloading) and employ as many trains. Additionally, add a depot for empty trains with as many places as you have slots for the unloading stations, so an empty train is always able to leave an unloading station, so the next full train is able to move in.
ndh
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sat Apr 29, 2023 7:19 pm
Contact:

Re: Trying to reacrate LTN's 'pull' system

Post by ndh »

I've found these two videos which address the problems mentioned. He's using combinators to dispatch only the required number of trains.

Designing an LTN-style Logistics Train Network in Vanilla Factorio 2.0 Using Interrupts https://www.youtube.com/watch?v=EggDldJVggM

Parametrising Blueprints and Interrupts To Improve My Logistics Train Network https://www.youtube.com/watch?v=rRGAVDndFwk

The biggest downside compared to LTN is that it can't handle stations which request multiple types of resources. I don't see a good solution to that in vanilla. -> Back to LTN...
Post Reply

Return to “Logistic Train Network”