I ask because I'm using the pathfinder as described in the wiki, with all default settings, and it normally finds a path fine, but when I have a situation like this:
The pathfinder can not find the path even though a track can be placed there. This also is noticeable when navigating around obstacles, if there is a route with a diagonal taken by another bit of track it still goes around it(haven't got a pic of this though, I've seen it happen)
Does the pathfinder count any tile which has something on it as un-navigable, even if we can place track there? Or is there another reason for this?
Is there a solution? Am I being an idiot?
Cheers
EDIT::
I've had some success with adding an extra cost for the tile: look at each adjacent tile to the current tile, if it is not buildable, add an extra cost. This manifests itself as adding an extra straight section at the station, and so the above problem doesn't occur.
Unfortunately there are situations where the only way out is by a diagonal, so this solution would not work in that case.
Can the default pathfinder place diagonals on the same tile?
Moderator: OpenTTD Developers
Re: Can the default pathfinder place diagonals on the same tile?
Yes, the RailPathFinder.1 won't do it due to :
that said the pathfinder expect a tile without any rail transport type.
You have to (re)write another code to handle that situation.
Code: Select all
function Rail::_Neighbours(path, cur_node, self)
{
if (AITile.HasTransportType(cur_node, AITile.TRANSPORT_RAIL)) return [];
............
You have to (re)write another code to handle that situation.

Re: Can the default pathfinder place diagonals on the same tile?
Thanks for that! I've sorted it out now I think. I slightly redesigned my stations aswell as adding extra cost to each tile when there is an unbuildable object adjacent to it. Seems to have done the trick!fanioz wrote:Yes, the RailPathFinder.1 won't do it due to :
that said the pathfinder expect a tile without any rail transport type.Code: Select all
function Rail::_Neighbours(path, cur_node, self) { if (AITile.HasTransportType(cur_node, AITile.TRANSPORT_RAIL)) return []; ............
You have to (re)write another code to handle that situation.
Who is online
Users browsing this forum: No registered users and 3 guests