1
\$\begingroup\$

I am working on a space themed game with space being a 2D pane. The player issue order by clicking on the coordinate for his/her ship to navigate to a certain point on the pane.

The player ship can:

  1. Propel forward and backward
  2. Strafe starboard and port
  3. Yaw starboard and port

The ship's performance on each direction varies greatly depending on configuration. Some may move faster on sides and back directions than they do forward direction.

I have combined A* and PID control for navigation but couldn't help but noticed that in many occasions where the ship could have accelerate to the full speed and turn towards the target to reach the target faster, it instead turns in place while strafing slowly until it faces the destination before accelerating.

I would like to add another calculation that let the ship knows which navigation approach it should take to minimize the time to reach the target but I have no idea which field of study I should look into or if there is a quick win scenario I could use to achieve an expected outcome.

Please kindly recommend and thank you very much in advance.

\$\endgroup\$
  • 1
    \$\begingroup\$ It sounds like your A* implementation isn't correctly accounting for all the state changes available from the current state. Remember that A* is an algorithm for finding a path in a graph, and that graph needn't be limited to positions in physical space — it can include your vehicle's heading and velocity to capture your vehicle's position in state space. Can you show us how you're using A* at present? And do you have obstacles in your map that the ship must navigate around? \$\endgroup\$ – DMGregory Jul 21 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.