[quote:3qld29iy]I bet if you took away the purple squares and just told it to find a path to the nearest green, it would be trying to move to a square on the inside.
Yeah that would work as well, but then I could also just remove all the solids and then it would be able to find a path to the blue square. I don't say that to provoke you , but merely point out the initial problem.
I wasn't offering that as a solution. Just a test you could do to see where it's trying to find a path to. If it's trying to get to the inside then that would explain why it won't move when the wall is there.
[quote:3qld29iy]
1. The path calculated shouldnt place the nearest empty cell the furthest away from the unit using the pathfinding behavior. Based on the A* algorithm it seems to be wrong, as the cost to move there would be higher than the tile nearest to the unit with pathfinding behavior. And the fact that the pathfinding unit cant even reach that tile, so makes little sense why it then marks this as being the cell to go to.
It chooses the empty cell closest to the destination. It's not going to use A* to find which empty cell is closest to the player because then it would have to pathfind to every cell on the map and that would take forever. And even that would be no use because the cell right next to the player would be the nearest.