Pathfinding AI for multiple enemies?

Get help using Construct 2

Post » Sun Feb 09, 2014 12:18 pm

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.)


Any advice would be very gratefully received.
Posts: 19
Reputation: 323

Post » Sun Feb 09, 2014 12:38 pm


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!
Posts: 1,062
Reputation: 12,725

Post » Mon Feb 10, 2014 5:40 pm

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!
Posts: 19
Reputation: 323

Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 12 guests