LTN does not recognize wagon cargo filters

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

Post Reply
DaleStan
Filter Inserter
Filter Inserter
Posts: 368
Joined: Mon Jul 09, 2018 2:40 am
Contact:

LTN does not recognize wagon cargo filters

Post by DaleStan »

Because reasons (primarily stemming from a mixed LTN/non-LTN train network[0]), I need to have filters on my LTN-controlled cargo wagons. If I set the whole train to carry the same cargo, everything's fine, but if I split a wagon between different cargoes, the orders created assume that the entire wagon is available for that cargo, even if I have "depot resets filters" turned off.

I've attached a demonstrating save. Turn on the constant combinator by the middle station to generate an order to move 400 rocket fuel, even though the wagon can only hold 200 rocket fuel.

I think my first choice to fix this would be to side-step the entire issue, and have the depots set wagon filters on departure, instead of just resetting them on arrival. Failing that, recognizing the presence of filters would also work.


[0] I have a rail station providing two cargoes. I want to move one cargo with LTN trains, and move the other cargo with vanilla trains. I've seen blueprints that will correctly split two cargoes into two LTN trains, but I haven't seen (or been able to figure out) any for two cargoes where only one is carried by LTN trains. I can use the locked-stacks signal to make sure the inserters are empty when the LTN trains leave, but I haven't been able to come up with any mechanism that will guarantee the insterters are empty when the non-LTN trains leave.
Attachments
Expected load too large.zip
(3.27 MiB) Downloaded 68 times

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

Re: LTN does not recognize wagon cargo filters

Post by Optera »

LTN does not support filtering wagons.

Adding this would slow down searching for suitable trains for little benefit.
Filters have to be checked by iterating over each slot in each wagon whenever LTN looks for a suitable train. They also can't be stored in lookup tables, as there's no event when players/mods change filter settings.

I think i recall one post where a player used locked slots to make ltn ignore filtered slots. The option to disable ltn resetting filters in depot is there for this exact situation.

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

Re: LTN does not recognize wagon cargo filters

Post by mrvn »

Set the reserved stacks on the rocket fuel station to 21 and it won't request too much.

For keeping the inserters clean look at the yellow constant combinator and set the station to read contents. For the LTN good you fill the train only till you hit the amount signaled on the yellow constant combinator. For the non LTN good you have to compute the right amount - reserved stack yourself and fill till you hit that. The yellow constant combinator will tell you if this is an LTN train or not (does it request rocket fuel or not?).

DaleStan
Filter Inserter
Filter Inserter
Posts: 368
Joined: Mon Jul 09, 2018 2:40 am
Contact:

Re: LTN does not recognize wagon cargo filters

Post by DaleStan »

Is it also painful to set filters on departure? Since it's possible to clear filters, it seems like it also ought to be possible to set them, but those two might not be related.

I was thinking about two different things at the same time, unfortunately, and ended up with an example that doesn't match my actual use very well. I'm using Bob's mods, and I want to move calcium chloride from my heat shield factory to my titanium factory on demand, and run rocket fuel from my rocket fuel factories to the fuel drops on demand. Both of these are 1-car train operations. I suppose I could tack a second wagon on to one of the trains, and then filter based on train length, but that seems ugly. As for reserved-stack filtering on the non-LTN trains, most of the refueling drops are also ore transshipment stations, and demand for iron ore varies from 400 per train all the way up to 21200 per train. My stack inserters now hold 42, so one cycle, for one car, moves more than that entire low-demand train wants. Yes, I could look at the train ID, enable different numbers of transshipment inserters, and cut them off at different loading levels, but that'd be a major pain. Cargo filters preventing the transshipment inserters from dumping iron ore into the fuel-delivery train are much easier, but LTN doesn't really want to cooperate with that.

That said, I'm also somewhat making mountains out of molehills here. I don't have a full wagon even if I simultaneously load the maximum delivery of both rocket fuel and calcium chloride, so (now I understand it, and my problem, better) a combination of filters and the reserved-slot limiter should do the trick.

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

Re: LTN does not recognize wagon cargo filters

Post by Optera »

Look in the Design thread at how to build smart stations to prevent loading/unloading of not requested items.

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

Re: LTN does not recognize wagon cargo filters

Post by mrvn »

Why would you send a train for 400 ore if one sweep of the inserters loads more? Just let it load more. It's not like 1000 ore will break even a wooden chest.

DaleStan
Filter Inserter
Filter Inserter
Posts: 368
Joined: Mon Jul 09, 2018 2:40 am
Contact:

Re: LTN does not recognize wagon cargo filters

Post by DaleStan »

Following the pattern of Griswold's Antfarm, the non-LTN trains travel around to the necessary ore transshipment and intermediate product stations. They collect the non-fluid resources needed at their delivery station, in approximately the correct ratios, and deliver all the resources at the same time. The trains that want only 400 ore serve High-Tech science, which consumes 3840 electronic logic boards (green boards), 1280 speed 1 modules, 640 basic electronic boards (brown boards), 320 carbon, 320 plastic, 160 silicon plate, 60 iron ore, and 40 cobalt oxide every minute. With one stack per wagon locked, each train arrives with 6:40 of iron ore, 5 minutes of cobalt oxide and silicon plate, and 3:45 of the other five resources. I could assign that last stack to iron ore, but delivering 3:45 or 5 minutes of most cargoes and 13:20 of iron ore is not as elegant.

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

Re: LTN does not recognize wagon cargo filters

Post by Optera »

When using LTN or even normal trains perfect ratio deliveries are just stupid.
The most UPS and rail network efficient way to use trains is to make them long, fully loaded and only run when required.

DaleStan
Filter Inserter
Filter Inserter
Posts: 368
Joined: Mon Jul 09, 2018 2:40 am
Contact:

Re: LTN does not recognize wagon cargo filters

Post by DaleStan »

I'll certainly accept that I could make my rail network lower congestion and more UPS-friendly. If I start having UPS or congestion problems, I'll revisit my train design. But those aren't concerns right now, so the biggest reason I have for perfect-ratio deliveries is that it's just not satisfying to schedule on-demand full-train deliveries. A train pulling just one MK3 wagon delivers 8k cobalt oxide and satisfies 3:20 hours of high-tech science demand. And that's not the worst in the tiny-demand department. I think that award goes to zinc ore. At my radar production station, I consume one full MK3 wagon of zinc ore (16k, due to the bigger stack size) every 10,000 minutes — 80 minutes shy of a real-world week. I want to see my trains running deliveries slightly more often than that.

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

Re: LTN does not recognize wagon cargo filters

Post by Optera »

LTN works very well for such once in a blue moon deliveries.

I'd set those requester to -10k cobalt oxide or zinc with request threshold of 8k. My 1GW Nuclear power plant has a buffer of 32k uran ore served by ore trains carrying 18k ore. I'd need to wire up an speaker notification to ever notice a train going there, but it's always stocked well enough to keep producing power.

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

Re: LTN does not recognize wagon cargo filters

Post by mrvn »

And nothing stops you from setting up an LTN train to bring 100 Zinc ore.

Or set it up the station to have a request limit of a full train for 5 minutes after a train has arrived and then lower it to 1. That way you get a train every 5 minutes or when consumption is high enough to fill a train.

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

Re: Setting filters

Post by mrvn »

I've been thinking about LTN setting filters on wagons. Reserved slots give some options:
  • Reserved slots are unfiltered: I think this would make setting the filters mostly pointless. The point of filters would be to only load the right goods in the right ratio and any unfiltered slots would allow the wrong goods to be loaded with only the circuit network stopping it. So you might as well use only circuits.
  • Reserved slots are disabled: Again pointless. The reserved slots are required to clear whatever excess the inserters hold in their hand. Can't clear that with disabled slots.
  • Reserved slots are filtered: This means for every item requested there need to be N reserved slots with N large enough to hold one hands per inserter (minus one). Reserved slots should change to meaning reserved slots per item. So requesting iron and copper with N=2 would reserve 2 extra slots for iron and 2 extra slots for copper. I would like to see a reserved items signal though or even better signals for number of inserters and have LTN compute the right number of stacks internally.
Overall, once you adjusted the reserved slots, I think it would be more efficient. With stations providing multiple goods currently you have to reserve enough slots so that a request of every good provided can't overfill the wagon. And that means reserving enough stacks that every single item will be overfilled to the maximum amount. But LTN trains rarely request many items at once so most of the time fewer reserved slots are required. So filtered slots could load more into a wagon if few items are requested.

Post Reply

Return to “Logistic Train Network”