Developed an AI framework to be used for a stealth-based game by Worldgame Entertainment Ltd, a company based out in the UK. It has functionality for guards to travel along predetermined paths, random paths, and stay stationary at a position. The guards themselves patrol an area, investigate suspicious activity, and become alert if they spot the player. You can take a look at the end result below:
So I feel there is still a lot of improvement that could be done for this. I had to complete this in two weeks time, figuring out how to make the AI meet the desired requirements specified by Worldgame Entertaimment Ltd. The AI was not too hard to grasp how it could be created, although it gave a bunch of headaches along the way since I couldn’t do it using separate behavior trees to control the behavior of guards depending on what state they are in – i.e. Normal, Suspicious, or Alert. I ended up using just one behavior tree to control the entire behavior of the character for transitioning from each state since I encountered too many problems with trying to use multiple behavior trees. So in case you want to see what the behavior tree looks like altogether, well here it is:
As you can see, it looks really messy having all these trees together in a single file, so that is why I tried to have separate behavior trees for each state.
In terms of improvements, there is still some buggy behavior I have noticed that happens occasionally; the animations for transitioning from shooting to walking with the pistol do not occur properly sometimes when the guard runs too far from their guard position. I am not able to reproduce the behavior consistently when playtesting it, so I am at loss for how to fix that for now. In the future, I probably might add a centralized AI system that all the guards use to get information from; this would be useful for features such as having all the AI guards nearby the player to become alert if one of the guards have sighted them. Additionally, it would be nice to figure out how to make it so that guards do not always run in a straight line to the player, but instead utilize strafing – like how guards would actually strafe around a corner with their gun if they just spotted something suspicious.