Player Modelling Companion AI
This page contains all of the major functionality in the AI I developed for my dissertation
CONCEPT
This was inspired by the first developer conference I attended at Rezzed a few years ago, where Guild Wars developers talked about the techniques they used to build up the relationship between the player and a companion ally. One of the things that stuck out to me was that they decided to not allow the player to command their ally because it made them feel like a pet and ruined their agency.
​
I decided to focus my dissertation on this, and developed an AI that could collaborate with the player, but could not be explicitly commanded. I decided to use a player modelling approach, which allows the AI to analyse the actions a player takes and choose actions that synergize with those actions.



I found that the player modelling technique is used mostly in strategy-focused games, so in this project, I applied it to a real-time action game.
​
This technique allows the companion to analyse the player's actions, and create a model that describes their play style. Then, the companion can use this information in its decision-making algorithm.
​
In this project, I used a behaviour tree, which changes states depending on the playstyle.
Player Modelling Technique
Behaviours
I wanted to keep the behaviours generic such that this AI could be used as a template for other action games. As such, the AI presented in my dissertation has behaviours that mostly focus on positioning as opposed to special abilities like healing the player.
​
The companion tends to use more supportive actions when the player is performing well; they are being aggressive or are successfully countering their enemies' attacks. As the player starts to be more defensive, or is struggling, the companion will intervene in a more obvious way. Most of the actions are designed in a way to try to get the player to be more aggressive.
Aggressive
When the player is being aggressive, the companion will leave them to keep playing as they are and not intervene. In this state, they will focus on enemies the player is not targeting.
Countering
When the player only attacks after parrying or dodging an attack, the companion will attempt to attack the player's target to give them more openings to go on the offensive
Defensive
When the player is performing lots of parries, but are not countering, the companion will rush towards the player and attack nearby enemies to give them some breathing room.
Mobile
When the player is dodging and moving around a lot, the companion will try to draw enemies away from the player so that they can focus on a smaller number of enemies and start being more aggressive
Panicking
The most extreme state is entered when the player is missing lots of attacks, parrying or dodging when no enemies are attacking or they are getting hit by enemies. In this state, the companion will forcefully interject themselves between the player and nearby enemies, acting as a shield for the player so they can reposition and regain their composure.