AI stop moving?

0 favourites
  • 4 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Hi everyone,

    I'm actually prototyping a game with some bad guys who runs after you or your coffin (yes, you play as a vampire).

    I just tried for the first time the pathfinding behavior and it works pretty well. But at some point, AI stop moving and I don't know why.

    Maybe there is something I didn't get.

    Here is the code for the guys who attacks the coffin object:

    And here is the code for the ones who attack the player object:

    If you want to test it, here is the c3p file:

    dropbox.com/s/raem6256p6b9jlt/GameTest.c3p

    Maybe there is something I didn't get about the pathfinding so any help is more than welcome!

  • Maybe they failed to find a path. You don't have any events to check if they failed to find a path. Pathfinding every tick with multiple instances is always problematic though. Also I don't see a need to regenerate the obstacle map so those events can go.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tried to check if they failed to find path but it's not about that.

    They have a valid path but don't want to move anymore.

    If I want then to regenerate the obstacle map it's simply because I don't want them to stay in line in front of their goal. The idea was to make them side by side as they are also solid objects. That's the reason…

  • Ok so they are obstacles to each other, maybe that's fine but I think regenerating obstacle map that often is supposed to be a big performance killer. If they can find a path then it might just be a picking issue, with multiple instances finding paths every tick with lots of embedded events it can get a bit messy. You could try using timer behaviour on the enemies to refresh the find path instead of using every X seconds, then you can better track which ones are failing.

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