Redesigning the Behaviour Tree and Blackboard Implementation

My original Behaviour Tree (BT) was not executing correctly with the agents getting stuck within certain states, or unexpectantly skipping over behaviours altogether. This was not ideal, so I set up a meeting with Chris Janes to discuss the issues I was having. After stepping through the code, Chris pointed out that the tree was not resetting the child lists and some other issues.

Due to these problems I elected to redesign how the BT is implemented making sure that everything is reset when a node begins and terminates. With the redesign of the BT I was able to spot some design flaws in how the tree was executing the child nodes and priorities of some of the behaviours were incorrect. To rectify this issue, I created a generic conditional check node that can check the states that the guards are currently in and ensure that the flow of control is sent down the correct branch of the tree for the current situation. For example, if a guard is patrolling but the player has been spotted, then the guards will break out of the patrol behaviour and start making their way over to the player’s last known position.

With the addition of the conditional node that checks the guards states I was also able to create a node that can adjust the speed of the agent depending of which branch the guard is currently in. This helps keep the AI believable as while alerted or investigating they move around much quicker than if they’re just patrolling their area in a repetitive manner, they could lose focus and concentration.

With the layout of the original BT I was having issues with my guards while communicating with each other as highlighted in a previous blog, once the “conversation” was over one guard would continue their patrol, while the other guard stood on the spot for anywhere between 10-20 seconds. With the new BT this is no longer an issue as the guard’s states are changed according to what is happening within the game world, rather than just their own current knowledge. So once the conversation is finished, both guards will continue their patrol route.


Conversations can also be interrupted now, if the player is spotted guards will drop what they are doing and enter an alerted state.  While guards conversations can be interrupted if the player is spotted, as I wrote in an earlier blog talks about a GDC talk (Walsh, 2018) on Splinter Cell: Blacklist and how the conversations work between the NPCs and how they can be interrupted and restarted and how once the guards begin a conversation they begin a group behaviour and react to game events together.  I will not be able to implement this within the scope of my project.  I am happy with how the BT works in its current state although there are still times where nodes do not fire instantly the majority of the time the BT flows in the correct direction.

Reference List
[1] Walsh, M. (2018). Modeling AI Perception and Awareness in Splinter Cell: Blacklist. [online] YouTube. Available at: https://www.youtube.com/watch?v=RFWrKHM0vAg [Accessed 4 Mar. 2019].