Hello!)
I’m trying to organize the movement of AI in an unknown location.
So far I’ve found two of the most common ways to implemen thist:
- Waypoints
- A random point in a radius, cast at a certain distance from the character
Both options are not completely suitable for my idea, so I began to think about the third one.
The concept is as follows:
AI has a vision that does not allow it to look through obstacles.
If he discovers that there is an obstacle in front of him, he determines the point behind him and marks it as “interesting.” There can be many such points. Consequently, it moves from point to point, creating new points of interest during the movement.
With such an implementation, one wants to avoid walking around one obstacle. It seems to me, it is necessary to store the explored area in the memory of the AI and, when adding a new point of interest, to check whether it falls into the already studied area or not.
How to store the exploredarea and how to check whether a new point falls inside the explored zone or not. Does Unity have any means for this?
decided to memorize all the coordinates of the angles of obstacles, build a polygon from them and make checks on the occurrence of a point in this polygon. How much is it justified? Can it be easier to implement? Since this method also raises a lot of questions for me (until I ask them, maybe respected users will prompt a simpler solution).
Or maybe I did not come from the wrong side and there are more correct ways of realizing the study of the territory by AI?