Ciubhran
09-15-2009, 10:44 PM
Trying to add some AI to my game.
So far the enemy has a Detection Range (Aggro Range).
If the Hero enters this range, and the enemy has sight of him (a line that is drawn from Enemy to Hero, and if it collides with walls, then the enemy does not have sight of the Hero) then the enemy will charge and attack.
Then when the player goes out of line of sight, the enemy runs back to its original position.
This all works great, but it is easily exploitable as you can just run around corners and the enemy will reset, which is not what I want.
So the bottom-line is: Does anyone have any good examples of how to make computer AI that runs around walls and/or other ways of making some form of pathfinding AI that the enemy follows so he doesn't run into walls as easily and will ignore the walls if the collision is "small", like when you run around the corner.
There are thousands of games with this AI, I am hoping to find someone here who has experience of this kind of enemy AI.
I don't want the AI so dumb that is forgets what it is doing just because I run around a corner.
So far the enemy has a Detection Range (Aggro Range).
If the Hero enters this range, and the enemy has sight of him (a line that is drawn from Enemy to Hero, and if it collides with walls, then the enemy does not have sight of the Hero) then the enemy will charge and attack.
Then when the player goes out of line of sight, the enemy runs back to its original position.
This all works great, but it is easily exploitable as you can just run around corners and the enemy will reset, which is not what I want.
So the bottom-line is: Does anyone have any good examples of how to make computer AI that runs around walls and/or other ways of making some form of pathfinding AI that the enemy follows so he doesn't run into walls as easily and will ignore the walls if the collision is "small", like when you run around the corner.
There are thousands of games with this AI, I am hoping to find someone here who has experience of this kind of enemy AI.
I don't want the AI so dumb that is forgets what it is doing just because I run around a corner.