Game AI Labs
Five exercises covering a patrolling guard, A* pathfinding, steering behaviours, behaviour trees and goal-oriented action planning.
A* Grid Pathfinding · Case study
A Unity grid experiment in which search, tile state and agent movement are separate components.
GridManager and Node represent the search space. Walkable and blocked tiles have visible states, so it is easier to distinguish a pathfinding issue from an incorrect obstacle or grid setup.
The search skips blocked neighbours and uses Manhattan distance as its heuristic. The candidate comparison uses the lower heuristic as a tie-break when scores match. Parent links are used to reconstruct the route.
PathFinder returns a route for AgentMover to follow. I would move the goal check after the full candidate selection and test single-candidate and blocked-route cases before relying on this exercise as a production pathfinder.
References
Separates grid, node, search and movement. Uses Manhattan distance, excludes blocked tiles and reconstructs the route from parent links.