This is how I’m dealing with SLG Movement’s pathfinding and the way impassable Tiles and Chess affect it.
The goal is summarised thus: When I click on an impassable Tile, my intention is to find a path to the Tile even though I may not finally reach the final Tile.
The problem is that SLG Movement’s cost function, which is the function evaluating the path, will always include the destination as part of its results to InstGroup. It’s no use trying to define a BLOCKING cost for it: SLG Movement will always include the destination Tile.
I tried poppping instances from InstGroup, but the methods in InstGroup did not easily allow me (as far as I could see, anyway) to pop the tail end of the InstGroup array.
What I ended up doing was querying whether Tile being moved on to was impassable or not. If not, GridMove is stopped from moving..