How do I Make my enemies chase the player with pathfinding.

Get help using Construct 2

Post » Tue Jan 10, 2017 3:45 am

Hello there,

I'm trying to figure out with the official Pathfinding plugin, How to constantly and smoothly make some enemies follow an object, without getting out the path, i'm trying a lot of tricks but nothing is a solid solution, I tried with stop and then keep following with the every 0.1 seconds condition, but nothing, even a guy tried to help me in another issue but this ain't working, I'll be glad if someone would guide me in HOW to do it, because I find quite weird that the official plugin could not handle this kind of behaviour I need.

I'm going to attach this .capx that could help anyone to try and see what I'm trying.

https://www.dropbox.com/s/ywset1901frys ... .capx?dl=0

If it's the size, well, let's try something else, but true is that the game's resolution is 16x16 and it's one of the most standard, I'm pretty positive that someone must know how to handle this!

this community is awesome and I admire lot of people here, I learned a lot in the forum and it helped me to figure out a lot of things in my games, so I hope this will be fixed and solved too.

Regards.
B
9
S
2
G
2
Posts: 21
Reputation: 1,567

Post » Tue Jan 10, 2017 4:12 am

B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Tue Jan 10, 2017 4:39 am

Thank you for quick response, I checked in my main Game and that made that my enemies follow the path correctly!! but, however, I'm facing another problem. they're not actually chasing me smoothly, but they go to the last place I was UNTILL they arrive. any trick for it? you can also see the result in the capx you attached, any hint?

EDIT: Any routine, timer, trigger I try gets me the same result that you fixed commenting the every x seconds and putting those 2 conditions. :( halp
B
9
S
2
G
2
Posts: 21
Reputation: 1,567

Post » Tue Jan 10, 2017 5:23 am

I don't really have much experience with the pathfinding behaviour.. It seems kinda tricky to work with.. Anyway, I made another try, see if that's any better:

https://drive.google.com/open?id=0B1Aaz ... nRQVm92THc
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Tue Jan 10, 2017 2:25 pm

Heya Space, thank you so much for your .capx, don't worry if you don't have much experiencie with this, you've helped! still, maybe someone could help us figuring out this because isn't perfectly working, because your last try didn't change that much the problem :(. I'm going to show you deeply with these gifs:

the solution you made that actually makes the enemies follow the path correctly, but...
Image
The enemies has like with a mental delay.

And what I would want to:
Image
AND you can see that this try I made, has the pathfinding errors we encountered in my first .capx
The red zone is obstacle map, to let you know that they're NOT following it properly.


I made that try with the typical every 0.1 seconds -> Find path and on path found -> Move along path
B
9
S
2
G
2
Posts: 21
Reputation: 1,567

Post » Wed Jan 11, 2017 2:49 pm

*Bump* I really need some help over here :(!
B
9
S
2
G
2
Posts: 21
Reputation: 1,567

Post » Thu Jan 12, 2017 2:48 pm

*bump ...
B
9
S
2
G
2
Posts: 21
Reputation: 1,567

Post » Thu Jan 12, 2017 2:48 pm

*bump ...
B
9
S
2
G
2
Posts: 21
Reputation: 1,567

Post » Thu Jan 12, 2017 5:03 pm

I haven't tried any of the game version yet but looking at spacedoubt gif the movement seems more suitable than your idea. I mean that technically it is not what you want to achieve but it might look more realistic since if you have a gun you don't want to go on melee but on the contrary you want to follow the enemy but still try to get as much cover as possible. That 'error' seems like they want to stay somehow away. I need anyway to see the game to test the real behavior. Different story if your enemies have a melee weapon, in that case your solution might be better.
B
21
S
5
Posts: 52
Reputation: 1,308

Post » Thu Jan 12, 2017 5:11 pm

Hello Biim and thanks for your point of view, the first Gif I made yea, is from spacedoubt solution, I'm not quite sure if this kind of behaviour will suit for the entire game since this time, okay, the seemed to be like cover, but it won't be like this all the time maybe, so it could appear that the enemies have some lag or stuff like that.

and indeed, we also got melee enemies.

so my scope is neccesary too (I woulnd't say solution since I don't have it, if you see the second gif, you could see how the enmies doesn't follow the path correctly, getting though walls).
B
9
S
2
G
2
Posts: 21
Reputation: 1,567

Next

Return to How do I....?

Who is online

Users browsing this forum: MathNook and 35 guests