Collision Between Instances Having Pathfinding


#1

So I’m working on a top-down zombie game similar to boxhead. The enemy should basically chase the nearest player. I have it all done by a distance condition and pathfinding behavior.
The problem is implementing collision between the enemies themselves considering they are instances of a same object. The action separate two objects worked well but it has some issues with the pathfinding object. The enemies blink uncontrollably suggesting that the collision handler and pathfinding is counteracting each other.
Any ideas on how should I implement collision between instances with pathfinding?
Ps. I’ve tried pathfinding with physics behavior but no luck.


#2

Take the zombie pathfinding demo for example. That’s what I want to achieve, but I don’t want the zombies to step on one another. They should collide with each other instead while still moving toward the player.


#3

behaviors: pathfinding and obstacle for zombie !

!
obstacle|690x169

This is my exemple project ! i hope that can help you :wink:
https://mega.nz/#!9kYQTYbJ!Nwra_vp3kiTRW9yoblZCkN5f0oTknzi97CqKImfzyP4


#4


#5

I tried your project and put top-down behavior to the player but it also glitches as what I’ve said. The enemies blink randomly when they’re close to each other.
Btw where did you put that pathfinding obstacle behavior? I checked your code and can’t seem to find them.


#6

send me your project for i understand better… no glitch with me… i have just two comportment on zombie ! path findingobstactle, and pathfinding !


#7

Try to put top down behavior in your character and move randomly. You will notice that the enemy will bug when they collide to each other.


#8

https://mega.nz/#!kt5XgLrK!n1iCC52TFWIKhYvqElJziTYw_y-pSDBga4sQvB9UzFM

i think understand ! i have modify the project ! now that seem very good ! tell me if its what you need :wink:


#9

if you need other things, ask me again :wink:


#10

That worked better but there are still some times that the enemies blink and teleport.
I decided to remove the pathfinding behavior and separate objects action then add physics behavior and add manual forces to evade the obstacles.
Physics behavior worked a lot better in handling collisions and so far no blinking stuffs or errors but the problem is manually adding forces for pathfinding which is kinda exhaustive.
This will be a lot easier if we can apply pathfinding and physics behavior at the same time.


#11

okay, i have never use physic behavior… and now, even if its complicated, the result is perfect for you?


#12

Yep. Physics behavior is more precise in handling collisions between objects.