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

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

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

Post » Sun Feb 09, 2014 12:38 pm

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!
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 963
Reputation: 10,721

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


Return to How do I....?

Who is online

Users browsing this forum: AndreasR, Yahoo [Bot] and 8 guests