<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A proposal for combining reinforcement learning and behavior trees for regression testing over gameplay metrics</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>PadaOne Games</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Calle Profesor Jose Garcia Santesmases</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Madrid</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Spain pablo.gutierrez@padaonegames.com</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Complutense University of Madrid</institution>
          ,
          <addr-line>Madrid</addr-line>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <fpage>116</fpage>
      <lpage>127</lpage>
      <abstract>
        <p>In this paper, we propose a methodology based on reinforcement learning to automate video game testing. In particular, we discuss how the use of game playing agents with hybrid policies that incorporate reinforcement learning nodes alongside manually implemented ows in the context of behavior trees could lead to potentially more generalizable, understandable, and easier to ne-tune testing agents than those implemented via pure reinforcement learning techniques. In addition, we explore di erent strategies and con gurations for training these agents, and describe a simple procedure for detecting signi cant modi cations in selected gameplay metrics of a game level after introducing design changes. This is intended as a road map for future work in the development of automatic game testing and balancing tools.</p>
      </abstract>
      <kwd-group>
        <kwd>Automated game testing</kwd>
        <kwd>Reinforcement learning (RL)</kwd>
        <kwd>Behavior trees (BTs)</kwd>
        <kwd>Game balance</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Quality control in modern video games can be a major challenge. Nowadays
it is not only necessary to keep a strict and continuous control of technical
failures or bugs that may arise during the development process, but also of
new problems in the playability derived from small changes in gameplay code
and parameters that are used in di erent parts of the game. These changes can
bring about various adverse e ects such as preventing players from being able
to complete previously solvable sections, altering the navigability of menus and
environments, or modifying the di culty perceived by the user, in dissonance
with the experience originally conceived by the designers.</p>
      <p>Quality assurance (QA) tasks usually involve an immense testing e ort in
which developers and players strive to detect and solve these problems. In light
of this situation, in the last few years several research works have emerged with
Copyright © 2021 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
the aim of proposing strategies to improve the QA process in video games and
reduce its cost. Many of these methods are aimed primarily at developing agents
(usually by using deep reinforcement learning, DRL) that act as synthetic players
capable of automating checks that may otherwise require numerous hours of
manual testing, in an attempt to redirect the e orts of human testers towards
less mechanical and more creative tasks.</p>
      <p>The methodology described in this paper can be applied to the design of
automatic regression tests for detecting issues when modi cations are made to
level layouts, design parameters, or AIs that are reused in multiple sections of
the game. The former may be performed during iterations of a speci c level's
design process, whereas the latter may be included when ne-tuning the behavior
of a NPC in a level without thinking about the implications of those small
variations on other levels where the NPC was placed before. Changes as simple
as slightly modifying an enemy's movement speed could end up unexpectedly
impacting how the player interacts with the game's levels. These changes need
not be particularly drastic (such as as sudden violations of the completability of
a level), and may boil down to the player taking more or less time to complete a
part of the game, or exploiting a new way to beat a level that was not originally
contemplated. All of these design alterations should not go unnoticed, but many
of them are not usually straightforward to detect in typical testing environments.</p>
      <p>In this paper we propose the application of di erent reinforcement learning
methods to produce testing agents capable of interacting with a set of levels in a
stealth game while collecting interaction statistics representative of the perceived
gameplay in each level. The agents are afterwards used to test whether a change
in the level or AI design induces signi cant changes in gameplay parameters
collected by the agents before applying the modi cation.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>The following subsections introduce preliminary topics used in this work: RL,
BTs, and RL-nodes in BTs.
2.1</p>
      <sec id="sec-2-1">
        <title>Reinforcement Learning</title>
        <p>Reinforcement learning (RL) is a process where an agent learns by trial and error
from experience by interacting with its environment. In an RL problem, a
distinction must be made between the agent, which interacts with its environment
through actions, and the environment itself, which provides feedback and
\rewards", or positive/negative reinforcement to the agent. RL algorithms usually
take the formulation and formalism of Markov decision processes (MDPs) as a
starting point. If we consider st 2 S as the state of the system at a given instant
t, and at 2 Ast the action that the agent executes at that instant, where Ast is a
possibly in nite set of admissible actions for the agent under state st, the agent's
goal will be to learn a mapping between states and actions : S ! A = [s2S As,
that maximizes the expected long-run total reward from each state s:
(1)
where 2 (0; 1) is a discount factor that gives more weight to rewards earned
in the short term, and Ri is the reward the agent receives at the i-th instant.
2.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>Behavior Trees</title>
        <p>
          A Behavior Tree (BT) is a way of structuring policies or controllers in
autonomous agents, such as robots or non-player characters in a video game (NPCs).
In essence, a BT can be de ned as a rooted tree in which the leaves correspond
to execution nodes, associated to a speci c task or condition check of the agent
to be controlled, and the intermediate nodes take on the role of ow control
nodes. BTs were initially conceived in the eld of video game programming,
with the rst journal paper on BTs appearing in [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ], and since then their use
was progressively extended to the eld of robotics. These constructs were
originally developed with the motivation of promoting the production of modular,
reusable, scalable, and easily understandable code when designing the behaviors
of intelligent agents in the video game industry, thus trying to solve the problems
commonly encountered with other classical mechanisms previously used, such as
nite state machines (FSMs) or scripts.
        </p>
        <p>The execution of a behavior tree starts at the root node, which generates
signals or \ticks" with a given frequency. These signals enable the execution
of a node and are propagated from parent to child in the internal hierarchy of
the tree following the speci c logic of each type of control node. A node can be
executed if and only if it receives a tick. A child node can respond with Running
to its parent if it is in the middle of an execution process, Success if it succeeds
in completing its task, and Failure in any other case. Every result will eventually
be propagated back to the root node, resulting in the generation of a new tick.
This generates a cyclic behavior that continuously repeats the execution of the
tree. This cyclic nature is precisely what gives BTs a good responsiveness to
changes in the environment: since the conditions are rechecked at each iteration,
the control ow can be modi ed if the context di ers from that of the last cycle.</p>
        <p>Control nodes represent composite behaviors that succeed or fail
depending on the results returned from one or more of their children (which can be
of any type, control or execution). The most common types of control nodes
are Sequence and Fallback. Sequence nodes are used when a set of actions or
conditions are intended to be executed sequentially, and will only succeed if all
children complete their behaviors successfully. Fallback nodes on the other hand
propagate the tick to their children from left to right until nding one that
returns a Success or Running state, and then return that same state to their
parent, meaning they will only return Failure when all of their children end with
a failing state.
2.3</p>
      </sec>
      <sec id="sec-2-3">
        <title>Reinforcement Learning Nodes in Behavior Trees</title>
        <p>The above two concepts can be combined giving rise to behavior trees containing
nodes supported by reinforcement learning. In general, the current literature
contemplates two main types of RL nodes, depending on whether the learning
is performed on a control or execution node.</p>
        <p>
          { A RL-control node can be viewed as an extension of the usual control node,
usually of type fallback [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ], with the particularity that its children come
to constitute the action space of a reinforcement learning algorithm. Thus,
given a state s, the node reorders its children according to the expected
rewards of executing each of them (being these estimates learned during
training).
{ A RL-execution node contains a RL-learning algorithm with states, actions
and rewards de ned by the designer. The idea here is to employ the
hierarchical structure of a BT to learn relatively small actions that are only
executed under controlled conditions.
        </p>
        <p>In any of the above cases, the main goal of combining behavior trees with
reinforcement learning is the implementation of actions and ows that are
complex to program manually, but in speci c regions of the agent's BT whose limited
scope allows to dampen the so-called \curse of dimensionality" in learning
subproblems. As an example, when designing the behavior of a robotic agent in an
environment, it may be complicated to e ciently orchestrate actions that require
the coordination of a large number of joints, such as \picking up an object". In
this situation, it is possible to train an action node that learns only this task, and
incorporate it into the original tree afterwards, with the problem being reduced
to local learning in a controlled environment, but the behavior itself supported
by the responsive structure of the BT.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Related Work</title>
      <p>
        By testing we refer to the activity undertaken to evaluate the quality of a product
and improve it by identifying its defects and problems [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Video games are
complex software systems that must function correctly on di erent platforms
with a range of con gurations. The video game market is a very competitive one
with buyers expecting increasingly more from them, which makes it unacceptable
to release applications that are not robust or su er from bugs. The robustness
of a video game covers a wide spectrum of criteria, from the correct functioning
of technical aspects such as performance or functional correctness to attributes
such as the aesthetic soundness of the application. The validation of these criteria
is a costly task in which a substantial part of the development e ort of a project
is invested, hence numerous strategies have been proposed in recent years in
an attempt to automate these tasks or reduce their associated workload. One
of the simplest alternatives is the use of game segments recorded manually by
human testers, which are subsequently used to check that the replayed sequences
are still capable of completing the established objective [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. However, when the
structure or the game environment is modi ed, the tests generated by these
methods are no longer valid, and it is necessary to once again resort to human
testers to re-record new sequences for the modi ed scenarios. This continuous
obsolescence naturally leads to the proposal of alternatives that are capable of
adapting dynamically to variations in the game environments, giving rise to the
use of AI-based agents for testing.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], an AI played following the speci cation of a game given by a Petri net,
making use of high-level actions, but required precise modeling of the level logic
as well as manual implementation of the player's actions. DRL and IL techniques
used in [
        <xref ref-type="bibr" rid="ref16 ref2 ref3">16, 2, 3</xref>
        ] show promising results, but most of these e orts are generally
focused on detecting technical errors, or verifying whether an automated agent
succeeds in completing given testing objectives within certain acceptable
margins, with few references to the detection of subtle gameplay modi cations that
may undermine game design plans.
      </p>
      <p>
        Moreover, these methods are not always trivial to implement, often
requiring a potentially daunting process of trial and error in the choice of training
algorithm, reward allocation policy, model features, or the hyperparameters of
the underlying neural networks. Fortunately, over the last few years, libraries
for popular game engines have been appearing that greatly facilitate this
process, with ML-Agents [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] in the Unity 3D engine [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] being possibly one of
the most well-known and actively maintained. Additionally, there has been work
integrating reinforcement learning into hand-scripted control structures such as
Behavior Trees (BTs) with the goal of narrowing learning problems to more
controlled situations [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], thus reducing the time and e ort needed to train agents.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] the use of procedural personas for level playtesting characterized by
di erent utility functions employing a variant of the Monte Carlo Tree Search
(MCTS) is proposed. These enable the modeling of decision-making processes
of players with di erent goals, play styles and personal preferences in simple
scenarios such as the levels in the 2D dungeon crawler used for evaluation.
However, the speci cation of the utility functions to be used is left to the designer,
and the method's suitability for more complex environments requires further
con rmation.
      </p>
      <p>
        Lastly, there exist several works focused on facilitating the task of
designing and adjusting the parameters of videogame contents, both in the eld of
playtesting and in level balancing and design. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] proposes a method to obtain
levels adjusted to a target di culty based on the perception of an AI playing
agent of maps generated by a trial-and-error algorithm. [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] describes a
procedure for creating custom levels for platform games using preference learning
based on surveys administered to players after completing each level, while [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]
introduces a tool oriented to aid in the creation and understanding of procedural
content generators with an emphasis on the analysis of their expressive range.
      </p>
    </sec>
    <sec id="sec-4">
      <title>Methodology</title>
      <p>In this paper we focus on the description of a preliminary automated testing
methodology based on the agents presented in Section 2 for a speci c game
environment that will be covered in detail in Section 5.</p>
      <p>This methodology starts from a speci c level of our game, which we consider
nished from a design and/or development point of view. For this level, we wish
to monitor certain gameplay parameters in order to detect any relevant changes
induced by a modi cation on the enemy AI or the level design as soon as possible,
for instance by tuning its parameters to meet the requirements of a later level.
To carry out this tracking, we wish to train a set of \automatic players" using
the techniques already described (RL, hybrid BTs) so that they learn to play the
game \like humans". This learning process is conceived as a general procedure,
which tries to generate agents capable of playing any kind of level, in such a
way that the result may be reused for testing not only existing levels, but also
new environments. This generality is, however, potentially challenging to achieve
depending on the context, so the strategies proposed in this paper will need to
be adequately validated in future experimental work.</p>
      <p>Once agents with a su ciently acceptable general ability have been obtained
(where the concept of acceptability here takes on an admittedly subjective
meaning), one can proceed to the generation of benchmark statistics on the
parameters of interest at chosen stages after having agents playing at each level a large
number of times. Once we have these references, it is possible to automatically
perform a new round of gameplay and statistics compilation on the levels
already developed to evaluate the possible impacts of the day's changes on their
playability. With these statistics, we can verify if our agents are completing the
levels with results equivalent to those recorded on the previous day. If this is
statistically not the case, chances are that something has occurred, and we can
issue a warning so that a member of the team can investigate the origin of this
\alarm".
5</p>
    </sec>
    <sec id="sec-5">
      <title>Practical Approach and Experiments</title>
      <p>In this section, we will focus on concretizing the methodology described above
to the proposal of automated tests for a simple demo game that includes some
of the most common mechanics found in genres such as stealth games, in which
the player navigates through levels patrolled by enemies that must be avoided
while actively trying to attain a certain goal (often reaching a given point in
the level). The rules of the designed game can be summarized in the following
points:
1. The player is represented by a blue circular gure, with a continuous action
space given by At = f(x; z); x; z 2 [ 1; 1]g, which determines the possible
movement directions at each instant. The player has a xed maximum
velocity vp, such that the velocity at each instant is given by vtp = vp jj((xxtt;;yytt))jj .
(a) Enemy Avoidance level (b) Enemy Timing level
(c) Hiding Areas level
2. The player starts each level placed on a yellow platform, to which he/she
returns after being defeated by an enemy. The victory condition is to reach
the green platform located at a xed point in the level. A player is defeated
when his/her health points (HP) are reduced to 0, these being lowered by 1
each time the player is hit by an enemy bullet and starting at 10 HP initially.</p>
      <p>Some sample levels can be found in Fig. 1.
3. The enemies are shaped like red cubes and have an associated \patrol" path
(white lines in the gures), which they cycle through until they detect the
player in their range of vision, after which they proceed to chase and shoot
at their target as long as it is alive or remains within detection range.
4. Some levels contain yellow walls that block the enemies' range of vision, but
have no e ect on the player's movement or visibility (e ectively creating
hiding areas). Fig. 1c contains an example of this mechanic.</p>
      <p>
        This demo game was developed in the Unity 3D engine, with the BTs of the
enemies implemented using the Behavior Bricks plugin for the engine [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. In the
following subsections we describe the two training methodologies to be employed
on the previously introduced demo game: rst a method based on agents trained
purely by reinforcement learning, and then a variant employing RL-execution
nodes on hybrid behavior trees in an attempt to simplify the problem and provide
a di erent family of policies.
5.1
      </p>
      <sec id="sec-5-1">
        <title>Pure Reinforcement Learning Agents</title>
        <p>We have already de ned the action space A of our agent, but we still need to
specify on the basis of what information these actions should be taken. A rst
approach could consider the following features:
{ Target location (2 features). Components (x; z) of the distance vector
between the player and the target platform, scaled to lay in the [ 1; 1] range.
{ Relative location of the enemies (4 features per enemy). Components
(x; z) of the distance vector between the player and each of the enemies in the
level as well as the components (x; z) of the normal unit vector of the enemy's
front face. The latter data provides information about the orientation of the
enemy at any given time.</p>
        <p>
          In addition to these features, we may also incorporate a series of spatial
sensors or raycasts (for instance 12 sensors) that allow us to identify objects close to
the agent in radial directions. Here we consider the objects \goal", \enemy" and
\wall". The number of features derived from the incorporation of these sensors
can be calculated as (number of rays + 1) (number of detectable labels + 2) =
(12 + 1) (3 + 2) = 65 spatial features. This expression corresponds to a one-hot
encoding of sensors and tags, where the +2 term in the number of detectable
tags represents the cases where a ray detects an object with an unconsidered
tag or nothing at all. It is interesting to note here that the length of the
characteristics linked to the enemies can vary depending on the level, and this can be
managed through the use of BufferSensors in ML Agents (which make use of
an underlying attention module [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ]).
        </p>
        <p>Another alternative in this situation is to replace or complement the
described observations by grid-based observations, taking advantage of the
essentially two-dimensional nature of the game under consideration. These inputs, as
the name suggests, are based on covering the level space by a grid of cells in which
the presence of objects of the di erent categories to be perceived by the agent is
detected, so that the observation associated with each cell is given by a one-hot
representation of the objects found in it. This type of input is managed in ML
Agents by means of GridSensorComponents, which provide what could be seen
as a condensed and simpli ed version of a purely visual input. The total size of
observations is thus given by GridSize.x GridSize.z number of detectable labels,
and in the case of the levels considered for this game we can take x = z = 20, and
keep the same tags as in the previous setup, but incorporating an additional one
to represent the player. For the resulting agent to be reusable between levels,
however, it is required to keep the dimensions of the grids xed, which could
hinder the general long-term viability of this method.</p>
        <p>
          As for the reward allocation functions to employ, we can translate the ideas
outlined in [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ], replacing the notions of utility functions with speci c reward
functions for each type of agent we wish to produce. For instance, if we wish to
create a bot for the example game with a conservative navigation style in which
the agent tries to reach the goal without being spotted by enemies, we will need
to implement a reward allocation function that penalizes enemy encounters and
motivates e ective use of hiding areas. One possibility for this last example may
be given by the following scheme:
{ Positive rewards: (+2 units) for reaching the goal and nishing the level.
{ Negative rewards: (-2 units) for dying after being hit by an enemy bullet and
nishing the level, (-0.25 units) for being hit by an enemy bullet, and (-0.1
units) every time the agent is detected by an enemy (at the instant it enters
an enemy's vision range).
        </p>
        <p>If, on the other hand, we were to create a bot that gives priority to reaching
the goal in the shortest time possible, regardless of the number of life points at
the end of the level, we could opt for the following con guration:
{ Positive rewards: (+2 units) for reaching the goal and nishing the level.
{ Negative rewards: (-2 units) for dying after being hit by an enemy bullet
and nishing the level, (-0.1 units) for being hit by an enemy bullet, and an
existential negative reward (-0.01 units) for each step taken by the agent.</p>
        <p>This last penalty may be included to encourage agile ows and spur the agent
to nish the episode as soon as possible to avoid too much negative reward.</p>
        <p>
          In this situation, it is of particular importance to ensure that we do not
reach a state of over tting on the levels of the original battery of manually
designed environments, trying in particular to avoid learning speci c movement
paths, or enemy dodging patterns conditioned by the structure of the starting
levels. Justesen et al. [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] try to address this problem by using search-based
procedural content generation (PCG), which can produce new learning levels
to be used during the training loop of RL agents, eliminating to some extent
the e ect of over tting on the produced bots. In our speci c case, it is possible
to use a randomized maze generation method, such as Prim's algorithm [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] to
produce a basic level layout, subsequently eliminating certain random walls and
incorporating enemies, hiding areas, and start and end points for the player.
5.2
        </p>
      </sec>
      <sec id="sec-5-2">
        <title>Hybrid Behavior Tree - Reinforcement Learning Agents</title>
        <p>In addition to agents trained purely by reinforcement learning, we consider a
second class of agents given by a hybrid model between manually programmed
behaviors and ows learned by RL in the context of a behavior tree. The idea
here is to de ne a BT with a selector that alternates between xed base ows
(for instance \navigate to goal") and learned actions within RL nodes that are
triggered upon entering certain states, e.g. when an enemy enters the agent's
range of vision (\evade enemy"). In this way it is possible to set certain easily
implementable actions, within level-agnostic action nodes and let the
reinforcement learning algorithm handle speci c situations, such as evading the enemies,
under controlled conditions.</p>
        <p>The reinforcement learning nodes in this case may consider the same features
for the st states as those already described in the previous subsection, but it is
also possible to opt for more limited subsets of these features, or even include
new observations of novel types, depending on the particular needs of each action
block. On the other hand, reward allocation features can be tailored locally to
each RL node to motivate speci c behaviors, and multiple functions that induce
di erent play styles within the action can also be considered here.</p>
        <p>This structure presents a number of possible expressive and practical
advantages over the pure reinforcement learning based modality. Especially when the
expected behavior of the game-playing agent is su ciently complex, the division
of the general ow into small blocks of localized logic allows on the one hand
to easily incorporate manually programmed sections to take a more rigid
control over certain functional regions, and on the other hand to generate complex
personalities, in the sense that the existence of local reward functions opens the
possibility to create \action libraries" with blocks representing the same task to
solve, but di erent styles to do so de ned by the reward functions speci ed to
train them. Thus, instead of de ning a global personality for an agent, we can
construct BTs that behave in di erent ways depending on the task at hand.
5.3</p>
      </sec>
      <sec id="sec-5-3">
        <title>Testing Process</title>
        <p>Once we have agents that are able to interact with the game in a satisfactory way,
it is possible to proceed to the testing phase. At this stage we will be interested
in extracting a sample of relevant execution parameters for a given number of
attempts of the agent on the considered level. To do this, we may set a high
number of repetitions per agent and level, in each of which we record statistics
regarding, for instance, the HP with which the agent nishes each run and the
number of steps needed to complete the level. These samples can be stored as
references against which to test future changes in the level.</p>
        <p>
          Having selected reference agents for a level and recorded a sample of contrast
statistics, it is possible to perform a series of Student's t-tests (or Welch's t-tests
if we do not assume variance equality) after incorporating any change in the game
in order to check whether any of the statistics considered varies signi cantly (for
the reference agent) after introducing the aforementioned change. To do this,
it is su cient to collect a new execution sample for the agent on the modi ed
level and perform a parameter-by-parameter t-test to assess whether the means
of the reference and test sets are signi cantly di erent from one another after
the change ( = 0:05). In our case, we assume that the variances of the two
groups do not necessarily need to be equal, and therefore we propose the use of
Welch's t-tests [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]. Under this scheme, we can evaluate the impact of a battery
of design changes for each level and agent, from structural modi cations such as
adding or removing walls or hiding areas, to changes in the enemy AI such as
updating its patrol speed, eld of vision, gun ring rate, etc., all of which could
lead to substantial design implications depending on the case. If normality is not
assumed in the data, we can choose a non-parametric test such as Mann-Whitney,
which only requires independence and that the variables to be compared are at
least ordinal, to evaluate if the distributions of the two samples are the same.
6
        </p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Conclusions</title>
      <p>This paper focused on the problem of creating testing agents to detect signi cant
changes in di erent aspects of gameplay on a demo with stealth genre mechanics.
We proposed and described two accessible alternatives to obtain agents
capable of playing di erent levels of the game, the rst one through pure RL, and
the second through hybrid models that combine RL action nodes within
handcoded control structures in the form of BTs, both of them with the possibility
of introducing di erent reward function based play styles. Hybrid models,
however, could potentially be easier to ne-tune and may possess greater expressive
capacity than their pure RL counterparts. In this methodology, after
obtaining satisfactory agents for each training method, a rst simulation step can be
carried out in which the agents play the considered levels repeatedly, recording
relevant statistics regarding their perception of the execution, for instance HP
remaining at the end of the level and time taken to complete it. Subsequently,
after introducing various changes in the behavior of the enemies, the level layouts,
and so on, new simulations can be performed with the agents on all levels to
recollect performance metrics in the modi ed environments. Lastly, the reference
samples may be compared with those of the post-change simulations by
applying a means-contrast test or a non-parametric test on each of the parameters of
interest to detect statistically signi cant changes in level gameplay.</p>
      <p>This work is intended to serve as a road map and basis for future work aimed
at analyzing whether the automated tests performed using this methodology
can assist in locating and explaining changes of interest in the base of evaluated
levels. Under the assumption that this is the case, if the tests after modi cation
fail for any of the agents, the designer can analyze the results to check whether
they conform to the predicted e ect, if this was intended, or proceed to manually
investigate the level where the test failed to search for the origin of the variation
in the statistics. This would make it possible to narrow down the search for
unexpected e ects to those levels reported by the tests, or to evaluate whether a
design change has the desired impact on the monitored parameters. Additionally,
the introduction of game styles based on the use of di erent reward functions
may allow to analyze the e ect of applying changes not only at a general scale,
but for di erent archetypal pro les that may be considered relevant in the design
of the level, thus providing a tool to support the tailoring of experiences adapted
to the player's pro le.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Abran</surname>
            ,
            <given-names>A</given-names>
          </string-name>
          . (ed.):
          <article-title>Guide to the software engineering body of knowledge, 2004 version: SWEBOK ; a project of the IEEE Computer Society Professional Practices Committee</article-title>
          . IEEE Computer Society, Los Alamitos, Calif. (
          <year>2004</year>
          ), oCLC:
          <fpage>934432015</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Ariyurek</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Betin-Can</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Surer</surname>
          </string-name>
          , E.:
          <source>Automated Video Game Testing Using Synthetic and Humanlike Agents. IEEE Transactions on Games</source>
          <volume>13</volume>
          (
          <issue>1</issue>
          ),
          <volume>50</volume>
          {67 (Mar
          <year>2021</year>
          ). https://doi.org/10.1109/TG.
          <year>2019</year>
          .2947597
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Bergdahl</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gordillo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tollmar</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gisslen</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>Augmenting Automated Game Testing with Deep Reinforcement Learning</article-title>
          .
          <source>In: 2020 IEEE Conference on Games (CoG)</source>
          . pp.
          <volume>600</volume>
          {
          <issue>603</issue>
          (Aug
          <year>2020</year>
          ). https://doi.org/10.1109/CoG47356.
          <year>2020</year>
          .
          <volume>9231552</volume>
          , iSSN:
          <fpage>2325</fpage>
          -
          <lpage>4289</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Buck</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Carter</surname>
          </string-name>
          , J.:
          <article-title>Mazes for programmers: code your own twisty little passages</article-title>
          .
          <source>The Pragmatic Bookshelf</source>
          , Dallas, Texas (
          <year>2015</year>
          ), oCLC:
          <fpage>ocn919295242</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Cook</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gow</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Smith</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Colton</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          : Danesh:
          <article-title>Interactive Tools For Understanding Procedural Content Generators</article-title>
          . IEEE Transactions on Games pp.
          <volume>1</volume>
          {
          <issue>1</issue>
          (
          <year>2021</year>
          ). https://doi.org/10.1109/TG.
          <year>2021</year>
          .
          <volume>3078323</volume>
          , https://ieeexplore.ieee.org/document/9426419/
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Florez-Puga</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gomez-Martin</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gomez-Martin</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Diaz-Agudo</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gonzalez-Calero</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Query-Enabled Behavior Trees</article-title>
          .
          <source>IEEE Transactions on Computational Intelligence and AI in Games</source>
          <volume>1</volume>
          (
          <issue>4</issue>
          ),
          <volume>298</volume>
          {308 (Dec
          <year>2009</year>
          ). https://doi.org/10.1109/TCIAIG.
          <year>2009</year>
          .
          <volume>2036369</volume>
          , http://ieeexplore.ieee.org/document/5325892/
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Gonzalez-Duque</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Palm</surname>
            ,
            <given-names>R.B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ha</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Risi</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Finding Game Levels with the Right Di culty in a Few Trials through Intelligent Trial-andError</article-title>
          .
          <source>In: 2020 IEEE Conference on Games (CoG)</source>
          . pp.
          <volume>503</volume>
          {
          <fpage>510</fpage>
          . IEEE, Osaka,
          <source>Japan (Aug</source>
          <year>2020</year>
          ). https://doi.org/10.1109/CoG47356.
          <year>2020</year>
          .
          <volume>9231548</volume>
          , https://ieeexplore.ieee.org/document/9231548/
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Hernandez</given-names>
            <surname>Becares</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Costero</surname>
          </string-name>
          <string-name>
            <surname>Valero</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Gomez Mart</surname>
          </string-name>
          n,
          <string-name>
            <surname>P.P.:</surname>
          </string-name>
          <article-title>An approach to automated videogame beta testing</article-title>
          .
          <source>Entertainment Computing</source>
          <volume>18</volume>
          ,
          <issue>79</issue>
          {92 (Jan
          <year>2017</year>
          ). https://doi.org/10.1016/j.entcom.
          <year>2016</year>
          .
          <volume>08</volume>
          .002, https://www.sciencedirect.com/science/article/abs/pii/S1875952116300234
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Holmgard</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Green</surname>
            ,
            <given-names>M.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Liapis</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Togelius</surname>
          </string-name>
          , J.:
          <source>Automated Playtesting With Procedural Personas Through MCTS With Evolved Heuristics. IEEE Transactions on Games</source>
          <volume>11</volume>
          (
          <issue>4</issue>
          ),
          <volume>352</volume>
          {362 (Dec
          <year>2019</year>
          ). https://doi.org/10.1109/TG.
          <year>2018</year>
          .
          <volume>2808198</volume>
          , https://ieeexplore.ieee.org/document/8295256/
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Juliani</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Berges</surname>
            ,
            <given-names>V.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Teng</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cohen</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Harper</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Elion</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Goy</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gao</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Henry</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mattar</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lange</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Unity: A General Platform for Intelligent Agents</article-title>
          . arXiv:
          <year>1809</year>
          .02627 [cs, stat] (May
          <year>2020</year>
          ), http://arxiv.org/abs/
          <year>1809</year>
          .02627, arXiv:
          <year>1809</year>
          .02627
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Justesen</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Torrado</surname>
            ,
            <given-names>R.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bontrager</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Khalifa</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Togelius</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Risi</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Illuminating Generalization in Deep Reinforcement Learning through Procedural Level Generation</article-title>
          . arXiv:
          <year>1806</year>
          .10729 [cs, stat] (
          <year>Nov 2018</year>
          ), http://arxiv.org/abs/
          <year>1806</year>
          .10729, arXiv:
          <year>1806</year>
          .10729
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Lu</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yuan</surname>
            ,
            <given-names>K.H.</given-names>
          </string-name>
          :
          <article-title>Welch's t test</article-title>
          , pp.
          <volume>1620</volume>
          {
          <issue>1623</issue>
          (01
          <year>2010</year>
          ),
          <volume>10</volume>
          .13140
          <source>/RG.2.1.3057.9607</source>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Ostrowski</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aroudj</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <source>Automated Regression Testing within Video Game Development</source>
          .
          <source>GSTF Journal on Computing (JoC) 3</source>
          (
          <issue>2</issue>
          ),
          <volume>10</volume>
          (Aug
          <year>2013</year>
          ). https://doi.org/10.7603/s40601-013-0010-4, http://www.globalsciencejournals.com/article/10.7603/s40601-013-0010-4
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14. PadaOne Games: BehaviorBricks. http://bb.padaonegames.com/ (
          <year>2021</year>
          ), accessed:
          <fpage>2021</fpage>
          -04-16
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Pereira</surname>
            ,
            <given-names>R.d.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Engel</surname>
            ,
            <given-names>P.M.:</given-names>
          </string-name>
          <article-title>A Framework for Constrained and Adaptive BehaviorBased Agents</article-title>
          .
          <source>arXiv:1506.02312 [cs] (Jun</source>
          <year>2015</year>
          ), http://arxiv.org/abs/1506.02312, arXiv:
          <fpage>1506</fpage>
          .
          <fpage>02312</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Pfau</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Smeddinck</surname>
            ,
            <given-names>J.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Malaka</surname>
          </string-name>
          , R.:
          <article-title>Automated Game Testing with ICARUS: Intelligent Completion of Adventure Riddles via Unsupervised Solving</article-title>
          . In:
          <article-title>Extended Abstracts Publication of the Annual Symposium on Computer-Human Interaction in Play</article-title>
          . pp.
          <volume>153</volume>
          {
          <fpage>164</fpage>
          . ACM, Amsterdam The Netherlands (Oct
          <year>2017</year>
          ). https://doi.org/10.1145/3130859.3131439, https://dl.acm.org/doi/10.1145/3130859.3131439
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Shaker</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yannakakis</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Togelius</surname>
          </string-name>
          , J.:
          <article-title>Towards automatic personalized content generation for platform games (12</article-title>
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Unity</surname>
          </string-name>
          <article-title>Technologies: Unity Real-Time Development Platform j 3D, 2D VR &amp; AR Engine</article-title>
          . https://unity.com/ (
          <year>2021</year>
          ), accessed:
          <fpage>2021</fpage>
          -04-10
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Vaswani</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shazeer</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Parmar</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Uszkoreit</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jones</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gomez</surname>
            ,
            <given-names>A.N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kaiser</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polosukhin</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Attention Is All You Need</article-title>
          .
          <source>arXiv:1706.03762 [cs] (Dec</source>
          <year>2017</year>
          ), http://arxiv.org/abs/1706.03762, arXiv:
          <fpage>1706</fpage>
          .
          <fpage>03762</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>