Page 1 of 1

Request feature: nearest depot calculation by road.

Posted: Sun Nov 04, 2018 11:09 am
by zggz
Now station choose free train on nearest depot on map. To calculate it mod uses distance on map between station and depot. Now we need to set personal depot for every production. Can we make calculation depend on road length? In this case we can do 1 depot for couple production without any problems.

Re: Request feature: nearest depot calculation by road.

Posted: Sun Nov 04, 2018 11:14 am
by Optera
I assume by road length you mean path cost from Factorio's train pathfinder.

Short answer:
No

Long answer:
The API doesn't expose anything about pathfinder and reprogramming it in LUA would have terrible performance.
Once the pathfinder is exposed through the API I might switch over to using that instead of linear distance.

Re: Request feature: nearest depot calculation by road.

Posted: Thu Nov 08, 2018 10:26 pm
by zggz
Ok. I will wait for.

Re: Request feature: nearest depot calculation by road.

Posted: Mon Nov 12, 2018 4:17 pm
by zggz
Another idea: in depot we set something like network id and the same at stations that this serves. In this case trains come to station only from 1 depot. Can you do this?

Re: Request feature: nearest depot calculation by road.

Posted: Mon Nov 12, 2018 4:21 pm
by Optera
zggz wrote:
Mon Nov 12, 2018 4:17 pm
Another idea: in depot we set something like network id and the same at stations that this serves. In this case trains come to station only from 1 depot. Can you do this?
That's how network id works if you leave requesters at ANY.

Re: Request feature: nearest depot calculation by road.

Posted: Mon Nov 12, 2018 7:05 pm
by zggz
But in this case i need to set all requesters with the same id.