Space Exploration LTN integration

by harag

Allows LTN to make deliveries through SE's space elevator

Content
2 years ago
1.1
26.0K
Trains

g [Invalid] Deliveries fail when update rate limited

2 years ago
(updated 2 years ago)

Hey guys,

I've been playing SE for some time and had a bunch of existing rocket infrastructure with LTN on both sides. When this came out, I migrated to using the space elevator. This worked fine for me, right up until I turned my base on. Safe to say that it was not very performant and I turned LTN's update rate down to keep the game playable. Specifically, updates per tick of 1, update frequency 4. For context, I have more than 2000 stations. My stations do not have Factorio train limits, so I do not use a clearance station.

After this I found several deliveries where the train just returned to depot without actually depositing the items. I subsequently turned off the dispatcher to stop the trains filling up whilst I looked into the problem. I found one train stuck half-way through the space elevator with the locomotive on one side, and cargo on the other.

Since I've had to clean up my base to continue playing it's probably not something I can concretely reproduce, but my basic thought is that the mod has some implicit dependency on LTN responding in a certain timeframe, otherwise it breaks. This is not guaranteed if you have to turn the update rate down or turn the dispatcher off. The expected behaviour is that when disabling the dispatcher cross-surface deliveries in progress finish, as intra-surface ones do, and when the LTN update rate is slow, cross-surface deliveries are simply scheduled at a slower rate when crossing surfaces, and do not return to the depot with their cargo in.

I appreciate this bug report is a bit vague so the issue may not be reproducible or diagnosable, I'll gladly provide whatever information is still recoverable from my save.

2 years ago
(updated 2 years ago)

This mod has to wait for LTN's on_dispatcher_updated event to change a train's schedule in order to include elevator stops. So yes, with so many stations to go through and a low udpate rate those events might become rare which means schedules might not get updated in time. There is no earlier event to listen for, so the only solutions I see are to increase the update rate or to reduce the number of stations. The latter could be achieved with multi-requester stations.

2 years ago

Some discussion of this on the mod page would be appreciated to warn users in advance, now uncertain if my base is recoverable.

2 years ago
(updated 2 years ago)

Hm, I think my hypothesis how this happened for you is wrong. LTN does not schedule new deliveries while it still gathers information from its logistic stops. That happens in a separate phase which should still be short enough that no train is able to arrive at a provider, fully load and then leave before its schedule can be updated to drive through an elevator.

That leaves me quite puzzled about what actually happened. Are you sure the trains that returned with cargo where ones meant to go through an elevator and that their cargo was actually a left-over from that delivery and not a previous one of the same train?

New response