When trying to program hostile AI units for a war strategy game using pathfinder methods, do programmers ever have one algorithm for the unit to move and a separate algorithm for the unit to actively listen for nearby objectives (e.g. opposing warriors, power ups, opposing team's fortress, treasure, etc)?

Any insights as to how these methods function would make me happy.

  • \$\begingroup\$ just search path-finding in this site! it gives you all the information you need about currently available algorithms. \$\endgroup\$ – Ali1S232 Feb 18 '12 at 5:36
  • \$\begingroup\$ possible duplicate of Real Time Dynamic Pathfinding? \$\endgroup\$ – Ali1S232 Feb 18 '12 at 5:38
  • 1
    \$\begingroup\$ It's not clear what's being asked here. The title implies "pathfinding algorithms for higher dimensions" (3D? 4D?) whilst the question is asking about an AI will move and listen. Yes, they have separate algorithms, since an algorithm for movement just moves the enemy and has nothing to do with listening, and if it did also do listening, it would still just be a movement and listening algorithm running side by side. So what are you actually asking? How would you create an AI which keeps an eye out for objectives, and readjusts its path to incorporate them? Please clarify. \$\endgroup\$ – doppelgreener Mar 19 '12 at 10:00
  • \$\begingroup\$ If it's about an AI which keeps an eye out for objectives and readjusts its path, this is definitely a duplicate of @Gajet's link. \$\endgroup\$ – doppelgreener Mar 19 '12 at 10:02

You can use the same algorithms as normal, for example this is my version of A* in 3D: http://roy-t.nl/index.php/2011/09/24/another-faster-version-of-a-2d3d-in-c/

All you have to do is to make the 'is adjacent' function fetch 3 dimensions.

| improve this answer | |

Your Answer

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

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