4
\$\begingroup\$

I've been looking for a path-finding algorithm for a moving target. If there are no obstacles in proximity Seek behaviour would be good. However, A* or some other path-findings are needed when obstacles are on the way to the moving target.

The problem I'm facing now is that calculating a path using A* seems not efficient for a moving target. so I want to know if there are some good or preferred ways to solve this problem.

The image below shows some basic background of the problem. The red arrow shows the direction my Seek behavior calculates. But I want the "Chaser" to take the green direction instead. enter image description here

Thanks in advance.

\$\endgroup\$

1 Answer 1

4
\$\begingroup\$

You can switch between pursuit behaviour and A* depending on case. If chaser can actually 'see' the target (without obstacles on the way), it uses pursuit (maybe its characteristics makes it evade obstacles), and when it dont see the target, it use A* once to position where he thinks that target is (or last position where target was seen). When it reachs that position, it's up to you: It will continue trying to pursuit target (using A* to random locals), or will move around randomly (A* to random positions or wander behavior) or will stop and wait until it sees target again? :)

To 'seek' the target, you can use raycast.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Thank you. Ill try to implement the way you mentioned above. \$\endgroup\$
    – neko
    Commented Dec 4, 2017 at 11:19
  • \$\begingroup\$ Please, give your feedback after it :) \$\endgroup\$ Commented Dec 5, 2017 at 3:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .