Transport Fever 2

Transport Fever 2

LineManager
GordonDry Feb 26, 2023 @ 11:35am
Can you force the depot used to clone a vehicle?
Or is this straight hardcoded vanilla behaviour and you can't do anything?

I got a depot within 2 minutes of stop 1 of a line, but a depot about 12 minutes away is chosen.
It's near the path of that line, though, in the neighbor town.
< >
Showing 1-4 of 4 comments
CARTOK  [developer] Feb 27, 2023 @ 8:52am 
The depot finding function is a bit dumb, this mostly has to do with me not having had time to wrap my head around the pathfinding functionality. The depot used will be the same as the first vehicle created for the line. If that depot stops existing, then an existing vehicle will temporarily be sent to a depot and that depot is then used. The process is repeated when a vehicle is sold - before selling, the vehicle is temporarily sent to a depot and the identified depot is then used for creating further vehicles later on.

I am basically just bastardizing the (easily) available functionality within the API. However, the proper way to do is by pathfinding and identifying the best depot that way on each occassion. That is however a completely new level of complication that I'm very unlikely to achieve without assistance.

I hope this helps.
GordonDry Feb 27, 2023 @ 10:51am 
Can't you not just do the first, simpler approach of measuring distance by line of sight from stop 1 of a line to any depot by the coordinates?
Later, if then available, that approach could be the fallback method if the pathfinding method fails (or "sending a vehicle to a depot" would be needed).

I know that the line of sight could be very wrong, depending the topography and how the roads are laid, but ...
GordonDry Mar 4, 2023 @ 5:18am 
I tested again. I built a road depot that is nearer to the source station - but not to the line - and used it to buy the first vehicle of a line.
The cloned vehicles are all bought by another depot, which is nearer to the line, but further away from the source station.
Last edited by GordonDry; Mar 5, 2023 @ 3:53am
CARTOK  [developer] Mar 4, 2023 @ 10:41pm 
I don't think there's a simple solution to this. The starting point is to use the same depot as the user manually set up, but depots/roads/rail/access etc. can change and this must be accounted for. This is checked at various points (when a vehicle is sold, this has yielded the best result), and this can sometimes (but usually temporarily) lead to less than optimal results. In the grand scheme of things, this should even out before long and not make a huge difference unless cutting the economics really tight.

However, for optimal outcome path finding is a must - always locating the closest/best depot. I don't have the skills nor experience for this, unfortunately, but am open for any support that can be availed.
< >
Showing 1-4 of 4 comments
Per page: 1530 50