Pre-Loaded trains

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

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

Pre-Loaded trains

Post by mrvn »

I've constructed a LTN Station that pre-loads trains so they are ready to deliver when something is requested without first having to fetch a train.
pre-load-train.png
pre-load-train.png (606.56 KiB) Viewed 3075 times


The setup is quite simple. The loading actually happens at the depot stop where trains idle. I've set the train limit to 2 so one train will be there getting loaded and one can be waiting behind it. The depot reads the train content and sends it to the input controller of the LTN stop above it, the provider stop. So whatever is loaded into the train is provided. The provider is configured to have a provider limit of a full train. This is important as the train won't leave the depot unless there is inactivity, which usually means when it is fully loaded. So this can't provided a count perfect partial train.

Whenever a train at the depot is fully loaded the provider station starts providing a train full of items. If someone requests them LTN picks the nearest Depot to the provider, which has the pre-loaded train, and sends it to pick up the items. So it drives 2m to the provider stations, sees that is already loaded and continues to deliver the goods.

The setup also has 2 combinators: At the top I have a combinator that outputs when goods are provided that I collect globally to keep track of what is producing enough and what is lacking. At the bottom and connected to the rail bulk loader (or buffer chests if you don't use rail bulk loaders) is a combinator that outputs Network-ID 1 when the chests fill up.

In my map Network-ID 1 is used by stations voiding stuff to request excess waste. Recipes that produce waste products beside the main output buffer some of the waste because it might be useful in some other recipe. But when it starts to backlog and risks stopping the main production the Network-ID 1 gets turned on and items can be voided.

Important: If you ever want to request less than a full train of the item provided then make sure the depot stop has a name unique to the item. That way a partially unloaded train will return to the right depot and refill. If you use the same name for pre-loading iron ore and copper ore for example then the train could return to the wrong depot and ores would mix.

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Pre-Loaded trains

Post by ptx0 »

this seems to be against everything that LTN was designed for. good job.

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

Re: Pre-Loaded trains

Post by mrvn »

Only one part of it. The requester part is still untouched.

I use this for high demand stations like iron ore or critical stuff like fuel for the steam plant. There will always be someone needing iron ore. It won't happen that a train gets filled with iron ore and then nobody wants it. And nobody ever wants half an LCCCCLLCCCCL train of iron ore. Or half a cargo wagon coal for the steam plant.

Overall I think it roughly tripples the delivery speed at my current game state. It removes the time for the train to go from the depot to the provider and the time for the train to load. And that faster delivery time means I need to buffer fewer goods on the requester, which means even for high throughput I don't need to request multiple trains at the same time, which would require a stacker.


The big drawback is that one has to keep a close eye on the train count. It needs to be exact. Too few trains and one station will be left without one and never provide any goods. Too many and a train will get stuck.

I'm considering ways to have a global depot with spare trains that get dispatched when trains are missing somewhere or take in excess trains. Ideally I would like to have only one train at each pre-load station and send a new train to the depot when that train leaves.

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

Pre-Loaded trains v2

Post by mrvn »

Taking it one step further: Making trains a requestable resource so pre-load stations can grab them from a central depot.
pre-loaded-trains2.png
pre-loaded-trains2.png (5.28 MiB) Viewed 3016 times
Not quite where I want it to be yet. Trains now must altrernate between the depot and the pre-load station. If there is a path from the ore unloading to the pre-load station that doesn't go past the depot then things get messed up. The depot must always be nearer than the pre-load station.
Attachments
pre-loaded-trains2.zip
(4.85 MiB) Downloaded 115 times

GrumpyJoe
Filter Inserter
Filter Inserter
Posts: 443
Joined: Fri Apr 06, 2018 7:10 pm
Contact:

Re: Pre-Loaded trains

Post by GrumpyJoe »

ptx0 wrote:
Tue Oct 19, 2021 4:42 pm
this seems to be against everything that LTN was designed for. good job.
Quite the opposite IMHO. Clever use of gameplay features added.
It's one step further from using network IDs and dedicated (empty train) depots.


But
In the long run it shouldn't really matter the time it takes to fulfill an order, as long as the throughput is efficient to run a certain sub factory.

For high throughput items like ores that only ever go to one place, I've even gone so far as to NOT include them into LTN.
I've seen an AB server where they used big trains to fill a raw ores depot only to use small LTN trains to feed the first step (crushers) in a different block.
Now that's what I call (censored)

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

Re: Pre-Loaded trains

Post by mrvn »

GrumpyJoe wrote:
Sun Oct 24, 2021 11:17 am
But
In the long run it shouldn't really matter the time it takes to fulfill an order, as long as the throughput is efficient to run a certain sub factory.

For high throughput items like ores that only ever go to one place, I've even gone so far as to NOT include them into LTN.
I've seen an AB server where they used big trains to fill a raw ores depot only to use small LTN trains to feed the first step (crushers) in a different block.
Now that's what I call (censored)
Two factors determine the throughput: The time for a train to arrive and the number of trains requested at the same time.

Now you might say: Why not request 4 trains if the buffer chests have space for 4 trains? Even if the station can only contain 2 trains the first one will unload and move on quickly before the 3rd even arrives if it is a high throughput station.

But that is a fragile setup. What if production is somewhat lacking. The smelter will run dry and asks for 4 trains. Then 4 stations turn on because they now have iron ore for a train. This randomly happens that multiple stations reach the provider limit near the same time. The smelter then gets 4 trains arriving at the same time and you get traffic problems, maybe even a grid lock. So I'm wary of setting the train limit higher than each station can handle even though in normal operations the stacker for stations is never as full as it could be.

Same thing for the provider by the way. In normal operations you can fill and send away a train in the time the next arrives from the depot. But if to many requests happen in a short time then trains storm the provider like a herd.

The size of the station+stacker determins the train limit. And with the train limit fixed you then can only play with the time till delivery to maximize throughput.


I'm also thinking of removing the buffer chests for loaders. Just load the waiting train directly. With the way I can now order trains from LTN on demand I have minimal downtime between trains.

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Pre-Loaded trains

Post by ptx0 »

GrumpyJoe wrote:
Sun Oct 24, 2021 11:17 am
ptx0 wrote:
Tue Oct 19, 2021 4:42 pm
this seems to be against everything that LTN was designed for. good job.
Quite the opposite IMHO. Clever use of gameplay features added.
hmm..
If there is a path from the ore unloading to the pre-load station that doesn't go past the depot then things get messed up. The depot must always be nearer than the pre-load station.
:lol: oh okay my bad LTN is perfect for this :roll:

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

Re: Pre-Loaded trains

Post by mrvn »

ptx0 wrote:
Wed Oct 27, 2021 1:36 am
If there is a path from the ore unloading to the pre-load station that doesn't go past the depot then things get messed up. The depot must always be nearer than the pre-load station.
:lol: oh okay my bad LTN is perfect for this :roll:
Solved that by the same way a pre-load station gets trains. The unload station has a depot too and provides cargo wagons with it's own network ID. Pre-Load stations and depots request cargo wagons but Pre-Load has a higher priority. So trains bounce from Pre-Load to Unload if possible unless there is no open spot. Then they return to Depot. Nearly only happens if the depot is empty because otherwise the Pre-Load gets a train from the depot before the unload can empty one. Different network IDs on the depot depot, Pre-Load depot and Unload depot make it possible so trains don't drive around empty for no reason.

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

Re: Pre-Loaded trains

Post by mrvn »

I'm giving up on this, at least for double headed trains/stations. Not because the circuit logic fails or LTN. No, the problem is the path finding in the vanilla game.

To request trains for pre-loading and providing the loaded items requires 3 stations. One to request empty trains, one depot where the train gets filled and one to provide the loaded items. For trains that come from the wrong direction you also need stations on the opposite side of the rails, at least the requester.

But now the path through the station has an imense cost for crossing all those train stops. So when a train is at the top most stop, where the items are provided, it would have to cross 3 stations to go down. So what does the game do? It goes out the top, drives 10km, takes the connection between top and bottom highways I have to turn around trains and then goes 10k back to where it wants to go. Even with all the signals over 10km it's still cheaper than crossing 3 stations.

With single headed trains that wasn't a problem because once inside the station the only way was through. Well, it was fun while it lasted.

Post Reply

Return to “Logistic Train Network”