=Paper= {{Paper |id=Vol-2282/EXAG_125 |storemode=property |title=Blending Levels from Different Games using LSTMs |pdfUrl=https://ceur-ws.org/Vol-2282/EXAG_125.pdf |volume=Vol-2282 |authors=Anurag Sarkar,Seth Cooper |dblpUrl=https://dblp.org/rec/conf/aiide/SarkarC18 }} ==Blending Levels from Different Games using LSTMs== https://ceur-ws.org/Vol-2282/EXAG_125.pdf
                         Blending Levels from Different Games using LSTMs

                                               Anurag Sarkar and Seth Cooper
                                        Northeastern University, Boston, Massachusetts, USA
                                          sarkar.an@husky.neu.edu, scooper@ccs.neu.edu




                            Abstract                                well as blending existing levels (Guzdial and Riedl 2016b).
                                                                    Moreover, Gow and Corneli (2015) proposed a theoretical
  Recent work has shown machine learning approaches to be
  effective in training models on existing game data for in-        framework for generating new games by blending not just
  forming procedural generation of novel content. Specifically,     levels but entire games, showing that it is possible to blend
  ML techniques have successfully used existing game levels         two games to create a third whose aesthetics and mechanics
  to train models for generating new levels and blending exist-     are combinations of those of the original two games.
  ing ones. Such blending of not just levels, but entire games,        In this work, we take a step towards implementing this
  has also been proposed as a possible means of generating          framework by leveraging PCGML and concept blending.
  new games. In this paper, we build on these works by train-       Specifically, we train Long Short Term Memory recurrent
  ing Long Short Term Memory recurrent neural networks on           neural networks (LSTMs) on existing levels of the plat-
  level data for two separate platformer games—Super Mario          formers Super Mario Bros. and Kid Icarus. We then sample
  Bros. and Kid Icarus—and use these models to create new
                                                                    from the trained models to generate new levels that encode
  levels that are blends of levels from both games, thus creating
  a level generator for a novel, third game.                        structural characteristics and properties of levels from both
                                                                    games. We thus create a level generator that can produce lev-
                                                                    els for a third game whose levels contain properties of levels
                        Introduction                                from the two games used for training. We also implement a
Procedural content generation (PCG) is the automatic cre-           parametrized version of the generator that allows a designer
ation of game content via procedural or algorithmic methods         to control the approximate amount of each original game de-
(Shaker, Togelius, and Nelson 2016). Since its use in games         sired in the final blended levels.
like Elite (Braben and Bell 1984) and Rogue (A.I. Design
1980), PCG has been widely adopted for generating levels,                                 Related Work
maps, weapons, rules, terrain, etc., and has been an active         PCG via Machine Learning (PCGML). PCGML has
field of games research. Traditional PCG methods include            emerged as a promising research area as evidenced by many
search-based optimization (Togelius et al. 2011), constraint        successful applications of ML for content generation. Neural
satisfaction (Smith and Mateas 2011) and grammar-based              networks in particular have seen wide use for level and map
methods (Smith, Whitehead, and Mateas 2011), to name a              generation. Hoover, Togelius, and Yannakakis (2015) gener-
few. However, these often rely on designer-authored rules,          ated Super Mario Bros. levels by combining a music com-
parameters and constraints to guide the generation process          position technique (functional scaffolding) with a method
and ensure that the generated content has desired proper-           for evolving ANNs (NeuroEvolution of Augmenting Topolo-
ties and characteristics. Aside from being time consuming,          gies (Stanley and Miikkulainen 2002)). Autoencoders have
such methods may unintentionally capture designer biases.           also found related applications, with Jain et al. (2016) train-
PCG via Machine Learning (PCGML) has thus emerged as                ing one on existing levels to generate new levels and repair
an alternative to the traditional methods to help overcome          generated levels that were unplayable. N-gram models have
their limitations. Summerville et al. (2017) define PCGML           also been used by Dahlskog, Togelius, and Nelson (2014)
as “the generation of game content using models that have           for generating Super Mario Bros. levels. Guzdial and Riedl
been trained on existing game content.” By training on game         (2016a) used probabilistic graphical models and clustering
data that one wishes to emulate or create novel variations          to create levels for Super Mario Bros. by training on game-
of, one can capture the desired properties within the trained       play videos. Besides platformers, Summerville et al. (2015)
model and sample from it to generate new content.                   used Bayes Nets for creating The Legend of Zelda levels.
   Recent work has shown that models trained on exist-              They also used Principal Component Analysis to interpolate
ing Super Mario Bros. levels can generate new levels via            between existing Zelda dungeons to create new ones (Sum-
both sequence prediction (Summerville and Mateas 2016) as           merville and Mateas 2015).
                                                                       Markov models have also found use in generating con-
                                                                    tent. Snodgrass and Ontañón have done extensive work in
                                                                                                   (   (   (   (   (   (   (   (   (   (   (   (   (   (   (   (   (
generating levels for Super Mario Bros., Kid Icarus and                                            -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
                                                                                                   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
Lode Runner (Broderbund 1983) using multi-dimensional                                              -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -

Markov chains (Snodgrass and Ontañón 2014), with hi-                                             -
                                                                                                   -
                                                                                                       -
                                                                                                       -
                                                                                                           -
                                                                                                           -
                                                                                                               -
                                                                                                               -
                                                                                                                   -
                                                                                                                   -
                                                                                                                       -
                                                                                                                       -
                                                                                                                           -
                                                                                                                           -
                                                                                                                               -
                                                                                                                               -
                                                                                                                                   -
                                                                                                                                   -
                                                                                                                                       -
                                                                                                                                       -
                                                                                                                                           -
                                                                                                                                           -
                                                                                                                                               -
                                                                                                                                               -
                                                                                                                                                   -
                                                                                                                                                   -
                                                                                                                                                       -
                                                                                                                                                       -
                                                                                                                                                           -
                                                                                                                                                           -
                                                                                                                                                               -
                                                                                                                                                               -
                                                                                                                                                                   -
                                                                                                                                                                   -
erarchical (Snodgrass and Ontañón 2015) and constrained                                          -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
                                                                                                   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
(Snodgrass and Ontañón 2016) extensions as well as using                                         -   -   -   -   -   -   -   Q   -   -   -   -   -   -   -   -   -
                                                                                                   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
Markov random fields. In particular, our work in blending                                          -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
levels is most similar to their work on domain transfer using                                      -
                                                                                                   -
                                                                                                       -
                                                                                                       Q
                                                                                                           -
                                                                                                           -
                                                                                                               -
                                                                                                               -
                                                                                                                   -
                                                                                                                   -
                                                                                                                       -
                                                                                                                       S
                                                                                                                           -
                                                                                                                           ?
                                                                                                                               -
                                                                                                                               S
                                                                                                                                   -
                                                                                                                                   Q
                                                                                                                                       -
                                                                                                                                       S
                                                                                                                                           -
                                                                                                                                           -
                                                                                                                                               -
                                                                                                                                               -
                                                                                                                                                   -
                                                                                                                                                   -
                                                                                                                                                       -
                                                                                                                                                       -
                                                                                                                                                           -
                                                                                                                                                           -
                                                                                                                                                               -
                                                                                                                                                               -
                                                                                                                                                                   -
                                                                                                                                                                   -
Markov chains for mapping levels from one game to another                                          -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
                                                                                                   -   -   -   -   -   -   -   -   -   -   -   -   -   <   >   -   -
(Snodgrass and Ontañón 2017).                                                                    -   -   -   -   -   -   E   -   -   -   -   -   -   [   ]   -   -
                                                                                                   X   X   X   X   X   X   X   X   X   X   X   X   X   X   X   X   X
   Finally, Long Short Term Memory recurrent neural net-
works (LSTMs) have been particularly effective in gener-
ating game levels. Summerville and Mateas (2016) used              Figure 1: Super Mario Bros. Level 1-1 and its text represen-
LSTMs to generate Mario levels by treating each level as a         tation.
character string and using these strings to train the network.
The trained network could then use an initial string as a start-                                   # - - - - - T T T T - T T T T T (
                                                                                                   # - - - - - - - - - - - - - - - (
ing seed to generate new characters, thereby producing new                                         #
                                                                                                   #
                                                                                                       -
                                                                                                       -
                                                                                                           -
                                                                                                           -
                                                                                                               -
                                                                                                               -
                                                                                                                   -
                                                                                                                   -
                                                                                                                       -
                                                                                                                       -
                                                                                                                           -
                                                                                                                           -
                                                                                                                               -
                                                                                                                               -
                                                                                                                                   -
                                                                                                                                   -
                                                                                                                                       -
                                                                                                                                       -
                                                                                                                                           -
                                                                                                                                           -
                                                                                                                                               -
                                                                                                                                               D
                                                                                                                                                   -
                                                                                                                                                   #
                                                                                                                                                       -
                                                                                                                                                       -
                                                                                                                                                           -
                                                                                                                                                           -
                                                                                                                                                               -
                                                                                                                                                               -
                                                                                                                                                                   (
                                                                                                                                                                   (
levels. Though most level generation using LSTMs focuses                                           #   -   -   -   -   -   -   -   -   -   -   D   #   -   -   #   (
                                                                                                   #   -   -   -   -   -   #   #   #   #   #   #   #   #   -   #   (
primarily on Super Mario Bros., the method can be used to                                          #   -   -   -   -   -   #   #   -   -   -   -   -   -   -   #   (

create generators for any game whose levels are represented                                        #
                                                                                                   #
                                                                                                       -
                                                                                                       -
                                                                                                           -
                                                                                                           -
                                                                                                               #
                                                                                                               #
                                                                                                                   #
                                                                                                                   -
                                                                                                                       #
                                                                                                                       -
                                                                                                                           #
                                                                                                                           -
                                                                                                                               #
                                                                                                                               -
                                                                                                                                   -
                                                                                                                                   -
                                                                                                                                       -
                                                                                                                                       -
                                                                                                                                           -
                                                                                                                                           #
                                                                                                                                               -
                                                                                                                                               #
                                                                                                                                                   -
                                                                                                                                                   #
                                                                                                                                                       -
                                                                                                                                                       #
                                                                                                                                                           -
                                                                                                                                                           #
                                                                                                                                                               #
                                                                                                                                                               #
                                                                                                                                                                   (
                                                                                                                                                                   (
as sequences of text. The success of such techniques for level                                     # - - # - - - - - - - - - - # # (
                                                                                                   # T - # - - - - - - - - - - # # (
generation informed our use of LSTMs in this work.                                                 # - - # - # # # # - - - - - # # (
                                                                                                   # - - # - - - - - - - - - - # # (
Mixed-Initiative PCG. This refers to content generation by                                         # - T # - - - - - - - - - - # # (

harnessing the capabilities of a procedural generator and a                                        # - - # - - - - - # # # # - # # (
                                                                                                   # - - # - - - - - - - - - - # # (
human designer working in concert. Such generators, like                                           # T - # - - - - - - - - - - # # (


Tanagra (Smith, Whitehead, and Mateas 2011), combine the
generator’s ability to rapidly produce multiple levels with         Figure 2: Kid Icarus Level 1 and its text representation.
the human ability to evaluate them using superior creativity
and judgment. Authorial control in procedural generators al-
lows designers to guide generation towards desired content.        levels of a game, but to games in their entirety. They pre-
Thus, we implemented a parametrized variant of the blended         sented a framework for generating a novel game by using the
level generator which lets the designer control the percent-       four space blending process of selecting two input games to
age of either game in the final blend. Yannakakis, Liapis, and     blend, creating a generic game concept and then producing
Alexopoulos (2014) offer an extensive analysis of mixed-           a new blended game by combining the generalized elements
initiative design tools and their effects on creativity.           of the input games. They used the Video Game Description
Concept Blending. Concept blending states that novel con-          Language (VGDL) (Schaul 2014) to generate a novel game
cepts can be produced by combining elements of existing            by combining VGDL specifications of The Legend of Zelda
concepts. The “four space” concept blending theory was             (Nintendo 1986b) and Frogger (Konami 1981).
proposed by Fauconnier and Turner (1998; 2008) and de-
scribes a conceptual blend as consisting of four spaces:                                     Dataset
• Two input spaces constituting the concepts prior to being        The Video Game Level Corpus. The data for this work is
  combined                                                         taken from the Video Game Level Corpus (VGLC)1 . The
• A generic space into which the input concepts are pro-           VGLC (Summerville et al. 2016) is a corpus of levels from
  jected and equivalence points are identified                     a number of games, represented in parseable formats such
• A blend space into which the equivalent points from the          as Tile, Graph and Vector. It is small compared to tradi-
  generic space are projected and new concepts are evolved         tional ML datasets and the general dearth of sufficient game
   Goguen (1999) offers a related formalization of concep-         data for training is a known issue in PCGML. However, the
tual blending which forms the basis of the COINVENT                VGLC is an important step towards addressing this issue and
computational model (Schorlemmer et al. 2014). This aims           has already been used in a sizable amount of games research.
to develop a “computationally feasible, formal model of            Games. We trained on levels from Super Mario Bros. (Nin-
conceptual blending” and has applied conceptual blending           tendo 1985) and Kid Icarus (Nintendo 1986a). Both are 2D
in music (Cambouropoulos, Kaliakatsos-Papakostas, and              platformers released for the Nintendo Entertaiment System
Tsougras 2014) and mathematics (Bou et al. 2015).                  in the 1980s but differ in that Super Mario Bros. levels
Blending Game Levels and Game Generation. In games,                progress exclusively from left to right where as Kid Icarus
Guzdial and Riedl (2016b) used conceptual blending to              levels progress from bottom to top. Thus, both are platform-
blend level generation models of Super Mario Bros. and also        ers with similar features which may make them compati-
looked at different blending approaches to generate levels         ble for blending, but also have different orientations which
(Guzdial and Riedl 2017). Additionally, Gow and Corneli
                                                                      1
(2015) proposed applying conceptual blending not just to                  https://github.com/TheVGLC/TheVGLC
                                                                                                                                                                    Enough
                                                                                SMB/KI       Combined                                                              sequences
                                                                                                                                                                                  YES
                                                                                 Seed
                                                                                                                               Classifier                                                Repeat for Next Level
                                                                                             Generator      [sequence]
                                                                                                                                                                   generated
                                                                                                                                                [sequence,             ?
                                           Original VGLC   Original VGLC
                                                                                                                                                SMB/KI]
    Original VGLC         Original VGLC     SMB Levels       KI Levels       UW                                                                                          NO
       SMB+KI                SMB+KI
        Levels                Levels
                                                                                                                                     Generate next sequence               Generate next segment NO
                                                                                                             Combined
                                                                                                             Generator
                                                                                                                                             NO                           NO                     Enough
                                                                                                                           Regenerate                                                           segments
                                                                                                                                        Correct                                                     ?
                                                                                             SMB or               [sequence]           sequence           YES       Segment
                                                                             [SMB weight,      KI
                                                                                                                                       generated
                                                                                                                                                                    complete
                                                                               KI weight]   segment
                                                                                                                                           ?
                                                                                                                                                                       ?           YES                YES
                                                                                               ?
                                           Generalized      Generalized                                      Classifier
    Generalized           Generalized      SMB Levels        KI Levels                                                         [sequence,                                                Repeat for Next Level
     SMB+KI                SMB+KI                                            WC                                                SMB/KI]
      Levels                Levels
                                                                                                               Generate next sequence                  Generate next segment

                                                                                                               SMB
                                                                                                                           [SMB sequence]                                        NO
                                                                                                      SMB                                          NO
                                                                                                             Generator
                                                                                                                                                                            Enough
                                                                                             SMB or                                         Segment          YES           segments
                                                                                                                                                                                          YES     Repeat for
                                                                             [SMB weight,      KI                                           complete
       Sequence              Combined      SMB-only          KI-only                                                                                                       generated
                                                                               KI weight]   segment                                            ?
                                                                                                                                                                               ?
                                                                                                                                                                                                  Next Level
                                                            Generator                          ?
       Classifier            Generator     Generator

                                                                                                            KI Generator
                                                                             WS                 KI                         [KI sequence]




             Figure 3: Overview of the training process.                   Figure 4: Overview of the generation process. Sequence
                                                                           here refers to either an SMB row or a KI column. Segments
                                                                           are sets of sequences. Details are given in the Level Genera-
might result in interesting blends. For the rest of the paper,             tion subsection.
we refer to Super Mario Bros. as SMB and Kid Icarus as KI.
Level Representation. The VGLC contains 15 SMB levels
and 6 KI levels, all of which were used for training. Levels               but not long-term dependencies. To address this, Hochre-
are represented in the Tile format using w×h grids where w                 iter and Schmidhuber (1997) proposed the Long Short-Term
is the width and h is the height of the levels. This is stored as          Memory RNN. LSTMs overcome this problem by adding
a text file with each character mapping to a specific tile. This           a memory mechanism to regular RNNs. Being suitable for
mapping is stored in a separate JSON file for each game.                   sequence-based applications, LSTMs are often used for pre-
Parts of example levels and their text representations are de-             dicting the next item in a sequence given the sequence thus
picted for SMB and KI in Figures 1 and 2 respectively.                     far. This is done by estimating a probability distribution over
                                                                           possible next items and choosing the most likely one as the
                                  Method                                   prediction.
This section discusses the different approaches used in this               Training on Level Data. For training, we followed the
work. High-level overviews of the training and generation                  method of Summerville and Mateas (2016). Each level is
phases are given in Figures 3 and 4 respectively.                          treated as a collection of sequences, with each individual tile
Blending. Using the conceptual blending framework, our                     being a point in a sequence. Concretely, a level is a 2D ar-
two input spaces are the SMB and KI level corpora from the                 ray of characters, as in Figures 1 and 2, with each tile being
VGLC. For the generic space, we mapped the semantically                    a character in the array. For SMB, we feed in sequences of
common elements in both games to a uniform tile represen-                  columns from left to right, since the levels in SMB progress
tation while preserving the tiles that were unique. The only               horizontally in this direction and for the LSTM to learn the
such common elements we identified were solid ground and                   patterns in the level, we need to induce the appropriate or-
enemy, and replaced their KI representations of # and H in                 dering for the sequences. Similarly, we feed in KI levels in
the corpus with the SMB equivalents of X and E. The back-                  sequences of rows from bottom to top. For uniformity, SMB
ground character (‘-’) was already the same for both games.                levels were padded with empty space on the top to have
Thus, in this generalizing process we use an amalgamation                  columns of height of height 16, while KI levels had rows
approach as in (Ontañón and Plaza 2010). Prior to training,              of width 16. This allowed the model to be trained on se-
we converted each level into this new generic representa-                  quences of 16 character rows or columns, irrespective of the
tion. These design decisions are matters of personal prefer-               game. To tell the LSTM when one row/column ends and the
ence and it is up to the designer to determine the mapping as              next begins, we added a delimiter character ‘(’ after every
desired.                                                                   row/column. The LSTM learns via training to generate this
LSTM RNNs. Like vanilla neural nets, recurrent neural                      character after every 16 characters so that generated levels
nets (RNNs) learn weights by backpropagating errors dur-                   can be laid out properly.
ing training. However, unlike standard neural nets where                      Due to the disparity in the number of levels for either
edges are only connected from input layers to hidden lay-                  game, as well as the low total number of levels, we dupli-
ers to output layers, edges in RNNs are also connected                     cated the Mario and Icarus levels 9 and 21 times respec-
from a node to itself over time. Errors are thus backpropa-                tively, giving us a total of 135 Mario levels and 126 Icarus
gated not just across separate nodes but also over time steps              levels for training. We used a lower number of KI levels
making RNNs suitable for processing sequential input and                   since its levels were larger than levels in SMB. The levels
thus applicable in tasks like handwriting and speech recog-                were then split into semi-overlapping sequences of charac-
nition (Graves, Mohammed, and Hinton 2013). However,                       ters. Ultimately, we ended up with a training data set consist-
RNNs suffer from the vanishing gradient problem (Hochre-                   ing of 149,103 such sequences of SMB levels and 149,372
iter 1998) where the error gradient dissipates over time.                  sequences of KI levels. To train the LSTM, we used two
Hence, standard RNNs are efficient at learning short-term                  matrices—the first storing these sequences of characters,
and the second storing the next character in the level for
each corresponding sequence. Additionally, the sequences
were encoded using One-Hot encoding. In our training mod-
els, the LSTM consisted of 2 hidden layers of 128 blocks
each. The output layer was sent to a SoftMax activation
layer which acted as a categorical probability distribution for
the One-Hot encoded tiles. To prevent overfitting, we used
a dropout rate of 50%. For all models, we used a learning
rate of 0.005, the rmsprop optimizer and categorical cross-
entropy loss as the loss function.
Models. We trained 3 different models. One of these used
a combined dataset of SMB+KI levels. We also trained a
model each on just the SMB levels and on just the KI lev-
els. For training, we used Keras and based code off of the
work of Summerville and Mateas (2016), which in turn was                             Figure 5: Aspect Ratio
based off work by Karpathy (2015). Each model was trained
for 50 iterations. While this is a small number, we note that
our dataset is much smaller than datasets for traditional ML
applications and even with this small number of iterations,
we were able to achieve high values for validation accuracy.      of 2 starting seeds—the initial substring of either an SMB-
Training deeper neural nets for a longer period (preferably       like or a KI-like level. For the parametrized generator we had
till convergence of some loss-based criterion) is something       two approaches—either use the combined generator (WC) or
to consider for future work. During each iteration of train-      use the SMB-only and KI-only generators together (WS).
ing, 10% of the dataset was held out for validation.
    Since SMB and KI levels differ in orientation, an issue in       The generation process for UW is straightforward. We
generating levels was determining how to layout generated         feed in the starting seed and then iterate until the genera-
sequences; i.e. should a generated sequence of 16 charac-         tor has predicted enough characters to form the entire level,
ters be laid out like an SMB column or a KI row? To this          with the classifier used to decide which game a generated se-
end, we trained a classifier on the training corpus and then      quence belongs to. For the weighted generators, generation
used it to determine the layout orientation of each generated     took place in segments. Prior to generating each segment,
sequence. For the classifier, we used a sequential model in       we used the weights to determine if the segment should be
Keras (Chollet and others 2015) consisting of 1 hidden layer      SMB-like or KI-like. When using WS, depending on if the
with 256 neurons each in the input and hidden layers and 1        next segment should be SMB or KI, the SMB sub-generator
neuron in the output layer, along with a dropout rate of 50%.     or the KI sub-generator was used to generate a fixed-size
We used the rectifier activation function on the first 2 layers   segment until enough segments had been generated to create
and a sigmoid activation function on the output layer, along      the full level. Using this approach, x% of the level segments
with the rmsprop optimizer and a learning rate of 0.0005.         would be SMB-like where as y% would be KI-like, where
With this network, we achieved a classification accuracy of       x and y are the pre-specified weights. When using WC, the
91.33% on the SMB dataset and 91.29% on the KI dataset.           combined generator was used to create sequences of the pre-
Level Generation. This involves forwarding an initial seed        viously determined game for that segment until it had been
through the trained models multiple times until the desired       fully created, using the classifier to discard any generated se-
amount of output is generated. The starting seed is the ini-      quences that were not for the current segment. For UW, we
tial substring of a level string. The trained LSTM repeatedly     generated levels consisting of 200 sequences. For both WC
predicts the next most likely character given the previous        and WS, we generated levels consisting of 10 segments, with
characters in the string until enough characters have been        each segment containing 20 sequences.
predicted to form a level of desired size.
    As mentioned before, we created both a regular blended        Layout. Once generated, the sequences forming the levels
level generator as well as a parametrized variant that affords    are laid out using a basic algorithm. Placing columns after
authorial control. The parameter here refers to weights (be-      columns and rows after rows is trivial since we just stack
tween 0 and 1) assigned to each game that determines what         them one after another. To place a row after a column, we
percentage of the generated level should be derived from          align its y-coordinate with that of the topmost position in the
SMB and KI. Using our 3 training models, we implemented 3         column on which the player can stand. To place a column
generators—an unweighted generator UW, a weighted gen-            after a row, we similarly align the y-coordinate of the top
erator WC that used the model trained on the combined cor-        most point on which the player can stand in the column with
pus of levels and another weighted generator WS that used         the y-coordinate of the previous row. The layout function
the models trained separately i.e. it consisted of an SMB-        in this work is separate from the generator and thus many
only sub generator and KI-only sub generator that could gen-      different layouts are possible, each necessarily affecting how
erate only SMB columns and only KI rows respectively. UW          playable the levels ultimately are. Further investigating the
involved sampling from the combined model and using one           goodness of layouts is important future work.
                    Figure 6: Leniency                                           Figure 8: Sequence Density




                     Figure 7: Density
                                                                                Figure 9: Sequence Variation

                           Results
Canossa and Smith (2015) and Smith and Whitehead (2010)
                                                                 Sequence Density and Variation. These relate to how dif-
have proposed several metrics to evaluate the features of
                                                                 ferent the generated levels are from the training set (Spitaels
generated levels. We used the following in this work.
                                                                 2017). Sequence density counts the number of sequences in
Leniency. This captures a sense of level difficulty by sum-
                                                                 a level that also exist in the training set and then divides
ming the number of enemy sprites in the level and half the
                                                                 it by the total number of sequences in the level. Sequence
number of empty sequences (i.e. gaps), negating the sum and
                                                                 variation is similar but counts each occurrence of a training
dividing it by the total number of sequences in the level.
                                                                 sequence once in a generated level.
Density. This measures how much of the level can be oc-
cupied by the player. For this, we counted the number of         Aspect Ratio. This is calculated by dividing the number of
ground and platform sprites in the level and divided it by the   rows (height) in a level by the number of columns (width).
total number of sequences in the level.                             We used the unweighted generator UW (with both SMB
                                                                 and KI seeds) and weighted generators WC and WS with
                                                                 weights of 0.5 to create 100 blended levels each. Results for
                  L         D        SD       SV       AR
                                                                 the above metrics are given in Table 1.
 KI (n=6)         -0.073    2.808    1        0.423    13.073
 SMB (n=15)       -0.124    1.61     1        0.201    0.086     Expressive Range. Additionally, we wanted to look at the
 UW-SMB           -0.083    1.716    0.929    0.232    0.577     expressive range of the weighted generators as their weights
 UW-KI            -0.075    1.978    0.925    0.274    0.718     are varied. The expressive range of a generator (Smith and
 WC (0.5,0.5)     -0.053    3.587    0.938    0.253    0.599     Whitehead 2010) is the style and variety of the levels it can
 WS (0.5,0.5)     -0.083    2.110    0.964    0.227    0.857     generate. To visualize the range of the weighted generators
                                                                 and compare them with each other, we generated 10 levels
Table 1: Mean values for the metrics for the VGLC levels         for each of 10 pairs of weights. Figures 5, 6, 7, 8 and 9 show
(top 2 rows) and the generated levels. L, D, SD, SV, AR          the range of the weighted generators as the weights are var-
stand for Leniency, Density, Sequence Density, Sequence          ied between the two games. Example generated levels for
Variation and Aspect Ratio respectively.                         unweighted and weighted generators are shown in Figures
                                                                 10 and 11 respectively.
            UW-SMB                    WC(0.5,0.5)




                                                                            WC (0.2,0.8)               WC (0.4,0.6)



             UW-KI                    WS(0.5,0.5)

 Figure 10: Example levels made by generators in Table 1
                                                                            WC (0.6,0.4)               WC (0.8,0.2)

                        Discussion                                    Figure 11: Example levels made by generator WC

Figures 5, 6, 7, 8 and 9 suggest that altering the weights
does impact the type of levels generated and allows the de-                  Conclusion and Future Work
signer to roughly interpolate between SMB and KI. For both        In this work, we trained LSTMs on levels from Super Mario
Aspect Ratio and Sequence Variation, as we move from a            Bros. and Kid Icarus to generate levels that were blends of
weight pair of (high-SMB, low-KI) to (low-SMB, high-KI),          the levels from these two games. This suggests that leverag-
the values move from being closer to the SMB corpus to be-        ing PCGML may help realize the VGDL-based game gener-
ing closer to the KI corpus, as expected. This is also mostly     ation framework proposed by Gow and Corneli (2015).
true for Leniency and Density though interestingly for these,        There are several directions for future work. An obvious
while the values follow the same trend, the blends with           limitation of this work is that no playability tests were run
higher amount of KI seem to have higher values than the KI        on the generated levels nor any playability or path-based
corpus itself. That is, KI-heavy generated levels were more       information used in training. Thus, levels are currently not
lenient and dense than the actual KI levels used in training      traversable from start to finish using either SMB or KI me-
where as the SMB-heavy generated levels were closer to the        chanics. Future work could involve using an agent to carve
originals in terms of Leniency and Density. For Sequence          out a path post-generation or encoding path information into
Density, the SMB and KI corpora have values of 1 by defini-       the training corpus as in Summerville and Mateas (2016).
tion. It is interesting however that there is a slight decrease      Having said that, the lack of playability is not surprising
in this value as the amount of KI is increased in the blend.      since we would expect blended levels to require blended
As for comparing WC and WS, WS seems to adhere more               mechanics to be playable. While levels are integral to a
closely to the range of values between those of the SMB and       game, so too are the mechanics and player-world interac-
KI corpora while WC generates more novel sequences as             tions. Blending two games thus necessitates blending their
evidenced by the lower values for Sequence Density. Over-         mechanics as well. Gow and Corneli (2015) demonstrate
all, these results suggest that by using the methodology out-     this in their VGDL example by combining the mechanics
lined in the paper, it is possible to generate levels that are    of The Legend of Zelda with Frogger. The feasibility of ap-
a mix of levels from two other games but that can also be         plying the technique discussed in our work towards game
made to be more like one than the other, as desired by the        mechanics is worth looking into for future work. It might ad-
designer. Moreover, the unexpected deviations highlighted         ditionally be possible to leverage evolutionary algorithms to
above suggest that in addition to emulating training data and     evolve game mechanics that are compatible with the newly
capturing its inherent properties, these generative methods       blended game and are based off of the mechanics of the orig-
can also produce novelty as evidenced by some blended lev-        inal games being blended.
els having properties outside of the expected range within
the two input games. In the future, more thorough and rigor-                             References
ous approaches combined with richer datasets might lead to
generative models and processes that are both more control-       A.I. Design. 1980. Rogue.
lable as well as capable of producing more interesting and        Bou, F.; Corneli, J.; Gomez-Ramirez, D.; Maclean, E.;
novel results.                                                    Pease, A.; Schorlemmer, M.; and Smaill, A. 2015. The role
of blending in mathematical invention. In Proceedings of the   tional scaffolding. In First Computational Creativity and
6th International Conference on Computational Creativity.      Games Workshop.
Braben, D., and Bell, I. 1984. Elite.                          Jain, R.; Isaksen, A.; Holmgård, C.; and Togelius, J. 2016.
Broderbund. 1983. Lode Runner.                                 Autoencoders for level generation, repair and recognition. In
                                                               Proceedings of the ICCC Workshop on Computational Cre-
Cambouropoulos, E.; Kaliakatsos-Papakostas, M.; and            ativity and Games.
Tsougras, C. 2014. An idiom-independent representation of
chords for computational music analysis and generation. In     Karpathy, A. 2015. The unreasonable effectiveness of re-
Proceedings of the joint 11th Sound and Music Computing        current neural networks. http://karpathy.github.io/2015/05/
Conference (SMC) and 40th International Computer Music         21/rnn-effectiveness/.
Conference (ICMC).                                             Konami. 1981. Frogger.
Canossa, A., and Smith, G. 2015. Towards a procedural          Nintendo. 1985. Super Mario Bros.
evaluation technique: Metrics for level design. In Proceed-    Nintendo. 1986a. Kid Icarus.
ings of the 10th International Conference on the Founda-       Nintendo. 1986b. The Legend of Zelda.
tions of Digital Games.
                                                               Ontañón, S., and Plaza, E. 2010. Amalgams: A formal ap-
Chollet, F., et al. 2015. Keras. https://keras.io.             proach for combining multiple case solutions. In Interna-
Dahlskog, S.; Togelius, J.; and Nelson, M. 2014. Linear        tional Conference on Case-Based Reasoning.
levels through N-grams. In Proceedings of the 18th Inter-      Schaul, T. 2014. An extensible description language for
national Academic MindTrek Conference: Media Business,         video games. IEEE Transactions on Computational Intelli-
Management, Content & Services, 200–206.                       gence and AI in Games 6(4):325–331.
Fauconnier, G., and Turner, M. 1998. Conceptual integration    Schorlemmer, M.; Smaill, A.; Kuhnberger, K.-U.; Kutz, O.;
networks. Cognitive Science 22(2):133–187.                     Colton, S.; Cambouropoulos, E.; and Pease, A. 2014. Coin-
Fauconnier, G., and Turner, M. 2008. The Way We Think:         vent: Towards a computational concept invention theory. In
Conceptual Blending and the Mind’s Hidden Complexities.        Proceedings of the Fifth International Conference on Com-
Basic Books.                                                   putational Creativity.
Goguen, J. 1999. An introduction to algebraic semiotics        Shaker, N.; Togelius, J.; and Nelson, M. 2016. Procedural
with application to user interface design. Computation for     Content Generation in Games. Springer International Pub-
Metaphors, Analogy and Agents 242–291.                         lishing.
Gow, J., and Corneli, J. 2015. Towards generating novel        Smith, A., and Mateas, M. 2011. Answer set programming
games using conceptual blending. In Proceedings of the         for procedural content generation. IEEE Transactions on
Eleventh Artificial Intelligence and Interactive Digital En-   Computational Intelligence and AI in Games 3(3):187–200.
tertainment Conference.                                        Smith, G., and Whitehead, J. 2010. Analyzing the expres-
Graves, A.; Mohammed, A.-R.; and Hinton, G. 2013.              sive range of a level generator. In Proceedings of the 2010
Speech recognition with deep recurrent neural networks. In     Workshop on Procedural Content Generation in Games.
Acoustics, Speech and Signal Processing (icassp), 6645–        Smith, G.; Whitehead, J.; and Mateas, M. 2011. Tanagra:
6649.                                                          Reactive planning and constraint solving for mixed-initiative
                                                               level design. IEEE Transactions on Computational Intelli-
Guzdial, M., and Riedl, M. 2016a. Game level generation
                                                               gence and AI in Games 3(3):201–215.
from gameplay videos. In Proceedings of the Twelfth Artifi-
cial Intelligence and Interactive Digital Entertainment Con-   Snodgrass, S., and Ontañón, S. 2014. Experiments in map
ference.                                                       generation using Markov chains. In Proceedings of the
                                                               9th International Conference on the Foundations of Digital
Guzdial, M., and Riedl, M. 2016b. Learning to blend com-
                                                               Games.
puter game levels. In Proceedings of the Seventh Interna-
tional Conference on Computational Creativity.                 Snodgrass, S., and Ontañón, S. 2015. A hierarchical MdMC
                                                               approach to 2D video game map generation. In Proceedings
Guzdial, M., and Riedl, M. 2017. Combinatorial creativity      of the Eleventh Artificial Intelligence and Interactive Digital
for procedural content generation via machine learning. In     Conference.
Proceedings of the First Knowledge Extraction from Games
Workshop.                                                      Snodgrass, S., and Ontañón, S. 2016. Controllable proce-
                                                               dural content generation via constrained multi-dimensional
Hochreiter, S., and Schmidhuber, J. 1997. Long short-term      Markov chain sampling. In Proceedings of the Twenty-
memory. Neural Computation 9(8):1735–1780.                     Fifth International Joint Conference on Artificial Intelli-
Hochreiter, S. 1998. The vanishing gradient problem during     gence (IJCAI-16).
learning recurrent neural nets and problem solutions. Inter-   Snodgrass, S., and Ontañón, S. 2017. An approach to
national Journal of Uncertainty, Fuzziness and Knowledge-      domain transfer in procedural content generation of two-
Based Systems 6(2):107–116.                                    dimensional videogame levels. In Proceedings of the Twelfth
Hoover, A.; Togelius, J.; and Yannakakis, G. 2015. Compos-     AAAI Conference on Artificial Intelligence and Interactive
ing video game levels with music metaphors through func-       Digital Entertainment (AIIDE-17).
Spitaels, J. 2017. MarioNet: Generating realistic game lev-
els through deep learning. Master’s Dissertation.
Stanley, K., and Miikkulainen, R. 2002. Evolving neu-
ral networks through augmenting topologies. Evolutionary
Computation 10(2):99–127.
Summerville, A., and Mateas, M. 2015. Sampling Hyrule:
Sampling probabilistic machine learning for level genera-
tion. In Proceedings of the Eleventh Artificial Intelligence
and Interactive Digital Conference.
Summerville, A., and Mateas, M. 2016. Super Mario as a
string: Platformer level generation via LSTMs. In Proceed-
ings of the 1st International Joint Conference on DiGRA and
FDG.
Summerville, A.; Behrooz, M.; Mateas, M.; and Jhala, A.
2015. The learning of Zelda: Data-driven learning of level
topology. In Proceedings of the 10th International Confer-
ence on the Foundations of Digital Games.
Summerville, A. J.; Snodgrass, S.; Mateas, M.; and
Ontañón, S. 2016. The VGLC: The Video Game Level
Corpus. Proceedings of the 7th Workshop on Procedural
Content Generation.
Summerville, A.; Snodgrass, S.; Guzdial, M.; Holmgård,
C.; Hoover, A.; Isaksen, A.; Nealen, A.; and Togelius, J.
2017. Procedural content generation via machine learning
(PCGML). In Foundations of Digital Games Conference.
Togelius, J.; Yannakakis, G.; Stanley, K.; and Browne, C.
2011. Search-based procedural content generation: A tax-
onomy and survey. IEEE Transactions on Computational
Intelligence and AI in Games 3(3):172–186.
Yannakakis, G.; Liapis, A.; and Alexopoulos, C. 2014.
Mixed-initiative co-creativity. In Foundations of Digital
Games Conference.