[USER=“908991”]kup guitarplayer[/USER]: Ok, here we go. I played around with it a bit and found a simpler solution than the one I outlined.
So first we make our board. I fill the center with impassable tile actors first and set bDiagonalMovement in the Grid Manager to false. Next I create a couple of actors based off BP_GridActor. They have no functionality other than the standard GridActor functionality, but I have added a static mesh plane and some text to designate the start and goal. Lastly I add an invisible wall between the two. This is how the end result looks:
At this point we have a board where we can move around the edge, but we can move both ways. So lets remove all edges on the board pointing backwards towards the start.
I create a new function that I call after grid setup (when the original edges are added). I run pathfinding from the Start location with a range that is as long or longer than the distance to Goal.
Next I loop over the output PathsMap, which holds the Grid Index of each tile on the path, the cost to get there and the “parent” of each tile. The parent for each tile is the previous tile on the path, which in this case will always be one tile closer to Start (since we ran pathfinding from here). Knowing this we can loop over the tiles in our pathfinding map variable and remove the edge between each tile and their parent (in the direction of the parent).
We are almost there. Only thing missing is to add a new edge from Goal to Start (since we blocked this with an invisible wall, removing the edge). So we add this manually at the end:
Et voilà: