Originally created by David Ang, this demo showcases a tower defense game where entities (spiders and marines) try to reach a destination (blue fiery portal) while avoiding obstacles using either steering behavior (spiders) or A* (marines) pathfinding. Tanks have been added as towers that rotate to face the furthest entity within its range. Particle effects are utilized to show starting points and destination points. This demo outlines the code for the entities avoiding obstacles with a bounding sphere and finding a path using A*. This 3D sample also implements particle systems defined by XML files loaded with the Content Pipeline. The XNA 3.1 demo can be found HERE
Ai Obstacle Avoidance & A-Star Pathfinding
This article is based on an open-source demo originally created by David Ang in XNA 3.1 I have successfully updated the demo to XNA 4.0. This is a simple example of how one could implement obstacle avoidance using steering behaviors and path navigation using A* in a tower defense like game.
Posted by Jdawgg25 on