Page 1 of 1
Dispatching from disconnected train network
Posted: Fri Aug 20, 2021 6:41 am
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?
Re: Dispatching from disconnected train network
Posted: Sat Aug 21, 2021 1:26 pm
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.
Re: Dispatching from disconnected train network
Posted: Sun Aug 22, 2021 5:39 am
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!
Re: Dispatching from disconnected train network
Posted: Sun Aug 22, 2021 10:23 pm
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
Anyone know if there is a existing call to check if stop A has a path to stop B?
Re: Dispatching from disconnected train network
Posted: Mon Aug 23, 2021 5:21 am
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
Re: Dispatching from disconnected train network
Posted: Sat Aug 28, 2021 8:15 am
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.