
Squad-Based Ally AI for a 2D Top-Down Shooter
The simulation runs autonomously. When all allies or enemies are dead, press R to restart the simulation. You can click and drag the map and zoom in/out with mouse scroll wheel.
This project explored the design and development of squad-based AI behaviours for a pre-built 2D top-down shooter as part of a university coursework submission, developed using Unity and C#. Core gameplay systems and maps were provided, allowing the work to focus entirely on developing the AI.
The AI I developed features squad-based behaviour with defined roles, formation movement using steering behaviours, finite state machine decision making, target and weapon selection, friendly-fire avoidance, and A* pathfinding blended with steering to navigate the map. Agents make context-aware decisions about when to attack, retreat, or regroup based on squad state and combat conditions.
AI features implemented
-
Squad-based behaviour
Allied agents operate as a coordinated group with defined roles such as leader, flanker, and support. -
Formation movement
Allies maintain formation positions behind a leader using steering behaviours, allowing the squad to move as a unit without clumping. -
Decision making (FSM)
Agents use a finite state machine to decide when to follow the squad, attack enemies, or regroup. -
Target selection
Agents choose enemies to engage based on distance and current squad context. -
Weapon selection
Multiple weapons are available, with AI choosing when to use melee, guns, or rockets based on range, enemy density, and safety. -
Friendly fire avoidance
Agents avoid shooting when allies are in the line of fire and use additional safety checks for explosive weapons. -
Navigation support
A* pathfinding is used to navigate procedurally generated maps, blended with steering behaviours for smooth movement.
| Published | 11 days ago |
| Status | Released |
| Platforms | HTML5 |
| Author | Elise Hunter |
| Genre | Simulation, Shooter |
| Made with | Unity |
| Tags | 2D, Automation, coursework, game-ai, Singleplayer, Top down shooter, Unity |

Leave a comment
Log in with itch.io to leave a comment.