Dispatching from disconnected train network

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

Post Reply
axxiz144
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Aug 07, 2017 6:08 am
Contact:

Dispatching from disconnected train network

Post by axxiz144 »

I built my new base a way away from the old one down a rail line back to my old mall, and when I finished the new base I torn down the rail lines from the old base to the new. The problem is that LTN dispatched trains to requesters on the other side, even though the track was no longer there. This resulted in a lot of trains being loaded and then no-pathing.

Is there some sort of cache the dispatcher uses I can clear?

torne
Filter Inserter
Filter Inserter
Posts: 341
Joined: Sun Jan 01, 2017 11:54 am
Contact:

Re: Dispatching from disconnected train network

Post by torne »

It doesn't check this at all. If you want to have separate disconnected networks then you need to set the network IDs on all the stops so that they are considered different networks by LTN.

GrumpyJoe
Filter Inserter
Filter Inserter
Posts: 443
Joined: Fri Apr 06, 2018 7:10 pm
Contact:

Re: Dispatching from disconnected train network

Post by GrumpyJoe »

See here for network ID
If you never need separate IDs again and you don't understand binary, you can use ID 1 and 2,
ID3 if you ever need to combine some stations again. For further instructions, click the link.

You can stop the mod dispatching new trains at runtime in the mod settings
Set network ID in the new base, including the new depot!
Set the old depot to a different ID
Start dispatcher again.
New base should start to run as intended.

For the old base, you'll have to "manually" empty the trains.
Create a dump station, manually set the schedules to go to dump until empty + depot until inactive, schedules should jump back to LTN behavior automatically.

Don't forget to change the old stations ID as well, they might call trains from the new depot!

Haven't played with that for a long time, so you might need to wait with the dispatcher activating until you have done all of the above!

axxiz144
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Aug 07, 2017 6:08 am
Contact:

Re: Dispatching from disconnected train network

Post by axxiz144 »

I've got well north of 500 stops in this save.

I think it just might be quicker to update the Dispatcher.getProviders function and add a check for track continuity between the requestor and the provider.

Now I just need to figure out the Factorio API :D Anyone know if there is a existing call to check if stop A has a path to stop B?

GrumpyJoe
Filter Inserter
Filter Inserter
Posts: 443
Joined: Fri Apr 06, 2018 7:10 pm
Contact:

Re: Dispatching from disconnected train network

Post by GrumpyJoe »

Not saying its not possible, but I don't think you'll get path information before a train has its schedule set.
That might be something only boskid could answer.

500 seems alot, but I'd still rather change all of them with a blueprint than to mess with any code of either trains or LTN

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Dispatching from disconnected train network

Post by ssilk »

I wouldn’t do that, because you will increase the search cost for each train and if you don’t cover all edge cases (building one piece of rail can re-connect both networks), it will just make strange things. Or two parts of a rail network can be connected, but the signals/rails are connected in a way, that makes them unreachable.

This (looking for connection) if is really something, which needs to be done deep in the game engine, Optera has taken the network-ids because only the player can really know, which parts of a rail network should interact together.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Post Reply

Return to “Logistic Train Network”