top of page

Utility Based AI

In this project I will be reusing an FPS game I made back in year 1 to create an artefact using an AI technique called Utility Based AI for the enemies in the game. The AI will be able to move towards the player, try to shoot the player, throw grenades, Take cover, self heal, use heal stations and flank the player. 

This was a 3 month university project at Falmouth University, created with the Unity Engine and C#.

COMP250UMLdiagram (1).jpg

Research

The advantages of using Utility Based AI is that it can be used for complex behaviour and as an alternative to behaviour trees if the developers are unable to implement them(Kylotan 2018).

A disadvantage of using Utility Based AI is that a lot of time and testing is required to make the AI entertaining for the player. This is because of how the utility is calulated and may need to be changed. In addition, the numbers that the AI uses to calculate the utilities may need to be changed as well. The other disadvantage with Utility Based AI is that though the AI may make calculations and use them to make decisions, it isn't Machine learning. By this I mean it could work the same as a Finite State Machine (FSM) or how a behaviour tree behaves in an environment (Rasmussen 2016).

Each action is stored in a hierarchy or ‘bucket’ that’s relative to the action. For example, a health bucket could contain actions such as ‘use syringe’ which has a score of 10 and ‘use Bandage’ with a score of 5, scores are also referred to as weights. Each bucket has a weight (sometimes called ranks), which are used in the AI’s decision making, the bucket with the greater weight will have higher priority over the other buckets.

 

The weight of the buckets can be randomised, or the weight can change depending on the situation and the AI compares a random number it generates to the weights, picking the bucket with the closest one (Graham 2020). Instead of picking the highest utility it will pick the lowest utility due to how it calculates the scores and weights.

More research and deeper explanation of my AI can be found on my GitHub repo via the link above.

Bibliography

 

GRAHAM, David “. 2020. 'An Introduction to Utility Theory'. In Anonymous Game AI Pro 360. (1st edn). CRC Press, 67-80.

RASMUSSEN, Jakob. 27/04/16. 'Are Behavior Trees a Thing of the Past?'. Available at:https://www.gamasutra.com/blogs/JakobRasmussen/20160427/271188/Are_Behavior_Trees_a_Thing_of_the_Past.php. [Accessed Feb 28,].

Kylotan. 2018. 'The Total Beginner's Guide to Game AI'. Available at: https://gamedev.net/tutorials/programming/artificial-intelligence/the-total-beginners-guide-to-game-ai-r4942. [Accessed Mar 7,].

© 2020 by Max Oates. Proudly created with Wix.com

bottom of page