University Project
| Engine | Project Type | Time (hrs) | Number of Developers |
| Unity 3D | University Unit | 200 for the entire unit include assesments | 1 |
This was a unit in my final year to research different AI models and then create an artefact that shows how and when you would use them in a game.
These are the AI patterns that were used in this project
- State Machine
- Behaviour Tree
- Steering Behaviours
Villager
The villagers would use a behaviour tree to find out what their current desirer is and to go to that location and do the respective activity, so if they needed to sleep ad their highest desirer then they would go to bed, if it was money they world go to work and food they would eat. If all of their desirer were low then they would have a default desirer which was to walk about. Each desirer had a weight on it so each villager would feel different from one another and they all would not be doing the same activity at the same time. The desirers that the villager had were; sleep, eat, health and work.
| Effect | Desire | What effects it |
| Amount of gold | Go to work if low | Buy food Player stealing their gold |
| Tiredness | Go to bed | Reduces over time |
| Hunger | Go buy some food | Depending on amount of gold Reduces over time |
| Health | Go to the hospital | Coming into contact with rats |
Guards
The guards would use a state machine as they would chase the player and attack them if they got close enough to the player. These were controlled by a state controller that would check the guards transition and if they became true to do that new state otherwise do the one they are currently doing as shown by the image below.

Rats
The rats are using steering behaviours to calculate where they are going to go. They will head in the average direction of the other nearby rats while avoiding obstacles. If they get near to a villager or guard then they would affect their health.
Player Thief
The thief is controlled by the player. To move the thief around all that the player needs to do is click to where they want the thief to go and then it will calculate a path to take using the A* pathfinding. When the thief gets close to a villager, the thief will steal some gold from that villager.
Path Finding
Also created my own A* pathfinding that all the different AI agents would use to navigate around the scene. Used throttling to help optimise the calculations so only one path would be calculated in one frame and not have twenty happen which could hit performance. Breth depth search??