Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

do the npc go search random area if loose sight of you or they chase you forever?

The enemy can "see" the player or "hear" when the player is near. Then pursuit and shoot when the player is on sight. If the player it out of sight and far from the hear area, it goes back to an idle state.

ahhhh i wish i knew how implement search random area state, there's not really any tutorials on how do this

In my Tanks! Template I improved the enemy AI. It has a patrol state going to random areas instead of an idle state. If the player is on sight it shoots. If the player is near enough but not in sight, then it goes in a pursuit mission. But if the player goes away too far, the enemy moves in random directions until it finds the target again.

oh ill look at it when i have time!!