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

  • Ashley , thank you for answering and posting the solution.

    Indeed, that was the problem! the rotation speed. since my enemies are fast, they needed a highger rotation that ended up solving the problem. or at least that's what I think and I'm seeing, you can look it by yourself at this .capx I made with the rotation fixed! so anyone who went into this problem could get this .capx and see that actually it has a solution:

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

    Also, I've implemented a LOS to see that you won't be actually seeing them rotating that fast because you could adjust it manually by setting rotating object to no in their pathfinding properties.

    and in this gif I'm showing the fact that my guys are following properly now. <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">!

    Thank you guys! you might want to pin this to the How do I FAQ. I didn't see something like this in that place.

    Looking at this latest gif a question came to me:

    How can we handle the guys entering in each other?

  • Zathan, I'm not quite sure, but different speeds (something like random max speed for making them slighty getting apart) or using boids plugin could do the job.

    Dunno if someone has another workaround for that. I'm trying with different speeds and is doing a pretty decent job.

    You might want to create a 'How Do I...?' post or look if someone solved that detail.

    Here's a WIP (work in progress) gif using different speeds, isn't perfect but is quite a complicated problem you got there, I do suggest maybe with boids or looking around as I said! I might try boids later. Dunno if Ashley got a word for your question.

  • Crowd avoidance is another incredibly difficult problem with lots of nasty edge cases. But you can make a reasonable simple approximation. One example is to have a rule like: if two enemies are overlapping, pick the one further away from the player, and make them slow down. This means if enemies bump in to each other, the one behind waits to let the one in front ahead. It's not perfect though, especially if you end up with a large crowd, but it can help a lot with simple cases.

  • Yea, something like I did but with a new condition of making them slow down will actually do the trick. thanks Ashley for being such helpfull!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • That's a hell of a topic

    Thank you oultrox and ashley!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)