Home
Projects
C#
Unity
GitHub
For my dissertation I wanted to explore machine learning and how it could be used in a live game environment & what potential it could have to give a player new and more dynamic experiences.
For this project I created an arena based First Person Shooter game. The player had three different weapons: an assault rifle, a shotgun and a sniper rifle. These three weapons provided player’s with a basic variety in options for how they would want to play the game. As the player played the game a system was in place to record a number of statistics about the weapons they were using. Variables such as number of shots with a weapon, amount of damage, number of headshots and so forth were recorded as the player ran around the map fighting the AI opponents.
The machine learning model used in my dissertation used the variables recorded during gameplay to create a model to predict a player’s particular playstyle. These were differentiated into close range, medium range & long range. The playstyle would primarily be decided by what weapon the player used but by using these categories rather than just the weapon the model had flexibility should the player decide to use weapons differently then their intended use (for example if a player were to only use the sniper rifle as a close range weapon).
During gameplay the model would predict the players preferred playstyle. Based on the result the behavior of the enemy AI would change. For my dissertation I decided to have the enemies change in a way which would be beneficial for the player. For example if the player was predicted to have a close range playstyle the enemies would try to get much closer to the player before they would start to shoot, which would allow the player to aim at enemies much more easily.
The enemy AI used a state machine with different behavior such as “run to player”, “shoot at player” & “run away”. Using variables such as “distance to player” & “current health points” the enemy AI changes between the different states. Based on the result of the machine learning model as well the threshold for the changes between states changes. For example if the player is a close ranged player the enemy AI will wait for the “distance to player” variable to be lower before swapping to the “shoot at player” state.