Player-Like Mech AI

2019-08-22

student

game

unity

csharp

This project was a university assignment I completed wherein I had to design and implement a decision tree for a game AI to emulate a player in a mech battling game.

Behaviour Tree

For this project, I implemented behaviour functions in the main AI script and ran all decision logic from the behaviour tree, using PandaBT a behaviour tree library for Unity.

Part of being a player-like AI meant that I could only use information that a player could reasonably have had access to, like line of sight to enemies, guessing where enemies were going when leaving line of sight, and only attempting to gather pickups that they had seen before.

The AI used it's current ammunition, health, and number of known opponents to determine how aggressive to be. When running low on ammunition and health, the need for pickups greatly increases. Players also tend to try and disengage when being targeted by multiple aggressors, which this AI does also.

The AI was implemented in C# using the Unity game engine, built from a base game provided by the teaching staff at the university.

You can find my decision tree and AI script on my GitHub.