Hi, my problem is a little difficult to describe. But I have a question about an enemy that I'm working on. It's a 2d game based in unity. What I want to achieve is an enemy ai which will move to the closet node in a graph which has a clear shot at the player. If there is no close node, then it remains where it is since it cant take a shot. I've already got A* working with my nav graph in a tile base game. I've uploaded an image of what my game looks like while debugging. You can assume the player is the red square.
I've thought about simply splitting the tile map into 4 quadrants which can be searched based on where the enemy is spawn. For example, if its in the right quadrant, then search all nodes in the right by casting a ray at the player position and move to other quadrants if no match found. Finding the closest node with not obstacle in the path and moving the enemy there. But this could easily search all nodes before finding or not finding a valid node.
Are there any algorithms that I can use or some methods todo this? Is there a way todo this through A*?