<!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>Grammar Based Modular Level Generator for a Programming Puzzle Game</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Chaima Jemmali</string-name>
          <email>jemmali.c@northeastern.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Carter Ithier</string-name>
          <email>ithier.c@northeastern.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Seth Cooper</string-name>
          <email>se.cooper@northeastern.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Magy Seif El-Nasr</string-name>
          <email>mseifeln@ucsc.edu</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Northeastern University</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <country>UC Santa Cruz</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Procedural Content Generation is widely used in games, however, its use in educational puzzle games has been limited. These types of games present common challenges such as solvability and non triviality, but also the extra challenge of preserving intended learning goals. In this paper, we present a modular constructive approach to generate levels in a puzzle programming game. The approach uses a grammar to generate game elements from code and works backwards from the solution to ensure solvability, controllability over the solution, and variation, allowing for alternative solutions that preserve the learning goals.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        There has been a lot of research on Procedural Content
Generation (PCG) and there are several techniques used to
generate levels for different game genres. The most common
two genres where PCG is applied for level generation are
dungeons/rogue-likes and platformer games. However, the
application to puzzle games has been limited
        <xref ref-type="bibr" rid="ref1">(De Kegel and
Haahr 2019)</xref>
        . Educational Games are another area where
PCG has not been adopted widely
        <xref ref-type="bibr" rid="ref2">(Dong and Barnes 2017)</xref>
        .
Besides the common challenges of solvability and
nontriviality of the solution, these types of games present the
extra challenge of preserving intended learning goals
        <xref ref-type="bibr" rid="ref13 ref2 ref2 ref21">(Smith,
Butler, and Popovic 2013; Valls-Vargas, Zhu, and Ontan˜o´n
2017; Dong and Barnes 2017)</xref>
        .
      </p>
      <p>
        In this paper, we focus on two aspects of the
generator: controllability over the educational goals and
variation, meaning the designer has full control over the
learning goals in the level to be generated. Further, generated
levels vary in size, layout, and number of alternative
solutions. In fact, we are not looking if a puzzle is merely
solvable, we require it to be solvable with the solution code
provided as input which provides greater control on what
gameplay is generated. This approach is similar to
generating levels from the gameplay as a vocabulary
        <xref ref-type="bibr" rid="ref22">(Van der
Linden, Lopes, and Bidarra 2013)</xref>
        , where our gameplay is
described through the solution code. To guarantee solvability,
we use a grammar based approach which insures by
construction that the level is solvable without post-processing
or filtering out unsolvable solutions
        <xref ref-type="bibr" rid="ref2 ref21">(Traichioiu et al. 2015;
Valls-Vargas, Zhu, and Ontan˜o´n 2017; Font et al. 2016)</xref>
        .
We combine this approach with working backwards from
a solved map similar to what has been done for the Sokoban
game
        <xref ref-type="bibr" rid="ref11 ref15">(Taylor and Parberry 2011)</xref>
        . Controllability and
variation are somewhat in opposition, especially when having
such a hard constraint on how the level should be solved. To
provide variation, we allow fluidity in our level construction,
especially in the path creation section. This allows levels to
have alternative working equally difficult solutions, of the
same length as the provided solution code, but also
introduces shorter solutions which means the player can solve
the level by bypassing certain elements. We further evaluate
the generator through the design/aesthetics lens by
analyzing the expressive range
        <xref ref-type="bibr" rid="ref12">(Smith and Whitehead 2010)</xref>
        using
two metrics: percentages of walkable and interactable tiles.
Our results show that the levels generated are 100% solvable
by the provided solution code. On average, 47.4% of them
had an alternative working solution of the same length, while
21.3% had shorter “easier” solutions.
      </p>
      <p>The contribution of this paper is the design and
application of a PCG system combining previously used techniques,
as well as introducing new ones for path creation. The
generator is applied to a programming puzzle game, but the
modular aspect of the approach should make parts of it applicable
to other educational or puzzle games.</p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        Research on games that teach programming is significant,
especially at the introductory level
        <xref ref-type="bibr" rid="ref4 ref7">(Harteveld et al. 2014;
Miljanovic and Bradbury 2018)</xref>
        . Generating content for
these games can be challenging and time consuming, which
is increasing the need for PCG to create content that can be
tailored to specific player needs
        <xref ref-type="bibr" rid="ref8">(Park et al. 2019)</xref>
        . However,
a major concern in PCG is the lack of reliability
        <xref ref-type="bibr" rid="ref18">(Togelius
et al. 2011)</xref>
        , which makes the assessment of the generator of
utmost importance. Controllability and variability are two
of the major metrics used to assess PCG systems. In fact,
the degree of control and the set of options are very
important characteristics of any procedural generator
        <xref ref-type="bibr" rid="ref16 ref19 ref9">(Shaker
et al. 2016)</xref>
        . When dealing with puzzle levels, solvability
is an important constraint which can be achieved through
different techniques. Some works have used
generate-andtest techniques
        <xref ref-type="bibr" rid="ref2">(Dong and Barnes 2017)</xref>
        , constructive
approaches where the content is generated only once and
performance checks may be applied throughout
        <xref ref-type="bibr" rid="ref1">(De Kegel and
Haahr 2019)</xref>
        , search-based algorithms
        <xref ref-type="bibr" rid="ref16 ref19 ref9">(Togelius and Shaker
2016)</xref>
        , or answer set programming (ASP)
        <xref ref-type="bibr" rid="ref11 ref15">(Smith and Mateas
2011)</xref>
        , which falls somewhere in between constructive and
generate-and-test. Procedural content generation via
machine learning (PCGML) (Summerville et al. 2018) is an
increasingly popular approach to generating various content,
however, it does not always guarantee solvability. In the
context of learning games, another constraint is to preserve the
intended learning goals or the intended difficulty of the
levels and ascertain there are no trivial solutions. The definition
of such solutions and the approaches to detect them vary
depending on the game. For instance, in an educational game
that teaches parallel programming
        <xref ref-type="bibr" rid="ref2 ref21">(Valls-Vargas, Zhu, and
Ontan˜o´n 2017)</xref>
        a trivial puzzle is a puzzle that doesn’t
require the player to make any changes to be solved and is
identified through the use of a model checker that will run
different scenarios to check if they pass or fail. In another
puzzle game that teaches programming
        <xref ref-type="bibr" rid="ref2">(Dong and Barnes
2017)</xref>
        , solutions that violate educational goals are solutions
that contain unintentional loops and unnecessary elements.
However, the work evaluates a code synthesizer that creates
a solution code from a template rather than the level
generated for that code. To ensure the absence of trivial solutions,
Smith, Butler, and Popovic (2013) used a modified version
of ASP to successfully generate levels with no undesirable
solutions, however, the search space is so large that it makes
the generation time too long for online application.
      </p>
      <p>
        In this work, we use a constructive approach to guarantee
solvability in a computationally inexpensive manner
        <xref ref-type="bibr" rid="ref16 ref19 ref9">(Shaker
et al. 2016)</xref>
        . We use a grammar to generate the
appropriate game elements given an input code. Then, we work
backwards from the solution similarly to
        <xref ref-type="bibr" rid="ref15">Taylor and
Parberry (2011)</xref>
        to ensure solvability with a specific solution
Object Type
movable
block
rotating
block
stoppable
block
fire statue
statue
pressure
plate
hidden
block
revealed
block
hidden door
closed door
hidden key
fire
lever
mb / MB
FS /
FSR &amp;
reward
S / S &amp;
PP
PP &amp;
reward
bh
BR
DH
DC
KH
FU / FL
LV &amp;
reward
      </p>
      <sec id="sec-2-1">
        <title>Description</title>
        <p>can be walkable or not, may
activate a pressure plate
L shaped block that rotates
around its center (rr/RR),
can be walkable or not
moving block that can be
stopped
A rotatable or movable
statue that blows wind/fire
(see Figure 1)
statue that has the same
characteristics as an above
ground block
activates a reward (key,
hidden door, hidden block, etc)
ground level block that can
be revealed.
above ground block that
can be hidden.</p>
        <p>A door that can be revealed.</p>
        <p>A door that can be opened.</p>
        <p>A key that can be revealed.</p>
        <p>A fire pit that can be lit or
unlit.</p>
        <p>A lever that activates a
reward if it’s in the correct
position.
while allowing for variability with equally difficult codes
and minimizing trivial solutions.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Game</title>
      <p>
        In this paper, we use May’s Journey, a puzzle game that
teaches the basics of programming by having learners type
simple instructions in the game’s custom programming
language to interact with objects, solve puzzles, and navigate
an environmental maze
        <xref ref-type="bibr" rid="ref6">(Jemmali et al. 2019; 2018)</xref>
        .
      </p>
      <p>The game is structured in two major phases. In the first
phase, players can move the avatar around using arrow
keys, interact with different parts of the environment, talk to
NPCs, or collect objects. In the second phase, they pull up
a programming interface, as can be seen in Figure 1, where
they interact with game objects through code to solve
different puzzles, which allows them to progress through a level
or reveal some rewards.</p>
      <p>Each level in the game offers a coding challenge that can
be maze-based, where the reward for solving it is getting
to the next level, or reward-based, where solving it yields a
physical reward (key, manuscript, secret area), or both. Each
level has an entry and at least one exit, but could have
multiple. If a level has more than one exit, only one of them
can be an open door. The others have to be either hidden or
closed and revealed by solving the level. The programming
language is object oriented; it is similar to Java, but with less
heavy syntax. The affordances of the language are: simple
instructions (commands applied to objects), simplified for
loops, if statements, variables, object attributes, and while
loops. For our PCG system we considered 4 commands that
can be applied to objects: Move, Rotate, Open and Stop. For
attributes, we considered 2: isMoving (bool) and position
(Vector3 or string). Each object can have multiple attributes,
but only one type of command applied to it. For example, if
it is movable it can’t be rotated, but it could have more than
one attribute. Table 1 shows the objects in the game with a
small description of their functionality and the symbols used
to describe them in our grammar.</p>
    </sec>
    <sec id="sec-4">
      <title>Methodology</title>
      <p>
        The generator takes as input a solution code and outputs a
level layout that can be solved using that code. The generator
is divided in modules to allow for flexibility, modification,
and reuse for different purposes. In fact, it is recommended
to break the process down into multiple steps to design
successful grammar based systems
        <xref ref-type="bibr" rid="ref16 ref19 ref9">(Togelius, Shaker, and
Dormans 2016)</xref>
        . The full process can be seen in Figure 2. In this
section, each module is described in detail using the example
in the figure.
This step takes the input code as a string and extracts the
abstract syntax tree (AST) from it. This step is simple, but
allows the system to be more generalizable since from this
step forward, the generation does not depend on the source
language but only on the AST. In the first step of Figure 2,
we can see that the code presents three command calls:
MoveLeft once, and Rotate(“right”) twice.
      </p>
      <sec id="sec-4-1">
        <title>Game objects and actions extraction</title>
        <p>From the AST, we extract each object, a list of commands
applied to it, as well as a list of attributes. The same
command will be merged together in this format:
(command name, arguments, n) where n is the number of times
that command is repeated. If the command takes no
arguments, that field will be empty. For attributes, the
format is (attribute name, initial state, desired state). In
general, the desired state is extracted from comparison operators
in an if statement or while loop. In the example, we obtain
block1(MoveLeft, 1) and block2(Rotate, “right”, 2) . An
example of an attribute would be if we had a stoppable block,
we would have (isMoving, true, false) where the block is
initially moving and should be stopped in the desired state.</p>
      </sec>
      <sec id="sec-4-2">
        <title>Grammar-based solution mini-map generation</title>
        <p>For each game object, there are possible shapes, or
possible gameplay elements it can incorporate. Depending on the
game object name and its actions and attributes, the grammar
rules are traversed until a final shape is found. The
grammar rules are extended with probabilities so that some rules
are more favored than others. The probability distribution
can be chosen as input and can be either uniform (all rules
have the same probability of being chosen), favors
complexity, or favors simplicity where, respectively, rules with more
complex/simple shapes will be favored. Further, when a
specific rule is applied, a penalty value is added. The penalty
value can also be changed as input and can range between
0 (no penalty) and 1 (each rule can only be applied once).
When the penalty value for a rule reaches 1, that rule is no
longer considered. This penalty is to guarantee that the same
rule cannot be applied too many times and that the layout is
diverse. The shape obtained from the grammar traversal is
placed in the solution mini-map, meaning the shape is placed
as it would be when the map is solved. Figure 2 shows the
solution maps for each of the objects in step 3. Having
separate mini-maps for each object maintains the intended
gameplay since players have to solve the level in one submission,
however, this limits some gameplay opportunities where
objects can influence each other.</p>
      </sec>
      <sec id="sec-4-3">
        <title>Initial mini-map creation</title>
        <p>Next, the actions obtained from step 2 are applied to the
solution maps in reverse. For example, if the action is MoveUp,
then the object is moved down. This is repeated until all
actions are applied.
To create a path in step 4, we use two different algorithms
depending on the shape of the object we get from the
grammar. If the shape’s gameplay is focused on revealing a
reward, such as fire statues or levers, we use the reward path
algorithm, which mostly fills the map with walkable tiles
and then removes tiles from the corners up until a predefined
threshold.</p>
        <p>At the start of the reward path algorithm, all empty tiles in
both initial and solution maps are filled with walkable blocks
B. Then, we get all four corner tiles of the map, choose a
valid one to remove, and move to its neighbors until no valid
neighbors are available. A tile is considered valid if it does
not break the path in the solution map. We chose this
approach to have the tiles removed in a systematic manner and
not randomly in order to obtain a map that looks closer to
the hand-designed maps.</p>
        <p>If the shape’s gameplay is more maze-based, such as a
block that can be walkable or that can obstruct a path, we
use the maze path algorithm, which takes as input both the
solution map and initial map to make sure that 1) there is a
path between the entry and exit in the solution map, and 2)
there is no path between entry and exit in the initial map. If
there is no solution that satisfies these conditions, the first
rule is prioritized to assure that, when a level is solved, the
player can make their way from entry to exit. If the second
rule is not satisfied, this means the player may be able to
walk to the exit without having to solve the puzzle.</p>
        <p>In the maze path algorithm, the entry and exit, which we
refer to as EN and EX, are fixed at the start. After choosing
these points, we find all walkable tiles in the solution map.
Then, we find points (a) and (b) which are respectively the
closest tile to EN and EX in the walkable tiles. Finally, the
shortest paths will be drawn from EN to (a), EX to (b), and
(a) to (b). The same path is also drawn in the initial map. If
the resulted path is walkable from EN to EX in the initial
map, we remove tiles that break that path as long as they
do not break the solution path. This again ensures the first
condition of solvability of the puzzle. Finally, the last part
of the maze path algorithm, which adds tiles back into the
path, is purely for aesthetics reasons and variability to add
different shapes of paths and not just narrow ones.</p>
      </sec>
      <sec id="sec-4-4">
        <title>Mini-map Combination</title>
        <p>Since we could have many mini maps to combine depending
on how many programmable objects are in the code, in step
5, we consider the best way to combine them. We determine
the best combination based on the goal of minimizing the
cost of combination. If two maps can be combined without
modification, they have a 0 cost, while the need for
modifications can result in costs depending on the positions of the
doors E (EN or EX). Combining two maps needs
modifications when they don’t have opposing edges that share a door.
In this scenario, the merged map is made bigger and a path is
created between the entry and exit. This process in this step
is minimized by finding the best combination of the maps
that guarantees the minimum cost.</p>
      </sec>
      <sec id="sec-4-5">
        <title>Miscellaneous Placements</title>
        <p>To have a fully functional map, we add the Player tile in front
of the entry. The coding tile is placed in a way that is
accessible from the entry. Finally, rewards are placed depending on
their type. Closed and hidden doors are placed along walls
that are accessible. If there are no available, accessible walls,
the doors are placed and then a path is created to make sure
they are accessible. Hidden keys are placed anywhere on the
walkable path. Finally, headers are added to the file, which
determine the actions of pressure plates, levers, and fires, as
well as the objects that can activate them.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Evaluation</title>
      <p>To evaluate our system, we look at metrics related to both
the education aspects and game aspects. For the educational
requirements, we first check that levels generated can be
solved using our input code. Further, we check if the level
can be solved using alternative codes with the same code
length. Finally, we check if the level can be solved with
shorter alternative codes. We are not worried with longer
codes since any level can theoretically be solved using a
longer code than what was intended. For a code to be
considered working, there should be a path from entry to exit,
and from entry to any reward in the map, after the code is
applied. If one path is missing, the code is not considered
working.</p>
      <p>Alternative codes are generated from the original code,
by 1) searching for alternative commands that can be
applied to a game object and 2) constructing codes
using each combination of alternative commands. For
example, if our code contains object1:M oveLef t() and
object2:Rotate(\right"), there are 4 Move commands
(one in each direction) that can be applied to object1 and 2
Rotate commands (left/right) that can be applied to object2.
This results in 8 different codes: 7 alternative codes and the
original input code. More broadly, the number of alternative
codes can be written as Qin=1 comb(Oi) where n is the
number of objects and comb(Oi) is the number of combinations
for object Oi.</p>
      <p>Alternative shorter codes are generated by 1) creating a
list of all commands and constructs in the input code and
2) finding all code combinations that use at most n 1 of
commands and constructs, with n being the size of the list
extracted in step 1. For example if our input code contains
a while loop, an if statement, and two commands, the list
length would be 4, and the number of possible
combinations would be 15. More generally, the number of
alternative shorter codes can be written as Prn=01 nr . If (n = 1)
the only shorter code possible is an empty code.</p>
      <p>To evaluate the design of the levels, we look at three
metrics: map size, percentage of interactable objects over map
size, and percentage of walkable tiles over map size. It is
difficult to find more appropriate metrics to evaluate the
levels since the gameplay is decided through the input code. In
fact, the input code has the biggest impact over what kind of
levels would be generated. Further, the variety of objects and
game mechanics is limited by what’s afforded in the original
game. Evaluating the map shape is also not interesting since
100%
player movements are restricted to the path and the player
cannot fall off, meaning there is no difficulty attached to the
layout of the map.</p>
    </sec>
    <sec id="sec-6">
      <title>Results</title>
      <p>We ran the generator with the solution codes from 8
different levels in the game, including a variety of game objects
and constructs. Every code was run 1000 times and the
results are presented in Table 2. Overall, every level generated
was solvable using the input code, which is expected since
it is guaranteed by construction. Further, on average 47.35%
of the levels generated had an alternative working solution
(Alt. w/ Sol.), which means about half of the levels generated
provide different equally difficult ways to solve the
problem. This can be a nice balance between levels that have a
unique solution vs levels that offer the players multiple ways
to solve them. From Table 2, we can see that the percentage
varies considerably across levels, which is again expected.
For example, in level 2 3 the game object can only be
reward based, which makes it impossible to have alternative
solutions since the only way to get the reward would be to
use the input code. On the other hand, levels that are purely
maze-based and have no rewards such as 3 1 have a much
higher rate of alternative solutions (91.9%). These levels
would also have the highest rate of short solutions working.
Overall, 21.31% of the levels generated had working shorter
solutions (Short w/ Sol.), with again variations across
levels. Levels with more lines of code and more objects would
have more possible alternative solutions and therefore more
chances for them to succeed. For example, levels (1 2, 3 1,
3 2) with the highest number of shorter solutions (7),
unsurprisingly, have the highest rate of shorter solutions solving
the puzzle. Looking at specific levels, such as level 4 2,
alternative codes and shorter codes are not applicable. This
comes from the original design of such levels. This level’s
code cannot be modified in the game. The gameplay consists
of understanding the code and making appropriate changes
in the environment so that when the code executes, it
reveals a reward. Another particular level is level 4 6 where
we haven’t defined alternative codes for the Stop or Open
commands which makes alternative codes not possible.</p>
      <p>To analyze the variety of the levels generated, we looked
at the expressive range of the generator in accordance to the
percentage walkable (X axis, 0 to 0.5) and interactable (Y
axis 0 to 0.1) tiles over the size of the map. In figure 3, we
can see how the heat maps change depending on the level.
We notice that the expressive range tightly follows the
design and the possibilities allowed by the game, as well as the
size of the map. For example, level 0 has a moving block
which has 1/3 chance of yielding a reward thus making the
rate of interactable objects mostly low with a few scattered
higher rates. On the other hand, levels 1 2 and 4 6 are
reward based levels which gives a higher rate of walkable
tiles. Levels with many interactable objects (level 3 2 and
4 6) tend to have bigger maps which makes the percentages
of interactable and walkable much more concentrated.
Figure 4 shows the effects of varying the probability distribution
in level 2 1. This level was chosen because it has a
combination of objects that can be maze-based or reward-based
which makes it more representative. In this level, players
need to move a statue to the right twice and move a block
up once. We can observe significant changes between the
distribution that favors simplicity and the uniform one. The
change is not that noticeable between the uniform
distribution and the one that favors complexity. However, while the
heat maps seem similar, the brightest area on the complex
one is on the higher end and the brightest area for the
uniform one is on the lower end of the shape.</p>
      <p>Figure 5 shows some examples of generated levels for the
code of level 2 1. The left example shows a level that can
only be solved with input code, players need to move the
fire statue to get a key and move block1 on a pressure plate
to reveal a hidden block. In the middle example, block1 can
be moved either up or right to complete the path allowing
for one alternative solution. However, in the right
example, block1 does not need to be moved at all and only the
statue needs to be moved to clear the path, which results in
a shorter solution.</p>
    </sec>
    <sec id="sec-7">
      <title>Discussion &amp; Limitations</title>
      <p>
        The results show that the generator successfully creates
levels that are solvable using the desired input code, however,
some of them are still solvable by shorter “less difficult”
codes. These levels may or may not be desirable. In some
cases, the designer may want levels that have an obvious
longer solution and perhaps a shorter cleverer one. We do
not claim that this is the case with the levels generated. But,
we point out that it may be desirable in some special case,
and the decision can be left up to the designer. If we want
to completely remove the shorter solutions, we could add
constraint checkers at different stages of the generation and
discard parts of the map that violate certain conditions.
Another way is to include the maps created by the shorter codes
in the generation process and make sure none of them has a
solution when creating the paths. This will increase the
generation time, but we believe it will still be reasonable for
in-game generation given that it is now at 0:38 seconds on
average. While our approach is applied to a programming
game, the same concept can be reproduced in a puzzle game
where instead of code, the input would be game play
vocabulary as in
        <xref ref-type="bibr" rid="ref22">(Van der Linden, Lopes, and Bidarra 2013)</xref>
        .
      </p>
      <p>One limitation of this work is that the creation of
alternative solutions is specific to the gameplay and
affordances of the game and cannot be easily imported into
another game. Another limitation is that while inputting code
grants full control to the designer, it is not accessible to
non-programmers or even programmers who are not
familiar with the programming language of the game. One way to
tackle this is to build a code generator that will take as
input coding constructs and synthesize valid code that can be
input to this generator. That way, the user would only select
the learning constructs they want.</p>
    </sec>
    <sec id="sec-8">
      <title>Conclusion</title>
      <p>In this paper, we presented a grammar based modular
approach to generate levels in a programming puzzle game.
The approach works backwards from a solution code and
uses both the solution map and the initial map to ensure that
levels are solvable using the input code. The levels
generated allow variation in the solution space through
alternative codes while minimizing shorter, more trivial solutions.
However, some of them still allow shorter codes. In the
future, we want to improve on the approach, build a
userfriendly interface and conduct a user-study with designers.
Further, we would like to work on integrating procedurally
generated levels within the game according to some player
model that will inform us about the coding constructs that
the player needs practice with.</p>
    </sec>
    <sec id="sec-9">
      <title>Acknowledgements</title>
      <p>This research is supported by NSF AISL (Advancing
Informal STEM Learning) Award Id: 1810972.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>De Kegel</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Haahr</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <year>2019</year>
          .
          <article-title>Procedural puzzle generation: a survey</article-title>
          .
          <source>IEEE Transactions on Games</source>
          <volume>12</volume>
          (
          <issue>1</issue>
          ):
          <fpage>21</fpage>
          -
          <lpage>40</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Dong</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Barnes</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          <year>2017</year>
          .
          <article-title>Evaluation of a templatebased puzzle generator for an educational programming game</article-title>
          .
          <source>In Thirteenth Artificial Intelligence and Interactive Digital Entertainment Conference.</source>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          2016.
          <article-title>Constrained level generation through grammar-based evolutionary algorithms</article-title>
          .
          <source>In European Conference on the Applications of Evolutionary Computation</source>
          ,
          <fpage>558</fpage>
          -
          <lpage>573</lpage>
          . Springer.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Harteveld</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Smith</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ; Carmichael,
          <string-name>
            <given-names>G.</given-names>
            ;
            <surname>Gee</surname>
          </string-name>
          , E.; and
          <string-name>
            <surname>Stewart-Gardiner</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>2014</year>
          .
          <article-title>A design-focused analysis of games teaching computer science</article-title>
          .
          <source>Proceedings of Games + Learning + Society</source>
          <volume>10</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>8</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          2018.
          <article-title>Educational game design: an empirical study of the effects of narrative</article-title>
          .
          <source>In Proceedings of the 13th International Conference on the Foundations of Digital Games</source>
          ,
          <fpage>34</fpage>
          . ACM.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Jemmali</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Kleinman</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Bunian</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ; Almeda,
          <string-name>
            <given-names>M. V.</given-names>
            ;
            <surname>Rowe</surname>
          </string-name>
          , E.; and
          <string-name>
            <surname>El-Nasr</surname>
            ,
            <given-names>M. S.</given-names>
          </string-name>
          <year>2019</year>
          .
          <article-title>Using game design mechanics as metaphors to enhance learning of introductory programming concepts</article-title>
          .
          <source>In Proceedings of the 14th International Conference on the Foundations of Digital Games</source>
          ,
          <fpage>1</fpage>
          -
          <lpage>5</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Miljanovic</surname>
            ,
            <given-names>M. A.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Bradbury</surname>
            ,
            <given-names>J. S.</given-names>
          </string-name>
          <year>2018</year>
          .
          <article-title>A review of serious games for programming</article-title>
          .
          <source>In Joint International Conference on Serious Games</source>
          ,
          <fpage>204</fpage>
          -
          <lpage>216</lpage>
          . Springer.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Park</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Mott</surname>
            ,
            <given-names>B. W.</given-names>
          </string-name>
          ; Min,
          <string-name>
            <surname>W.</surname>
          </string-name>
          ; Boyer,
          <string-name>
            <given-names>K. E.</given-names>
            ;
            <surname>Wiebe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E. N.</given-names>
            ; and
            <surname>Lester</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. C.</surname>
          </string-name>
          <year>2019</year>
          .
          <article-title>Generating educational game levels with multistep deep convolutional generative adversarial networks</article-title>
          .
          <source>In 2019 IEEE Conference on Games (CoG)</source>
          ,
          <fpage>1</fpage>
          -
          <lpage>8</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Shaker</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Liapis</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Togelius</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ; Lopes, R.; and Bidarra,
          <string-name>
            <surname>R.</surname>
          </string-name>
          <year>2016</year>
          .
          <article-title>Constructive generation methods for dungeons and levels</article-title>
          .
          <source>In Procedural Content Generation in Games.</source>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          Springer.
          <fpage>31</fpage>
          -
          <lpage>55</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <surname>Smith</surname>
            ,
            <given-names>A. M.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Mateas</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <year>2011</year>
          .
          <article-title>Answer set programming for procedural content generation: A design space approach</article-title>
          .
          <source>IEEE Transactions on Computational Intelligence and AI in Games</source>
          <volume>3</volume>
          (
          <issue>3</issue>
          ):
          <fpage>187</fpage>
          -
          <lpage>200</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <string-name>
            <surname>Smith</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Whitehead</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <year>2010</year>
          .
          <article-title>Analyzing the expressive range of a level generator</article-title>
          .
          <source>In Proceedings of the 2010 Workshop on Procedural Content Generation in Games</source>
          , 1-
          <fpage>7</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <string-name>
            <surname>Smith</surname>
            ,
            <given-names>A. M.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Butler</surname>
          </string-name>
          , E.; and
          <string-name>
            <surname>Popovic</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          <year>2013</year>
          .
          <article-title>Quantifying over play: Constraining undesirable solutions in puzzle design</article-title>
          .
          <source>In Proceedings of the 8th International Conference on the Foundations of Digital Games</source>
          ,
          <fpage>221</fpage>
          -
          <lpage>228</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          2018.
          <article-title>Procedural content generation via machine learning (PCGML)</article-title>
          .
          <source>IEEE Transactions on Games</source>
          <volume>10</volume>
          (
          <issue>3</issue>
          ):
          <fpage>257</fpage>
          -
          <lpage>270</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <string-name>
            <surname>Taylor</surname>
          </string-name>
          , J., and
          <string-name>
            <surname>Parberry</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          <year>2011</year>
          .
          <article-title>Procedural generation of Sokoban levels</article-title>
          .
          <source>In Proceedings of the International North American Conference on Intelligent Games and Simulation</source>
          ,
          <fpage>5</fpage>
          -
          <lpage>12</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          <string-name>
            <surname>Togelius</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Shaker</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          <year>2016</year>
          .
          <article-title>The search-based approach</article-title>
          . In Procedural Content Generation in Games.
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          Springer.
          <fpage>17</fpage>
          -
          <lpage>30</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          <string-name>
            <surname>Togelius</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ; Yannakakis,
          <string-name>
            <given-names>G. N.</given-names>
            ;
            <surname>Stanley</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K. O.</given-names>
            ; and
            <surname>Browne</surname>
          </string-name>
          ,
          <string-name>
            <surname>C.</surname>
          </string-name>
          <year>2011</year>
          .
          <article-title>Search-based procedural content generation: A taxonomy and survey</article-title>
          .
          <source>IEEE Transactions on Computational Intelligence and AI in Games</source>
          <volume>3</volume>
          (
          <issue>3</issue>
          ):
          <fpage>172</fpage>
          -
          <lpage>186</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          <string-name>
            <surname>Togelius</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ; Shaker, N.; and
          <string-name>
            <surname>Dormans</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <year>2016</year>
          .
          <article-title>Grammars and L-systems with applications to vegetation and levels</article-title>
          .
          <source>In Procedural Content Generation in Games</source>
          . Springer.
          <fpage>73</fpage>
          -
          <lpage>98</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          2015.
          <article-title>Grammar-based procedural content generation from designer-provided difficulty curves</article-title>
          .
          <source>In Proceedings of the 10th International Conference on the Foundations of Digital Games.</source>
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          <string-name>
            <surname>Valls-Vargas</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Zhu</surname>
            , J.; and Ontan˜o´n,
            <given-names>S.</given-names>
          </string-name>
          <year>2017</year>
          .
          <article-title>Graph grammar-based controllable generation of puzzles for a learning game about parallel programming</article-title>
          .
          <source>In Proceedings of the 12th International Conference on the Foundations of Digital Games</source>
          ,
          <fpage>1</fpage>
          -
          <lpage>10</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          <string-name>
            <surname>Van der Linden</surname>
            ,
            <given-names>R.</given-names>
            ; Lopes, R.; and Bidarra, R.
          </string-name>
          <year>2013</year>
          .
          <article-title>Designing procedurally generated levels</article-title>
          .
          <source>In Ninth Artificial Intelligence and Interactive Digital Entertainment Conference.</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>