How do I Multiple Enemies to Pathfind to Player w/o...

Get help using Construct 2

Post » Fri Mar 20, 2015 4:28 am

How do i get multiple enemies to pathfind to player without them combining and looking like one enemy. I think its in the " Every X seconds" that's making them path find in the same place to make them look like one? This is mostly when running away from the enemy.


Heres how i got the enemy to Pathfind to the Player. The enemy is made of 2 objects. Top is Turret. Bottom is Pathfinder.

Image
B
13
S
3
Posts: 29
Reputation: 783

Post » Fri Mar 20, 2015 5:18 am

Hey JasonS, :)

One possible approach might be to separate the problem of path finding from the problem of overlap prevention.

Instead of having the Soldier be the object doing the path finding, make your current path finding object invisible, and make a new soldier object to follow the path finding object. Then give that Follower object the physics behavior, with a constant force pulling it towards its personal Pathfinder. By default, Physics objects won't overlap each other, and will instead slide past each other, or bunch up like gumballs in a jar.

But what if there's a physics traffic jam, and one of the physics Followers can't keep up with its Pathfinder object? After all, if a Pathfinder goes around a corner while the Follower is stuck, even if the Follower later gets un-stuck the Follower may not be able to reach the Pathfinder by moving straight at it, via a physics force. We need to make sure a Follower never gets left behind.
Basically each Pathfinder should be a mini Dr. Alan Grant. :)

To prevent Followers from getting left behind, you can pause the Pathfinder if it gets too far from the Follower. "Too far" in this case might mean 1 or 2 soldier widths. Ideally the soldier (Follower) will nearly always be just behind, and almost touching its Pathfinder.
B
24
S
15
G
8
Posts: 314
Reputation: 5,751

Post » Fri Mar 20, 2015 6:12 am

Ah, that gives me some other ideas for things. But i really cant have a enemy waiting up for a follower. i need the enemy to be on the players arse. but i never thought of a invisable follower. That could be usefull to me later on.
B
13
S
3
Posts: 29
Reputation: 783

Post » Tue Dec 22, 2015 3:59 am

@fisholith If a simple Capx files exists for this, that would be awesome! I can't seem to figure this out.
Check out my games on Google Play:

BEAST ATTACK (850,000+ downloads!)

ZOMBIE BASH (Android) (Launched Feb 17)

ZOMBIE BASH (iOS) (Launched March 17)
B
43
S
14
G
2
Posts: 424
Reputation: 4,881


Return to How do I....?

Who is online

Users browsing this forum: ling200916, ridhoemgl and 9 guests