Please add a Cargo-Train and Fluid-Train signals

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

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

Please add a Cargo-Train and Fluid-Train signals

Post by mrvn »

I want to have a station that can order trains from LTN. I use this for example to generate trains pre-filled with ore so smeleters get deliveries faster. Another use case would be with mods that can automatically place trains on rails. Blueprinting a new LTN depot would automatically request a set of new trains for the depot

I can do it now by having a station provide cargo wagon items and request those. But then I can't have actual cargo wagon items on the LTN network, at least not in the same Network IDs. But using fluid wagon items for the fluid trains won't work because fluid wagons can't carry items. So I need to provide and request for example water. I tried providing and requesting virtual signals C for cargo and F for fluid. But LTN ignores those understandably. Using actual items / fluids can easily create conflicts where those are used for real.

So I'm asking for a cargo-train and fluid-train signals to be added that will not be ignored by LTN when provided or requested. The carrying capacity of a cargo train would always be 1 cargo-train signal and fluid trains can carry 1 fluid-train signal. Not essential that it's one per train as one can always request one train at a time, but would be nice for higher throughput.

It would also be nice if the schedule for this wouldn't wait for the signal to be loaded/unloaded but that is probably an extra complication for the dispatcher. This can be dealt with using circuit conditions for the schedule already if it needlessly complicates the code. So also not essential. Just having the 2 signals being seen by the dispatcher is the minimum required.

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

Re: Please add a Cargo-Train and Fluid-Train signals

Post by mrvn »

So I've started on this and will send a pull request when it's working. Under nullius there are a bunch of different locomotives and wagons so I get quite a few signals for different combinations like this:
train.signals.png
train.signals.png (36.97 KiB) Viewed 2530 times
And yes, you are reading that right. There will be a signal to provide/request artillery trains with my patch. So even for plain vanilla games with no "abuse" of LTN to do fun stuff there is a real use case for this.

At the factory where you produce artillery shells you can add a train stop providing artillery trains by sending the signal to the input lamp. When a train arrives fill it up with artillery shells and send it along either by inactivity or circuit signal. Then in outposts requests an artillery train. One will be dispatched by LTN, shoot some aliens and then you send it back, again by inactivity or circuit signal.

Have to see how that plays out when I patch the dispatcher. A special schedule for the different train types would probably be easiest to use but circuit controlled is always an option.

Question: Would it be better to enable those icons with a startup setting or two? One for the "any" trains and one to enable all the combinations.

Currently "any" trains are made when there are multiple choices. So in vanilla it simply looks like this:
train.signal.vanilla.png
train.signal.vanilla.png (112.14 KiB) Viewed 2530 times

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

Re: Please add a Cargo-Train and Fluid-Train signals

Post by Optera »

mrvn wrote:
Tue Oct 26, 2021 2:52 am
At the factory where you produce artillery shells you can add a train stop providing artillery trains by sending the signal to the input lamp. When a train arrives fill it up with artillery shells and send it along either by inactivity or circuit signal. Then in outposts requests an artillery train. One will be dispatched by LTN, shoot some aliens and then you send it back, again by inactivity or circuit signal.
Why would you use LTN like this?
You can pretty much do the same in pure vanilla:
Schedule: Artillery Depot > Artillery Load (full load) > Artillery Firing Range (inactivity 5s)
Set Artillery Load to only accept one train
Enable Artillery Firing Range when there's something to shoot at

The same principle works for everything else too.

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

Re: Please add a Cargo-Train and Fluid-Train signals

Post by mrvn »

Because LTN can limit the train size and sends trains to outposts round-robin. In vanilla the artillery train would always travel to the nearest outpost. Once all aliens there are dead the train then just loops around doing nothing.

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

Re: Please add a Cargo-Train and Fluid-Train signals

Post by mrvn »

I've just added a pull request for this feature on github so it would be real easy to add officially.

I also made a little test map with provider and requester stations for all tree train types. If you pull the changes from github you can try this out. Load the game and turn on the constant combinator at the bottom to let the trains reach the depot stops.

Here is how it looks when they all reach the depot and trains get dispatched. First time around the artillery train even has something to shoot at:
ltn-train-signals.png
ltn-train-signals.png (3.81 MiB) Viewed 2467 times
Having artillery trains visit each outpost round-robin is probably the most useful for normal games leaving the cargo-train and fluid-train signals more of a speciality.

Note: when you pull the changes from github you must either start a new game or increment the version in info.json. Some caches must be created in on_init or on_configuration_changed. Adding or removing a mod from your save also triggers on_configuration_changed so that would work too.
Attachments
ltn.zip
(2.74 MiB) Downloaded 101 times

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

Re: Please add a Cargo-Train and Fluid-Train signals

Post by ssilk »

Image
Did I understand that correctly: you made a patch that adds dozens of new signals to LTN for a use case I still have problems to understand the use case after three times reading? 8-)
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: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Please add a Cargo-Train and Fluid-Train signals

Post by mrvn »

It's basically 3 signals: cargo trains, fluid trains and artillery trains. But depending on what mod do to add different train variations you get a bunch of icons. In vanilla it's exactly 3 icons for the 3 signals.

The artillery train is generally useful while the cargo/fluid train signals are more special cases. Probably only when you also use a mod that can assemble/disassemble trains.

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

Re: Please add a Cargo-Train and Fluid-Train signals

Post by Optera »

I don't really get the use case either.
mrvn wrote:
Mon Nov 08, 2021 3:31 pm
The artillery train is generally useful while the cargo/fluid train signals are more special cases. Probably only when you also use a mod that can assemble/disassemble trains.
Generally LTN does not support trains becoming invalid from disassembling or teleporting between surfaces.
It can work when used carefully, but the general player will end up with a wrong deliveries and timeouts.

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

Re: Please add a Cargo-Train and Fluid-Train signals

Post by mrvn »

Have you tried the artillery trains signal or looked at the example world?

Post Reply

Return to “Logistic Train Network”