I have a weird question but how do I return a path cost based on the user hovering over an area of the map (with mouse) that they would like to move their character? I am thinking of a game like Jagged Alliance 3 which shows AP cost to move before the user decides where to go. Once I understand how to capture the pathfinding cost, I can use some math to make a user friendly read out for the user.
I read the pathfinding behavior documentation and I am generally familiar with pathfinding but in recent weeks, I've restarted my game after learning new techniques and now I am trying to learn more about pathfinding to better inform the user.
I can return X,Y calculations and use the abs() with some fancy math to calculate the distance between the character's current location and the desired location but that is not the same as pathfinding cost. My way actually does work fine however not when I throw blocks in the way or costly terrain pieces.
Side note: I understand Manhattan versus Euclidean distance if that helps. I teach ML/AI. Computer game design is just for fun.
Thank you