Alternate methods for Ai navigating through mazes?

0 favourites
  • 8 posts
From the Asset Store
Ball maze is a mobile game, where you have to win the maze.
  • Hello everyone, so im on a difficult part of my project right now and it's getting my enemies to move correctly,navigate,roam and chase the player through the maze. Currently, I've tried a method that was suggested to use for Ai navigation and that is the Pathfinding behavior. I've gotten them to move and follow the player a bit, but it's not going exactly how I want it to go. They take a bit to pick up the player, and when they do follow the player, they go through walls and just really all over the place. I also did it with line of sight,but like I said, they're slow to pick up. Currently, im thinking of making my NCP's just use the 8 Dir Behavior to stimulate they're movements and just have them roam kinda like in the Eat Em up(PacMan clone demo). Maybe I can also use the bullet behavior for them and chase the player as well? Idk, but if someone can send some links of using these behaviors for enemies Ai then that would be helpful. I've also checked out this site https://howtoconstructdemos.com/category/enemy-ai/ which helped a little with the pathfinder behavior, but im not sure how to make the enemy avoid walls. Another thing I would like to point out is that there's not much videos or tutorials of teaching how to us it for enemy Ai's. It shows for the player, which is to use a mouse and click a spot, but not much for enemy use. Any help would be appreciated. I just don't know where to go with these Enemy Ai. Also, my notification keeps on giving me errors not allowing me to view my notifications. This been going on for a month and 2 weeks now. But anyways, hopefully someone has some alternative ways of doing this. The pic below is there to help see the idea of them roaming and chasing player.

  • With pathfinding it's all about correctly configuring it. You need to find the right cell size, cell border, speed, rotate speed etc. With correct values your character will navigate through the maze properly.

    If your game is grid-based, you can try EasyStarJS addon, it's an advanced and very fast pathfinding plugin for tilemaps, there is a link to C3 version on the last page:

    construct.net/en/forum/extending-construct-2/addons-29/behavior-easystar-js-pathfindi-96215

  • Im not using any tilemaps or grids for this. It's just solid walls, clearings and the player for the enemy to navigate through and chase. No check point markings either. Theres got to be some way to do this cause the demo shows how to use the pathfinding for enemy Ai on the site, it just that I need to find out how to use it to navigate around through walls in a maze and the demo isn't using none of the tilemaps, grids, point marks, etc. So, I know there is a possible way for this to work.

  • ArcadEd

    Got any tips or methods for enemy Ai chasing player and navigating through mazes while avoiding walls?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Im not using any tilemaps or grids for this. It's just solid walls, clearings and the player for the enemy to navigate through and chase.

    Ok, then your only option is Pathfinding. You just need to configure it correctly. If in your game the enemy goes through walls when moving along the path, it means that the cell size is too large.

  • Hmm, okay then, thanks for the clarifying cation. Can the Ai be done with bullet behavior or 8 dir as well for this?

  • Can the Ai be done with bullet behavior or 8 dir as well for this?

    Yes, if you manually create a path through the maze for the enemy, for example with waypoint sprites.

    But if the maze is random, then you need pathfinding. If you wish, you can use pathfinding only to calculate the path, and then move enemies along this path with other behaviors - MoveTo or Bullet.

  • Alright, I will try that, using pathfinding to calculate path, and see how to imply the other behaviors to it if I can. Thanks for your suggestions and help.

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