Hi! I'm working on a top down shooter game and I'm struggling to make an A.I system that makes me feel like I'm fighting another player that has a remote idea of what they're doing.
In my game, enemies roam around the map until they see the player or hear them. After hearing or seeing them, they will move to the appropriate engagement distance(Distances of engagement depend on what gun the opponent has) and attack. At the moment they just sit in one spot and shoot until they kill the player or get killed themselves.
This doesn't quite meet my needs for the AI, I want them to be able to recognize cover and hide behind it if they get hurt. Or have the ability to make a path that flanks the player.
I have a general idea of how to code the hiding behind cover part, just move to a position where the players line of sight is obstructed, after all...you can't shoot what you can't see. But how to find an area where the players LoS is obstructed is something I'm not sure how to do.
And I don't even know where to start with the flanking part...
I know this may be very difficult to answer in one post, but any help or advice that gets the ball rolling would be GREATLY appreciated!