top of page

Squad based ai

falmouth logo.jpg

This is a computing AI demonstration I built in my second year at Falmouth University. It includes a demonstration of a squad-based AI in Unity that shows soldiers breaching a building in order to locate, and eliminate the target, which will be the player. Ravenfield, a first-person shooter with advanced AI behaviour, was the source of my inspiration.

​

This project was my first AI system built from the ground up using Behaviour trees.

​

Github link: https://github.com/EJ2001/Squad-AI-Project

​

​

​

​

DEMO VIDEo:
Approaching issues

 

Throughout the development of this project, I came across issues, one of the main issues I encountered was to do with getting the cover system working nicelyThe soldiers would struggle on how to decide what cover points would be more advantageous than others. To overcome this I gave the AI multiple decisions such as distance from the player, cover point already taken, in cover from player. This made it very easy for the AI to choose what cover points would be more suitable in the current state of the demo.

​

Another issue I came across was determining how I can get the AI squad to work together and communicate effectively. I thought of an aspect that concludes with the squad leader being the brain of the squad and making decisions to command the other soldiers. This worked nicely and gave a realistic direction to the squad's behaviour. When the squad leader is taken out the soldiers just carry on with their normal behaviours but don't have commands anymore.

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

​

​

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

The squad leader is the main brain of the squad and tells them what to do e.g decides when and where to breach

AI code.PNG

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
soldier inspector.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.

​

​

bottom of page