Feature request: extend ConnectSurfaces() interface to reserve/wait for a train

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

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

Feature request: extend ConnectSurfaces() interface to reserve/wait for a train

Post by mrvn »

I noticed that LTN now has a ConnectSurfaces() option, which is used in Space Exploration to allow trains to drive up space elevators to reach different surfaces. In that use case the train is actually transported from one surface to the other.

I would like to modify this for rockets earlier in the game that wouldn't transport the train itself. Instead the "space port" would unload the cargo and take over the delivery using reassign_delivery placing the cargo in a rocket. The rocket then goes up into space. In space the cargo then needs to go back into a train, for which I need a train.

So what I need is a function to give LTN a train, a source stop and the delivery info and have LTN pick a train to deliver the cargo. LTN can then either return the train entity or better invokes a callback when a train is available. LTN also sets the schedule for the new train and calls reassign_delivery internally.

This would be kind of like (an asynchron) reassign_delivery except LTN picks a new_train out of the local depot to be the new train and and sends the train to the given source stop first.

Does that sound like something you would be willing to merge?

PS: The problem with rockets in Space Exploration is that they are one way. If I follow the elevator code then the train goes up into orbit and it then stuck there unless I have a second rocket that goes back down later (or the other way around). Shipments are usually not balanced so there isn't the same number of rockets going both ways. Rockets are real entities that take resources to build and fuel so it makes no sense to send a rocket to transport an empty train. There is no easy way I can explain how trains would return to their home after delivery if I shoot them up into space or down to a planet.

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

Re: Feature request: extend ConnectSurfaces() interface to reserve/wait for a train

Post by Optera »

Correct me if I read it wrong.
You want to have LTN manage a delivery between surfaces where the train is sent along with the cargo in a rocket.

Instead of forcing LTN to handle requests between surfaces I'd break it into one request per surface.
Have a transmitter relay the required material to LTN on the correct surface and send the cargo with a dumb one way rocket.
Also solves the issue of trains accumulating on different surfaces.

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

Re: Feature request: extend ConnectSurfaces() interface to reserve/wait for a train

Post by mrvn »

Optera wrote:
Wed Dec 06, 2023 9:22 am
Correct me if I read it wrong.
You want to have LTN manage a delivery between surfaces where the train is sent along with the cargo in a rocket.
No, that is what the space elevator already does. With rockets I don't want to send the train along, only the cargo.

Implementation wise the rocket would itself have a hidden train too because LTN tracks deliveries by train IDs. But you have one train on the planet that visits the provider. Then I need another train in space that finishes the delivery in orbit. Sourcing that train from LTN is the issue. I don't want to go through the LTN depots in space myself and steal a train.

Maybe a different example of the same problem would help: Consider a map with 2 islands. Both have train networks but they also have ships with LTN ports. What I want is a train picking up items on one island, drive to the nearest port, put the cargo on a ship, sail to the port nearest the destination, put the cargo on a new train and deliver it. Except my islands are on different surfaces and LTN now seem to know how to schedule deliveries between connected surfaces. Oh and my ships are rocket ships. :)
Optera wrote:
Wed Dec 06, 2023 9:22 am
Have a transmitter relay the required material to LTN on the correct surface and send the cargo with a dumb one way rocket.
That's the problem and why LTN is needed at all. You don't know what the correct surface is. There are N surfaces that provide iron plates and there are M surfaces that consume iron plates. LTN is good at matching the provider with the requester. I wouldn't want to reimplement that logic, most certainly not with combinators.

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

Re: Feature request: extend ConnectSurfaces() interface to reserve/wait for a train

Post by Optera »

mrvn wrote:
Wed Dec 06, 2023 1:46 pm
Implementation wise the rocket would itself have a hidden train too because LTN tracks deliveries by train IDs. But you have one train on the planet that visits the provider. Then I need another train in space that finishes the delivery in orbit. Sourcing that train from LTN is the issue. I don't want to go through the LTN depots in space myself and steal a train.
Sounds even more like this should be 2 independent LTN deliveries with the rocket being an unmonitored intermediate transport mode.

I don't have time nor interest in writing and testing big changes for LTN at this point.
Especially when Factorio 2.0 is teased so heavily with features making such changes obsolete.

Post Reply

Return to “Logistic Train Network”