I am using A* algorithm to find the shortest path between a box and a movable character in a navmesh graph. The box is meant to follow the character.
If the character is behind an obstacle or room(for example), then box would travel via the shortest distance, which as shown in figure. Is there a way to prevent the box form moving through this path and walk around the room.
Since I have to avoid moving back while finding path between points, any entry in closed list is first checked to see whether it had already been there. Say you reached a corner, then all the meshes that can lead you back out of the corner are all already present in the closed list and you gets stuck there as a dead end. This case can be seen if the room in the picture below is considered of small width. This problem could have been removed if box didn`t move inside the room to begin with.
Can ray tracing or steering be used? Found this question but the answer wasn`t clear. A* for finding shortest path and avoiding lines as obstacles