Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Artificial Intelligence for a Personalized Difficulty

in Video Games
Joan Patricio Salas Rondón
Computer Science
Universidad Católica San Pablo
Email: joan.salas@ucsp.edu.pe

Abstract—This paper explores the intersection between Ar- general terms. It will focus on particular ways and algorithms
tificial Intelligence (AI) and video games, with its main focus that many authors and developers have developed to create a
being the development of algorithms that are able to adapt sense of dynamic difficulty.
to the player’s needs and proficiency. It researches proposals
made with the goal of enhancing enjoyment and especially II. R ELATED W ORKS
avoiding frustration and boredom when playing a video game.
The document begins with an overview and summary of the A. Challenges in the implementation of AI
relationship between video games and AI development over the Perez-Liebana and his team [2] pose the difficulty of an
years. It emphasizes the need for a adaptable difficulty setting to AI that is capable of playing and showing competitiveness
cater to individual player needs. The survey then explores various
algorithms that have been developed and proposed to create a in any video game regardless of the genre and without
sense of dynamic difficulty. It lists proposals such as Dynamic prior knowledge about it. The paper introduces and describes
Scripting and Evolutionary Learning Algorithms explaining the the General Video Game AI (GVGAI) framework which is
upsides and downsides of each proposals while also listing exam- used by different AI development competitions. The GVGAI
ples where these techniques have been effectively implemented. provides and interface for AI creation where the agent has
The document concludes by emphasizing the importance of AI
in improving quality and entertainment value of video games. to emit responses in less than 40 milliseconds. Since the
characteristics of the game are not provided to the agent, it
Index Terms—Artificial intelligence, Video Games, Dynamic has to ”discover” the game mechanics during execution. Some
Difficulty, Enjoyment, Frustration, Proficiency, Quality and En- challenges the paper describes are the implementation of the
tertainment, Algorithms AI in multiplayer video games such as cooperation between
two different AIs and the possibility of creating the AI with
I. I NTRODUCTION
procedurally generated levels.
The quality of video games is often marked by the entertain- Perez-Liebana notes that General Video Game AI can be
ment they give to the public [1]. A video game can not be too seen as an approximation of General Artificial Intelligence, as
easy since players will not have a sense of satisfaction when it requires algorithms that can adapt to new and unfamiliar
beating the game. Furthermore, it must not be too difficult environments without relying on game-specific heuristics. He
because the user will be less entertained and more frustrated describes the competition as a way to encourage researchers
when playing. This is where artificial intelligence and dynamic to develop more general and robust game-playing algorithms,
difficulty come into place to help the developers and players and notes that the competition has received multiple entries
develop a fair and comfortable way of experiencing the video with very different approaches. No one particular algorithm
game. dominates the rest, and it seems that selecting one or another
Video games and AI are two topics that are very closely algorithm in sequence (as a sort of Hyper-Heuristic) improves
related since the invention of the first game. The use of the results obtained.
AI for the development of enemies and world generation Perez-Liebana also discusses some of the key challenges in
has expanded over the years, and these AIs have also been developing General Video Game AI, such as dealing with un-
enhanced. For example, it is not accurate to say that the AI certainty and incomplete information, handling diverse game
of 1993’s DOOM is similar to the one of 2016’s DOOM even mechanics and objectives, and scaling up to larger and more
though they are the same game conceptually because it is complex games. He describes some of the techniques that have
simply not true. been used to address these challenges, such as Monte Carlo
However, often these AIs are static and do not accommodate Tree Search, Evolutionary Algorithms, Neural Networks, and
to the preferred difficulty of the player. This survey aims to Reinforcement Learning.
research and list ways of adaptation to the proficiency of the Finally, the authors outline some potential applications of
player and thus not harming their enjoyment of the video game General Video Game AI beyond gaming. They suggest that
nor their opinion about it. this technology could be used for testing and evaluating other
The document will do a brief explanation of the develop- AI systems in a more diverse range of environments than
ment of artificial intelligence as well as video games, both in is currently possible. It could also be used for educational
purposes or for developing more general-purpose robots or au- effectively. This is why it is crucial to define the problem that
tonomous agents. Overall, the conclusion of this investigation the AI has to overcome and its limitations.
is that General Video Game AI presents exciting opportunities The EA also involves creating a population of sample
for advancing both game AI research and artificial intelligence strategies that are then played against a normal AI to measure
more broadly. the success, each part of the population is a chromosome and
each chromosome has a fitness score according to the fitness
B. Dynamic Scripting function. Afterwards, by simulating natural selection, only the
Spronck [3] introduces a revolutionary algorithm for the solutions with high fitness scores are allowed to ”breed” to
development of AIs, this algorithm called Dynamic Scripting create a child chromosome with similar rules but different
focuses on finding the most effective strategy that the AI strategies.
with help of different factors such as the win rate or the net
effectiveness based on statistics of the match. Some problems D. Player Profiling
that this implementation has is that the AI can be easily Chang Yun [6] introduces the Profile-Based Adaptive Dif-
manipulated since the data the AI uses to decide whether to ficulty System (PADS) and explores its impact on enhancing
take one action or another is provided by the player. gaming experiences. The PADS system focuses on automati-
In this study, the experiments conducted involved adaptive cally adjust game difficulty levels based on a profile created for
agents generated by the algorithm playing in opposition to the player taking into account their skill level and proficiency.
a collection of strategies designed manually in a simulated By utilizing these player profiles, the PADS system adapts the
video-game environment. After experimenting, the results game’s difficulty to cater to individual preferences.
showed that dynamic scripting was capable of outshine the The PADS system categorizes players based on their gaming
manually designed tactics in terms of performance and dif- expertise and goals. The amount of influence that the system
ficulty. This paired with the fact that ways of scaling the uses is adapted according to the player’s profile at each update.
difficulty level to that of a human player depending on their The paper mentions that the sample game genre used in
proficiency are being researched make dynamic scripting a the study is a third-person shooter, but it emphasizes that
very innovative technique. the profile characteristics would vary for every game due to
The authors also discuss how dynamic scripting can gener- different rules, goals, and character sets. This highlights the
ate diverse and unpredictable behaviors in game AI, making flexibility and adaptability of the PADS system to different
gameplay more engaging and challenging for players. They game genres.
highlight its applications in various types of games such as The experimental results presented in the paper focus on
RPGs, Real Time Strategy (RTS) games, First Person Shooter three expert participants with more than five years of gaming
(FPS) games, and sports simulations. Dynamic scripting can experience. Each participant had different preferences, and
be used to generate quests or side missions that adapt based the PADS system successfully catered to their needs. For
on player choices and actions, create more intelligent and example, participant P06 sought a more balanced experience,
unpredictable enemies that require players to think on their so the system ranked them in not very difficult nor easy
feet, or generate opponents with unique playing styles and levels of difficulty. Whereas Participant P09 thrived for a more
strategies. demanding level, and thus the PADS system chose to stay at
The authors note that while dynamic scripting has shown the highest difficulty level for most of the playing time.
promising results in improving game AI’s adaptive perfor-
mance, there is still room for improvement. E. Dynamic Difficulty Adjustment
Ponsen [4] uses the concept of dynamic scripting and In Hunicke’s work [7], designing a dynamic AI has its
applies to RTS video game WARGUS against opponents that focus on the ”environment” of the game rather than the player,
each use different tactics. The research showed that the use this means that the algorithm mostly changes things such as
of Dynamic Scripting along with the methodologies proposed world generation or quantity of enemies instead of adapting
by Ponsen generated a strong domain knowledge that can be the behavior of the AI. The goal of this is to adjust the game’s
used to develop high level AIs. overall level of challenge for a group of players with similar
skills.
C. Evolutionary Learning Algorithms Hunicke describes the probabilistic method used in his
In order to simulate the survival of the fitness and evolution, proposal. The method starts by representing the current state of
Ponsen [5] shows an alternative to dynamic scripting than can the game as a set of random variables, each of which represents
come up with out-of-the-box strategies in order to make the a different aspect of the game ranging from level to quantity of
game more interesting and different in each playthrough. We enemies. By updating these variables after each failed attempt
need to give the evolutionary algorithm (EA) the basis of the by the player, the system can adjust the game’s overall level
video game, the rules that the AI has to follow and give them of challenge.
maximum freedom in decision making. The probabilistic method used in this system is compu-
EA uses chromosomes with rules for solving a problem and tationally efficient, it still requires a significant amount of
a fitness function which is essential for the algorithm to work processing power. It is argued that this can be addressed by
using parallel processing techniques, such as those used in the level of difficulty to keep players engaged without causing
modern graphics cards. burnout or frustration.
While the system was designed with single-player games in In [9], researchers gathered information from 20 different
mind, it could also be applied to multiplayer games. An exam- people playing videogames to determine the levels of bore-
ple of this is shown in Silva’s proposal [8] where it is applied dom, engagement and anxiety. They suggested that difficulty
to the game DOTA 2, the paper showed that the algorithm is is a very important factor when it comes to the boredom of
effective and minimizes the frustration of everyone involved. the players because even while having three different difficulty
It makes the game challenging and the setback of it being a options, the players always ended up raising their levels of
multiplayer game is addressed by reducing the skill gap of the boredom with the video game due to the nature of the static
players so both novice and experienced players have fun while AI that the game used. Paula Silva and her team concluded
playing. that a difficulty level that can vary and accommodate to the
players is much better as it gives room for different positive
III. TAXONOMY emotions to emerge in the player.
The work of Chanel [9] shows that playing at different levels
gives rise to different states of joy while also demonstrating
that playing with the same level of difficulty several times
elicits boredom, the opposite of what a game tries to achieve.
The objective of this investigation is to recompile different
proposals on how to solve a crucial problem in video game
development, which is trying to appeal to any public. During
the investigation, some techniques that have been developed
to cater this problem were found although most of them
highlighted a distinctive difficulty in their application.
This survey is trying to appeal to the opinion of the public,
especially video game players as well as experts in the topic
of AI and list some possible solutions that various developers,
game designers and scientists have proposed to tackle the
problem. Obviously each one of them has its adavantages
and disadvantages so in order to describe them better, three
As a result, the obstacle that can be clearly seen is the
taxonomical classes have been created to group the proposals
necessity of an upgraded adaptable difficulty in video games
with similar characteristics.
and that this difficulty does not become stale to the user after
With this in mind, we end up with the following taxonom-
a long period of playing
ical classes:
B. Proposals with variable previous rules
Class Papers
Definition of the problem [1], [9] In this section the proposals with variable rules found will
Proposals with variable previous rules [3], [4], [10], [6] be described with the help of pictures. The concept of variable
Proposals with fixed previous rules [2], [5], [7], [8] rules in this taxonomy refers to the proposals’ willingness to
use and adapt to player input, in other terms, using information
Fig. 1. Taxonomy Classes
that the player gives on its own to start or continue the
algorithms. These ”variables” can range from specific things
such as the number of units created in a Real Time Strategy
A. Definition of the problem (RTS) Video Game to more generic data like the win rate of
This section emphasizes solely on the objective of the the player against the AI.
survey and the general direction that the different papers For example, Dynamic Scripting uses a set of rulebases that
referenced were aiming to solve which is searching for the define the behaviour of the AI during the match to start the
best quality and enjoyment that a person can experience while algorithm and includes a weight system to determine the agent
playing a video-game. that will be used during the match based on its effectiveness.
The work of Carlo Fabricatore [1], among other factors, The reason as to why the proposal by Spronck [3] is in this
elaborates on difficulty in video games as an important factor class is beacause the script and behaviour of the AI can be
that affects how a game is perceived by the player. It suggests manipulated willingly or not by the user.
that one of the players’ main objective is to seek challenge, If a player consistently uses a particular strategy that
mastery, and reward, and that difficulty can provide all three is effective against a certain type of agent behavior, then
of these factors. However, the paper also notes that too much dynamic scripting may adapt its rulebase to counteract that
difficulty can lead to frustration and disengagement. Therefore, strategy. Additionally, some versions of dynamic scripting
game designers and developers must find a way to balance include an enhancement that allows scaling of the difficulty
Personalized
Difficulty
in Video Games

Definition of the problem Proposals with variable rules Proposals with fixed rules

[1] [9] Fitness Function Player Profiles Hamlet System Learning Frameworks

[3] [4] [10] [6] [7] [8] [5] [2]

Fig. 2. Taxonomy tree

Fig. 4. Weight Adjustment Formula

the highest reward the higher the fitness value is. But in order
to elicit more mediocre or less optimal behavior of the AI the
following formula may be used.

Fig. 3. Dynamic Scripting

level of the game AI to match the skill level of the human


player. This means that as a player becomes more skilled
at the game, dynamic scripting can adjust its rulebase Fig. 5. Fitness function equation
to provide a greater challenge. Another example in this
taxonomy is the profiles of the players in [6], where each Where p is the reward value set by the developer. The
user will have a different profile since every person has higher p is set, the more effective the opponent AI and
different preferences and objectives when playing a video behaviour will be. These allow the algorithm to be very
game. The AI will use these previous variables to find customizable but locking the configuration during the
the most acceptable difficulty for the player so that their execution.
enjoyment is not harmed and their boredom does not increase.
2) Player Profiles: The player profiles are previous infor-
1) Fitness Function: In order to understand the fitness mation collected through surveys and questionnaires and is
function, we must know why it is important and where it is used by the PADS to determine the player’s preferred level of
used during the algorithm. The rules that the AI will follow difficulty.
depend on a weight value which is bounded by a minimum Based on these profiles, the PADS system adapts the
and maximum. Then the new ruleset of the AI will be defined amount of influence it exerts on the game’s difficulty at
by the current weight plus the weight adjustment. each update interval. This means that the system takes into
Where F is the fitness, b is the break-even value and both account the player’s profile characteristics and adjusts the
Rmax and Rmin are the maximum and minimum reward game difficulty accordingly. The system categorizes players
respectively. based on their profiles and tailors the game difficulty to suit
The fitness value is used to decide whether to give rewards their preferences.
or not, by default the fitness value is configured to always give
Another example is shown in the Dynamic Difficulty
Adjustment(DDA) proposal [7], where the AI gets information
and makes decisions using the context of the player, items
such as the map, the player’s current location, etc. When
a player has reached a level where they keep dying or are
having trouble beating it, the DDA kicks in to change the
settings of the video game depending on the player.

1) Hamlet System: The Hamlet system is a dynamic dif-


ficulty adjustment (DDA) proposed by Hunicke [7] system
designed to alter difficulty of the current level using individual
player input as a base to make the changes. The Hamlet
System was constructed using Half Life’s game engine Gold-
Src and uses techniques drawn from Inventory Theory and
Operations Research to analyze and modify the ”inventory”
of the game, this includes enemies, items and statistics of
the player such as health with the objective to have a better
Fig. 6. PADS System Flowchart control of the difficulty and the overall experience. The system
is designed to keep the player engaged and interested in the
game, which is especially difficult in interactive contexts.
3) Strengths: The adjustment in the Hamlet system refers to the process
• More complex and precise system to define the difficulty. of altering the game’s different variables of the level based
• The use of variable rules allows the AI to work in most on the player’s behavior. The system measures the incoming
video games without problems. game data and player input and it also tries to anticipate the
• The player receives a sense of control over the video future state of the player. When an undesirable but avoidable
game which in turn improves the overall enjoyment. state is predicted, the system makes adjustments to the
• It gives less room for ineffective strategies to develop settings as necessary. The adjustment actions can be reactive,
because player input will force the AI to upgrade and which adjust elements that are ”in play” or ”on stage,” or
counteract it. proactive, which adjust ”off stage” elements that have yet to
4) Weaknesses: appear on screen such as the quantity of enemies spawning
• Easily manipulable by the player input thus becoming or their health.
exploitable.
• The user might find the development of the AIs boring 2) Learning Frameworks: The GVGAI framework is a
since it will always end up creating an effective strategy tool for developing artificial intelligence algorithms that can
against the player. With fewer characteristics changing. work on a varied range of video-games without knowledge
• Expensive due to the nature of having variable rules, the of previous rules. Unlike other game AI frameworks, this one
algorithms have to receive and manipulate the input to provides game state information in an object-oriented manner
create a new behavior. and employs a Video Game Description Language (VGDL)
to set the overall rules and limits of video-games. VGDL
C. Proposals with fixed previous rules defines the available enemies and non-playable characters,
In this section the proposals with determined rules found each with their own general interactions that can happen
will be described with the help of pictures. Unlike variable during the simulation of the video-game, and the dynamics
rules, the term ”determined” refers to a static way of setting of each component are programmed in the framework. This
the behaviour for the AI. The player doesn’t have as much allows for a wide range of games to be created and tested
manipulation or control in these settings as they do in section within the same framework.
B. One of the key techniques used in GVGAI is the forward
These rules are based more on statistical facts and con- model, which allows users to simulate states of a video-
figuration that the developers have used when implementing game and continue onto different possible future states. This
the algorithm. In the Evolutionary Learning Algorithms [5], tool is essential for players and developers alike to reason
the chromosomes begin with a set of decisions to take and about the environment and discover the game mechanics in
actions to make in which, each generation, only the ones that their first time being exposed to the game. Additionally, the
demonstrate that are good at solving the problem proposed GVGAI competition provides a benchmark for testing different
by the fitness function are allowed to reproduce. The fitness approaches to game AI. The developers are given at least two
function may or may not share the same objectives as the different sets of games to train their AI, and a server is set up
player but it doesn’t mean that he or she can alter it in any to receive submissions and run the controllers on a different
way. group of games that no competitor had access to. The final
rankings are then calculated from the execution of every AI in [4] M. J. Ponsen, H. Muñoz-Avila, P. Spronck, and D. W. Aha, “Au-
a third batch of games, much like a competitive programming tomatically acquiring domain knowledge for adaptive game ai using
evolutionary learning,” in Proceedings of the national conference on
contest. artificial intelligence, vol. 20, no. 3. Menlo Park, CA; Cambridge,
3) Strengths: MA; London; AAAI Press; MIT Press; 1999, 2005, p. 1535.
[5] M. Ponsen and P. Spronck, “Improving adaptive game ai with evolu-
• More complex and precise system to define the difficulty. tionary learning,” Ph.D. dissertation, Masters Thesis, Delft University
• The use of variable rules allows the AI to work in most of Technology, 2004.
video games without problems. [6] C. Yun, P. Trevino, W. Holtkamp, and Z. Deng, “Pads: enhancing
gaming experience using profile-based adaptive difficulty system,” in
• The player receives a sense of control over the video Proceedings of the 5th ACM SIGGRAPH Symposium on Video Games,
game which in turn improves the overall enjoyment. 2010, pp. 31–36.
• It gives less room for ineffective strategies to develop [7] R. Hunicke, “The case for dynamic difficulty adjustment in games,”
in Proceedings of the 2005 ACM SIGCHI International Conference on
because player input will force the AI to upgrade and Advances in computer entertainment technology, 2005, pp. 429–433.
counteract it. [8] M. P. Silva, V. do Nascimento Silva, and L. Chaimowicz, “Dynamic
difficulty adjustment through an adaptive ai,” in 2015 14th Brazilian
4) Weaknesses: symposium on computer games and digital entertainment (SBGames).
• Easily manipulable by the player input thus becoming IEEE, 2015, pp. 173–182.
[9] G. Chanel, C. Rebetez, M. Bétrancourt, and T. Pun, “Boredom, engage-
exploitable. ment and anxiety as indicators for adaptation to difficulty in games,” in
• The user might find the development of the AIs boring Proceedings of the 12th international conference on Entertainment and
since it will always end up creating an effective strategy media in the ubiquitous era, 2008, pp. 13–17.
[10] P. Spronck, I. Sprinkhuizen-Kuyper, and E. Postma, “Difficulty scaling
against the player. With fewer characteristics changing. of game ai,” in Proceedings of the 5th International Conference on
• Expensive due to the nature of having variable rules, the Intelligent Games and Simulation (GAME-on 2004), 2004, pp. 33–37.
algorithms have to receive and manipulate the input to
create a new behavior.

IV. C ONCLUSIONS
AI plays a crucial role when trying to enhance the entertain-
ment and quality value of video games, this paired with the
search for a personalized difficulty and experience in video
games has inspired many researchers to develop newer and
optimized techniques. These proposals have had both the best
interests of the player and the innovation of said AI in video
games in mind. The main objective of this paper is to try to
find the right balance between enjoyment and hassle during a
session of playing video games.
Each proposal discussed presented upsides and downsides,
with the main public objective being a vastly different compo-
sition of individuals, choosing the best approach comes down
to a matter of preference. What has been observed is that
each proposal managed to do its purpose of giving a solution
to the problem discussed before. Every approach enables the
user to customize a video game to their liking by providing
challenges, mastery and rewards without causing frustration or
boredom in the process.
We can conclude that through the use of AI and distinct
revolutionary techniques video games are able to offer a
more immersive and enjoyable experience for players of all
backgrounds and skill levels therefore opening the video game
market for anyone.

R EFERENCES
[1] C. Fabricatore, “Gameplay and game mechanics: a key to quality in
videogames,” 2007.
[2] D. Perez-Liebana, S. Samothrakis, J. Togelius, T. Schaul, and S. Lucas,
“General video game ai: Competition, challenges and opportunities,” in
Proceedings of the AAAI Conference on Artificial Intelligence, vol. 30,
no. 1, 2016.
[3] P. Spronck, M. Ponsen, I. Sprinkhuizen-Kuyper, and E. Postma, “Adap-
tive game ai with dynamic scripting,” Machine Learning, vol. 63, pp.
217–248, 2006.

You might also like