Displaying walkable tiles using astar

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By roothewhirl

Hello! I am creating a tactical grid based game using AStar. The player will move to a certain grid square that has been clicked on. The player only has a limited amount of steps per turn and the amount of walkable steps (as well as the AStar) will update dynamically based on how many steps the player has taken.

My goal is to visualize the steps the player can take. My current issue is:

If there is a set of walkable tiles “around” a corner, where these connections are not made, the player should not be able to walk there.

Here is a visual example of my issue:
Imgur

I have leveraged an existing script from GDQuest (awesome work guys!) that allows me to skip over obstacles when drawing out these walkable tiles, however, once I check for tiles that don’t have connections (using astar_node.get_point_path(player_index, point_relative_index) I get this result:

I got very excited at this result, as it seemed to remove the highlighted tiles that were not connected. However, it removed one that does seem to be connected. Something similar happens when I move the player up a few tiles:

Hopefully this illustrates the issue I am having. I have also supplied a gist of the most important functions in this code, but can paste more if needed! Thank you for any help, ideas or suggestions!

Here is the code I am using (again, thank you GDQuest for posting the template I am basing this off of :)) The place where I am setting the “visiliby walkable tiles” is line 73.