top of page

Squad based ai

falmouth logo.jpg

Unity (C#) | Behaviour Trees | Squad AI | Cover System

This project is a squad-based AI demonstration developed during my second year at Falmouth University. It showcases a coordinated soldier squad in Unity where agents breach a building and work together to locate and eliminate the player.

The system was inspired by Ravenfield and was my first AI system built entirely from scratch using Behaviour Trees to control decision-making and squad coordination.

​

​

​

Technical Challenges
 

One challenge was designing a cover selection system that allowed agents to choose suitable defensive positions rather than simply moving to the nearest cover point. The AI evaluates available cover locations using factors such as distance to the player and whether positions are already occupied, helping distribute agents across valid cover and avoid clustering.

​

Another challenge was implementing squad-level coordination. A squad leader system was introduced where one agent acts as the decision maker and issues commands such as when the squad should breach or advance. If the leader is eliminated, remaining agents revert to independent behaviour while continuing their standard combat logic.

This is the base soldier behaviour tree that is made up using nodes, sequences, selectors & utility selectors​:

​

​

breaching.gif
Squad AI running and shooting video v2.gif

These functions are part of the cover system and handle how the soldiers find the best cover spots within the area. This is dependent on if the spot is already occupied as well as finding the closest spot.

AI code 2.PNG
feature details

Ravenfield has an AI system that are grouped with squad leaders. I wanted to make a squad system that was similar to this, but instead of using finite states which was used in Ravenfield to generate the AI's behaviour, I'm using a technique called behaviour trees in my project.

​

The demo has a lot of behaviours linked together and the main ones are listed here ---->

  List of AI behaviours:​

  • Utility system

  • Communication

  • Breaching

  • Cover knowledge

  • Limited vision

  • Memory

  • Squad cover fire

Here is a poster created midway during development for the demo:

References:

​- Johan Hassel, SteelRaven7 (2017) Ravenfield. [Online] PC.

​

​

  • LinkedIn

©2021 by Ethan Jones. Proudly created with Wix.com

bottom of page