[BP]Question regard the manhattan pathfinding method

Hi everyone,
I'm working on a tile generator and things are progressing, but I cant wrap my head around the manhattan method in ue4. I think I do understand how it works and I've already setup the open/closed list loop, but I do not understand how to determine the path at the end, to be more exact how to save the parent of a tile.
What I've done so far:
Startpoint to open list -> starting loop (break when endpoint is on open list, or open list is empty) -> get "cheapest" point from open, put it on the closed, determine Hcost and put all neighbor points on open list -> back to loop
At the end I should have a closed list with the startpoint and all checked tiles (the path is somewhere here).
I'm using an array structure full of arrays to get a XYZ x XYZ matrix.
Would really appreciate any help :) and sorry for the formatting/noobish question, it feels like I'm missing something crucial here :P

Posted Aug 20, 2018, 6:03 PM UTC · edited

24
Angdrambor•

I've heard of manhattan distance, but what is manhattan pathfinding? Is it A* with manhattan distance?

1
ExpressPoetOP•

Yes thats it. I'm using the A* algorithm with manhattan method to determine the shortest path. Sorry for the confusion!

1
oNodrak•

You store the next shortest tile into an array of tiles called 'Path', starting from the end goal (once an optimal path has been found).

1
ExpressPoetOP•

Thank you for your help. Yes, but I didnt know how to do that. After sleeping over it, I guess I have to save the parent-information of a tile into the open/closed list and once I found the endpoint (on the open list) I'm going to read its parent (shortest tile) and so on. Finally I should get to the startingpoint and have a pathlist, right?

1