A* Path-Finding

Technical Skills: Java; A* Path-finding; Artificial Intelligence; C++;

Screenshot_2016-08-02-12-38-53

The project was to create an AI agent (purple) that could navigate through the maze to a given goal point while avoiding the enemy patrols (yellow). The maze is constructed from a 30 x 20 tile grid where each tile has its property set to default/navigable (white), wall (red), or enemy patrol (yellow).

When the program is run the agent is given the location of a goal tile and proceeds to generate a path to it using the A* path-finding algorithm. If the current tile being checked by the algorithm is part of the enemy’s patrol path an additional weighting is applied to it as it is a more difficult/less preferred path to take. After the algorithm completes it calculations the agent will follow the path. When the agent reaches the goal node a new goal node is set and the process is repeated. The patrolling enemy AI is calculated in the same way, except their path-finding only cycles between the two end tiles of their patrol area.

The project was originally written for Windows PC in C++. A version of the A* algorithm and all logic for the agents were rewritten in Java and included in the James Potts Portfolio app released on the Google Play Store in August 2016.