I'm currently developing a video game for fun, and I got stumped on a particular physics problem while making the enemy movement mechanics. I'm wondering if anybody can help me out. In this game, the enemy is meant to chase the player while exhibiting an acceleration of constant magnitude but varied direction. My question is that for a particular enemy position <Ex, Ey>, initial enemy velocity <Vx, Vy>, acceleration magnitude A, and player position <Px, Py>, what is the ideal enemy acceleration vector to guarantee collision with the player (assuming player position is static)?


1 Answer 1


If the player doesn't move, then the optimal choice is motion in a straight line in a system moving with the enemy velocity at the initial time. Your equations are then

$$E_x+V_x\,t+\frac{1}{2}A_x\,t^2=P_x$$ $$E_y+V_y\,t+\frac{1}{2}A_y\,t^2=P_y$$ $$A_x^2+A_y^2=A^2$$

You have three nonlinear (quadratic) equations for the three unknowns $A_x$, $A_y$, and $t$. Solve these and you're good. The system is polynomial and there's decent numerical algorithms to find a solution if one doesn't have a better idea. I need to go, so I'll let somebody else figure out a more elegant way to find the solution... ;-)

Update In general this kind of problem is known as the "chase problem", and there is quite a bit of literature on it. This article may be helpful. The article has some literature references for further study.

  • $\begingroup$ Thanks. I got this too, but I'm not sure how to go about solving it. If possible, I'd appreciate it if somebody did provide a more elegant solution. $\endgroup$ Commented Jan 30, 2017 at 16:15
  • $\begingroup$ I have this sinking feeling that you may be best served with a numerical approximation. There is a closed-form solution of the equations above, but it's truly atrocious. If you go with numerical approximation, a step-wise solution of the original problem, accelerating in the direction of the instantaneous vector between enemy and player, might be far preferable to trying to solve the above equations. This will be true in particular when we know that in general the player will be moving as well, in an unpredictable way. $\endgroup$
    – Pirx
    Commented Jan 30, 2017 at 16:20
  • $\begingroup$ The issue with using an acceleration in the direction of the player is that if the velocity of the enemy is perpendicular to the acceleration, I end up with an elliptical path which never converges onto the player. $\endgroup$ Commented Jan 31, 2017 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.