How do I Make a enemy Ai for a rpg 8 Direction

0 favourites
  • 3 posts
From the Asset Store
Enemy turtles pack including fifteen fully animated variations
  • Im making a top down view Rpg ( not Platform) and i cant figure out a way to make a Ai that will attack me if i get close enough to it. and if im not close to it than in runs its coarse

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • There are several ways to do AI for top down games, but it seems most of the time using things like pathfinder adds a whole new level of complexity and bugginess to the game. Namely, pathfinder doesn't care about solids. If it's moving along a path and that path has just become nonviable, it will still get to it's target location. I've considered a slightly more manual approach using an array for lost positions, but that seems a little intensive.

    The idea looks a little like this:

    But for a static world game where nothing ever, ever changes state, pathfinder is probably the easiest option.

    Oops, I think I just answered the wrong question. In terms of telling the AI whether to target you or not, line of sight is quite useful. In terms of roaming around, I have tried using instance variables for the AI to center around, and then it's moderately easy to just pick a position that is not overlapping solids/has line of sight in a random area around the AI.

  • Thank you that help

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)