For the second term at Level 5 of my Computer Games Programming (BSc) degree at University of Staffordshire, I had a Game Artificial Intelligence module where I created functionality for different parts required for Artificial Intelligence in games. This was all coded using C# in the Unity engine.
Steering Behaviours
There was a lot of small parts required in this module for example steering behaviours such as:
- Seek
- Flee
- Pursuit
- Evade
- Arrive
- Wander
- Collision Avoidance
There was also the ability to combine several steering behaviours and the group movement steering behaviours of separation, alignment, and cohesion; which culminated in emergent group movement (aka flocking).
Pathfinding
Pathfinding was also required with Dijkstra, A*, and Jump Point Search all implemented. Four different heuristic functions were added as an option which were Manhattan, Euclidean, Octile, and Chebyshev.
Decision Making
By far the largest portion was Decision Making. To begin with methods for decision making like Finite State Machines and Fuzzy State Machines were experimented with, however, in the end I decided to implement and make use of behaviour trees in order to create my decision making agent (as seen in video above).
Once behaviour trees were setup, I created a variety of leaf nodes to give the agent the behaviour I desired such as: pathfinding to pick-ups if needed, evading and battling enemies, and patrol randomly. Then composite nodes like selectors were used to ensure the agent prioritised the correct behaviour.
Conclusion
Overall I learnt a lot about what is required to create functional and believable AI for a game, and have experimented with the various techniques. I believe this has left me with a solid foundation to build AI as required for anything I work on in the future.