0ptera / Logistic-Train-Network

Factorio mod adding logistic network for trains.
Other
163 stars 65 forks source link

Issue with the LTN output combinator when serving multi-item requests #272

Closed elendilo closed 2 years ago

elendilo commented 3 years ago

I'm playing Angel's with LTN and a few QoL mods and running into following issue (sorry I didn't read through all issues here to find a match):

I'm trying to use multiple input/output warehouses with stations [a.k.a. multi-stations] (i.e. they provide or request multiple types of items). To go around the eventual mutli item request i use regular filter inserters that have multiple filter slots. So far so good. But sometimes, the train schedule shows only one type of item, but the output combinator on the LTN station shows that type plus a couple of some other type (e.g. crushed stone). That then throws a wrench into everything, as the train gets filled with mixed goods, or gets stuck if the type of item in the schedule somehow doesn't get filled properly and is full of stone instead.

Can supply screenshots/logs/etc.

elendilo commented 3 years ago

screenshots: ltn_error_out_signal ltn_error_train_sched

0ptera commented 2 years ago

Potential duplicate of: https://forums.factorio.com/viewtopic.php?f=214&t=90090

mrvn commented 2 years ago

That looks to me like the train arrived with 2 crushed stone left over in the cargo wagon. In those cases the LTN output shows both the existing cargo and the requested items. Check all your depots if there are any trains with items left in them. If so I would say that is the problem and not an LTN bug.

A likely cause is this: You don't stop the inserters from loading items before the train leaves.

Say a train comes requesting crushed stone. The inserters pick it up and load the train full. At the end when the cargo wagon is full some inserters will be left with crushed stone in their hand. Then the next train comes in requesting crushed ore (less than a wagon full or it would already block there).

Now the post Yousei refered to says the inserter will drop the crushed stone into the cargo wagon when the train arrives at the temporary stop and pauses for 1 tick. It then continues and arrives at the station with 2 crushed stone in the cargo wagon. And the LTN output then correctly says 2 crushed stone already present will remain after loading.

If you don't load count perfect you have to set reserved slots for the station so it never requests a completely full train. Setting the option to finish loading is also a good idea. You must also program the filter inserters using " - " so if a request for say 1000 crushed ore comes in they do stop once 1000 crushed ore are loaded. Otherwise the reserved slot won't help as you always load the wagon full.

Note: Have you considered what to do when LTN actually does send a train requesting crushed stone and crushed ore? If someone requests both LTN can merge them into one delivery.

0ptera commented 2 years ago

Should be mitigated by 1.16.8. Full fix is only possible by making station designs that don't lock up inserters.