0 Favourites

Pathfinding AI for multiple enemies?

  • Hi all.

    I'm trying to create pathfinding AI that works for multiple enemies and my noobishness is causing real issues!

    I've looked at tutorials (Bombing Chap etc) and a few forum posts but not getting very far.

    I can get the AI to work for 1 enemy but not properly for more than that. I created a 2nd enemy and that one only moves after it's seen my player then AI functions correctly. Pressing S spawns a new (3rd) enemy and that one won't move at all. I've tried using functions and using UIDs but didn't really know what I was doing and that didn't work either.

    My plan is to have continually spawning enemies but obviously the AI needs to be solid before I can do that.

    Address for capx (this is everything after the .com of Dropbox.)

    /s/tb659o192n4fwqf/Multiple%20enemy%20AI%20failure.capx

    Any advice would be very gratefully received.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • r160.2

    https://copy.com/LiqBG6usE9o1j0cX

    I've disabled a massive amount of your code, simply because it was quicker to start from scratch. It can now create an unlimited number, and they will find their way.

    Your code is rather messy I'm afraid. I'm not a tidy coder, but even I found myself getting lost in it all.

    Hope I've helped!

  • Thanks AnD4D! That sort of helps. Obviously you've simplified things a lot but as soon as I start trying to reintroduce the LOS stuff, the animation and other aspects to the behaviour etc it all screws up again!

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