LTN - Logistic Train Network

by Optera

Adds logistic-train-stops acting as anchor points for building a fully automated, train logistic network. It can handle all possible train configuration. Just send all trains to depots and LTN will pick the best suitable train for a job. LTN cuts the amount of rolling stock required to run a megabase down to 30% or less. With cargo ships installed also adds a logistic port for ships.

Content
13 days ago
0.14 - 2.0
269K
Trains Circuit network

g problems with 2.4.1

14 days ago
(updated 14 days ago)

I was using 2.3 with no issues. I just tried 2.4.1 and encountered a LOT of problems.

The first issue is that the train has no wait condition at the depot. It just blows right through without stopping and so the schedule does not get reset. Thus it turns into an infinite loop of always trying to pick up and deliver the same products to the same station.

I did look at the mod settings and it says it is supposed to be putting in the usual 5 second wait at the depot, but that is not showing up in the schedule.

I did try the "reset the schedule at delivery" option, and that worked (although it still didn't give a wait time at the depot). However, if this is now supposed to be the intended way LTN works, why are the other choices still the default?

XXXXX Next problem was that I tried the fuel station function, and it set the targeted amount of fuel to be 2.4K, which is of course far more than the locomotive can actually hold. So it just went into an infinite loop of trying to pick up fuel, deciding it was full, heading to the depot, and then deciding it needed more fuel. XXXXX (Ignore this, I read the documentation and figured out how to send this signal. I had previously been sending it the contents of the chest that contained the fuel.)

I am using the LTN combinators, so perhaps there is some problem with them? But I've been using the LTN combinators for years and had no problems with version 2.3.

13 days ago
(updated 13 days ago)

Interesting. Thanks for reporting; can you share a save that shows these problems?

I usually test quite a bit before doing a release and this sounds like the internal state of LTN is really messed up. I would need a save to look at that, though.

I use the LTN combinators as well, so that should not be a problem.

13 days ago
(updated 13 days ago)

I'm not sure how to share a save.

I will say that I encountered this problem while in a sandbox mode game rather than a freeplay, if it matters. But it shouldn't matter, right?

But there is definitely something wrong with the depots.

Test 1:

Set up a supply station, a demand station, and a depot. Place the train on the track. Send it to the depot.

LTN builds a station and sends the train to the supply. Then to the demand. Then to the depot but it never stops, so just keeps going from supply to demand to depot.

Test 2:

Manually add a "wait 10 seconds" condition to the depot stop. Send the train to the depot. But ... every time the 10 seconds wait time passes, it recycles and starts waiting another 10 seconds. Again and again. Instead of the green bar just filling up in the schedule UI, it fills, blanks, fills again, blanks, etc. I can't remember for sure, but I don't think that previous versions did that.

Remove the requested materials from the demanding station. LTN builds a schedule and starts to execute it. But first it waits until the 10 second bar is filled. Then it goes to supply and then demand. When it returns to the depot, the rest of the schedule is blanked out, but the depot schedule is not reset. The 10 second wait is still there, and it does the same cycling behavior.

Test 3:

Changed the settings so that schedule is reset after delivery. Removed requested items.

A new schedule was built and the train (after waiting for the depot timer bar to fill up) went to the supply station. Then to the demand station. As soon as it pulled out of the demand station the supply and demand was deleted from the schedule. The depot schedule was unchanged (including the manual wait time I had specified). When it got to the depot nothing changed from before -- it stopped there and then began cycling the wait time bar.

Test 4:

I blanked out the schedule and sent the train out of the depot to a temporary stop. Then I made sure the "schedule reset at delivery" was turned on. Then I sent the train to the depot. No wait time was generated in the schedule, but it did stop at the depot because there was nowhere else it wanted to go.

Once again I removed the items from the requesting station. A new schedule was created and the train left instantly. It brought the items to the requesting station and then the schedule blanked out except for depot (with no wait time). It went to the depot and sat there, since that was the only thing on its schedule.

13 days ago

As a followup:

I reverted the mod to 2.3.4 and reopened the exact same save. Then I sent the train to a temp stop and let it go back to the depot.

Immediately the depot created a 5 sec wait time. Five seconds passed as the bar filled up, and then it just sat there with a full bar ready to go.

So 2.3.4 worked exactly as expected in the exact same save that had the problems for 2.4.1.

13 days ago

thanks, will see if I can reproduce. I have a bunch of basic "one provider, one requester, one depot" blueprints, so I can test that quickly.

13 days ago

So I could reproduce the "send a new train to depot, it does not get the wait condition". This will be fixed. Other than that, in all my tests, my trains behaved well.

I will push 2.4.2 in a minute, please try with that and see if your problems persist.

12 days ago
(updated 12 days ago)

I confirm that 2.4.2 seems to have fixed the issue for me. Thank you.

12 days ago
(updated 12 days ago)

BTW, are you saying that the problem was that it had been a new train, placed on the tracks after 2.4.1 had already started?

Just in case, I removed the train from the tracks and placed it again new in 2.4.2, and it worked fine.

12 days ago

The problem was that if you create a new train, then send it to the depot to be registered with LTN, LTN would then set the schedule for the train. Most importantly it would update the depot stop to contain an "inactivity" wait condition. In 2.4.0, I changed the way this depot stop was modified because I wanted to minimize the times that a schedule becomes invalid (which it does if you rip out the existing stop and replace it (even with the same stop). By doing that, I missed the use case of sending a new train to the depot. The train arrived, LTN preserved the stop (because it was the right stop) but did not look at the wait conditions (which was missing).

2.4.2 fixes that. https://github.com/hgschmie/factorio-LogisticTrainNetwork/commit/9ea963c7e7c3bf223e7b33146e39f3528ad5f080 if you are interested in the gory details. ;-)

New response