=Paper= {{Paper |id=Vol-1952/Pattern_Exploration |storemode=property |title=Location-Based Game Design Pattern Exploration Through Agent-Based Simulation |pdfUrl=https://ceur-ws.org/Vol-1952/Pattern_Exploration.pdf |volume=Vol-1952 }} ==Location-Based Game Design Pattern Exploration Through Agent-Based Simulation== https://ceur-ws.org/Vol-1952/Pattern_Exploration.pdf
                        Location-based Game Design Pattern Exploration
                               Through Agent-Based Simulation
                                                          Thomas Heinz
                                       Research Group on Computing in the Cultural Sciences
                                                 University of Bamberg, Germany
                                                  thomas.heinz@uni.bamberg.de

                                                                       Abstract

    The development and balancing of location-based games is challenging, because the gameplay depends on local environmental conditions. A
    tool based analysis of common game mechanics could provide a remedy for this problem, but requires precisely defined gameplay patterns.
    This paper presents systematic selection of spatio-temporal game design patterns together with a software tool, able to simulate location-based
    gameplay in different spatial environments.

      Keywords: Geogames, Location-based Games, Game Design Patterns, Agent-Based Simulation


1     Introduction                                                         postconditions for each pattern. There are no detailed
                                                                        descriptions for every pattern in this work, instead an
    Keywords: location-based games, game design patterns, agent-based simulation
In video- and board game design, patterns are long established             exemplary account of only one pattern is included. Rather than
tools. These design patterns are used to gather inspiration,               concentrating on elaborating on individual items, the focus lies
communicate with peers and professionals or solve design as                on giving a clear and straightforward definition of a variety of
well as interaction problems. Extensive collections for these              related patterns. A software tool has been created which is able
types of games have been compiled by various authors (e.g.                 to simulate the introduced patterns in different geographic
Bjork/Jussi 2004). When it comes to pattern libraries, location-           environments, giving designers the opportunity to explore
based games have not received an equivalent amount of                      advantage and disadvantages of each pattern under different
attention although first attempts have already been made to                conditions.
compile lists of patterns that cover design aspects new to                   The remaining paper is structured as followed: In section 2
mobile location-based games (Will 2013, Davidsson 2004).                   the approach to systematic exploration of spatio-temporal game
The authors gathered these patterns by analysing a selection of            design patterns is given. This is followed by a list of the patterns
existing games. Patterns discovered that way are related to a              found. As an example, one of the patterns is described in further
wide variety of very different aspects – starting from technical           detail. In section 3 the simulation framework, that serves as a
related features up to the social consequences of putting a                basis for the simulation routines that implement identified
player into an outdoor environment. However, authors stress                game design patterns, is introduced. The practical benefits of
that these pattern lists are far from being complete and have to           this application are discussed and the visualisation output is
be extended continuously by increasing the number of analysed              portrayed. Finally, I conclude with a discussion of lessons
games. Most pattern languages give the definition, usage                   learned and give an outlook on future research.
description and resulting outcome to a reoccurring game
mechanic. Typically, these facts are described textually, but are
not defined in any kind of formal language (Dormans 2013).                 2      Pattern Exploration
The issue of giving a formal description of a defined subspace
of design problems has not been sufficiently addressed by                  The purpose of this library of location-based game design
research so far. Using formal description, location-based game             patterns differs from that of other collections. Its intention is
patterns could be implemented into software tools, that would              not just to collect patterns that are applied in existing games,
be able to support game designers in exploring strength and                but to maybe even uncover, describe and name unknown and
weaknesses of given designs just by adjusting various                      never before used patterns that could be implemented in future
parameters. Tools like these could overcome the difficulties,              generations of location-based games. For this reason, the
developers face in location-based game development                         collection process was not researching a selection of existing
(Jacob/Coelho 2011).                                                       games. Instead I chose a proven game model as starting point
  In this paper I present a systematic approach for the                    for the analysis, the player model of Heinz and Schlieder
identification of a subset of spatio-temporal design patterns for          (2015). This player model abstracts from the details of specific
location-based games. By means of a self-imposed restriction               location-based games by providing generic descriptions of the
to the examined problem space, I am able to give pre- and
   AGILE 2017 – Wageningen, May 09-12, 2017




game elements needed for modelling a wide range of game               Differentiating between the geometry types for places and the
mechanics.                                                            specification that places cannot act on themselves, three
   The geogame model allows for a multitude of different              couples of entities can be identified:
relations between the game entities it defines, such as                         Player – PoI
topological, Euclidean and also independencies between entity                   Player – RoI
states. The possible outcomes are too numerous to be all                        Player – Player
covered in a first exploration/collection process. Therefore,         The game patterns will describe relations between the entities
further restrictions were imposed. Patterns should initially only     of each couple that belonging to the perception of the player,
refer to the relation between the two most important entities.        that can also be applied to the geometries of the entities. Two
These are:                                                            fundamental relations provide the basis for the pattern
   Players: The most essential element of every game. In the          exploration procedure:
case of location-based games, players move through their                Equals/Contains: Relates to the position of the geometries
geographic environment while trying to win the game by                and indicates whether a player is located directly at a place or
executing given game actions. In this process players                 shares his/her location with another player. Small differences
experience their environment. The knowledge about this                in the position can be neglected depending on the respective
environment is enriched by data displayed on devices – in most        application. This subsection of the region connection calculus
cases smartphones or tablets – running the game application,          (RCC) (Randell et al., 1992) was chosen because it plays the
displaying a map that visualizes entities relevant for the player.    most important role in games, already implemented on top of
   Places: A finite set of (immobile) areas of interest in the        the geogame model. Other RCC relations will be evaluated in
geographic environment. Game actions are often bound to               future works.
corresponding places and a player can only execute them if              Line of Sight (LoS): Indicates whether a line of sight between
he/she is located there.                                              the player and other entity exists. The line of sight may be
   Every game application has to contain an implementation of         blocked by the environment the player is moving through. Any
its relevant game mechanics and has to be able to decide over         kind of entity state changes are ignored.
the outcome of this game. Hence, virtual representations of
relevant game entities have to be stored. Location-based games
also require the software to have a GIS component that handles        2.1     Spatio-temporal Pattern Listing
the position and geometries of mentioned entities. In almost
any location-based game, players are reduced to simple point          For a first pattern listing, each pattern will be defined by a
objects. In the case of places, the respective GIS objects are        change of the connection between an entities couple. Both
chosen depending on game mechanic use cases. Sometimes it             relations can be observed separately or in interpendence with
is sufficient to store the place as a point (point of interest). If   each other by building the Cartesian product of each relation
the game mechanic needs to calculate exactly whether the              and its negation. In the latter case not all combinations are
player is located inside a specific region, this place (region of     possible because a LoS is automatically in existence if the
interest) has to be linked to a polygon geometry.                     equals/contains link is evaluated to be true. In table 1 all of the
   Game design patterns that will be explored in this work            45 different relations between the entity couples are listed.
specifically refer to the virtual representations (PoI, RoI) of       Each entry represents a game design pattern and was given a
involved game entities. These representations are also used           name. Some of the pairing’s patterns offer a lot of similarities.
when the game decides on the outcome of a game action.                This is also shows in the pattern names, which in some cases
Therefore, they play a central role in the balancing of game          read exactly the same because identical game mechanics are
mechanics. Area of focus of the patterns will be the player.          applied to different kind of game entities.

                                 Table 1: Listing of selected spatio-temporal game design patterns
      Precondition      Postcondition          Player - POI                 Player - RoI                      Player - Player
          ¬EQ                EQ                     Go to                         Enter                            Meet
           EQ               ¬ EQ                   Leave                         Leave                           Separate
         ¬ EQ               ¬ EQ                 Stay away                       Avoid                         Stay separate
           EQ                EQ                    Stay at                     Stay inside                     Stay together
         ¬LoS                LoS                Get in sight                   Get in sight                     Get in sight
          LoS               ¬ LoS              Get out of sight              Get out of sight                 Get out of sight
       ¬EQ, ¬LoS             EQ               Search and go to              Search and enter                    Search and
                                                                                                                   meet
       ¬EQ, LoS              EQ                        Go to                          Enter                        Meet
         EQ               ¬EQ, ¬LoS                 Leave and                      Leave and                 Separate and hide
                                                  get out of sight               get out of sight
           EQ              ¬EQ, LoS                 Leave and                      Leave and                   Separate and
                                                   stay in sight                  stay in sight                stay in sight
       ¬EQ, ¬LoS           ¬EQ, LoS                  Look for                       Look for                     Look for
        ¬EQ, LoS          ¬EQ, ¬LoS              Get out of sight               Get out of sight                Hide from
       ¬EQ, ¬LoS          ¬EQ, ¬LoS              Stay out of sight              Stay out of sight            Stay out of sight
        ¬EQ, LoS           ¬EQ, LoS                Stay in sight                  Stay in sight                Stay in sight
                                                                                   AGILE 2017 – Wageningen, May 09-12, 2017




2.2    Example Pattern Description                                  3       Simulations Routines

The following short description for one of the listed patterns      Technical details and a detailed walkthrough of the simulation
will serve as an example for an entry as it will be found in the    framework created especially for the exploration of said
pattern library. Whenever possible, pattern names as well as        patterns will be omitted. These will be explored in a follow-up
pattern descriptions will be given from the perspective of the      work. Nevertheless, a short description will be given to explain
player.                                                             the advantages over established agent-based simulation
                                                                    frameworks.
        Figure 1: Symbolization of the game mechanic                  The simulation framework is based on a heavily modified
                                                                    version of the agent-based simulation framework MESA1
                                                                    (Masad/Kazil 2015). One of the most interesting features of this
                                                                    software is the ability to create HTML based visualizations that
                                                                    are updated and can be made interactive via websocket-
                                                                    protocol. It is intended to embed said visualizations into local,
                                                                    HTML based notebooks. These notebooks are being used as
                                                                    “interactive computational environment, in which you can
                                                                    combine code execution, rich text, mathematics, plots and rich
                                                                    media”2. By switching the “visualization server” component of
                                                                    the framework it was modified in such a way that simulation
                                                                    visualizations can be served over the internet. This enables
                                                                    users to use the software through a browser on any device
                                                                    connected to the internet and removes the need to install
Pattern title: Search and enter                                     additional software. The simulation server was embedded into
Preconditions: ¬EQ, ¬LoS                                            a Django-Channels3 application. This enables not only the real-
Postconditions: EQ                                                  time communication between clients and the server but also
Explanation: The players goal is to enter the RoI geometry. At      makes it possible to integrate user and rights management to
the beginning, the player has no line of sight to the RoI. The      the application, that can be applied to the execution of
player may, however, have knowledge about the location of the       simulation runs. Registered users are able to create their own
RoI via textual description or any kind visualization of the RoI.   configurations for each pattern routine listed in section 3.
The player moves through his/her geographic environment in          Figure 2 shows a simple setup for the search and enter pattern
search for it. The pattern is terminated once the player has        made, using the editor. Users of the editor can draw and edit
entered the geometry defined by the RoI.                            vectors and geometries on a map. By doing this, they are
Sibling patterns: Search and go to, Search and meet                 creating game entities. Created editor configurations are saved
                                                                    into a database and can be edited later as well as shared with
                                                                    other users via a hyperlink. To make location-based simulation
                                                                    possible, MESA was extended by a GIS component. This

                              Figure 2: Creating a pattern configuration with the browser based editor




  1 https://pypi.python.org/pypi/Mesa/                                  3 https://github.com/django/channels
  2 https://ipython.org/notebook.html
     AGILE 2017 – Wageningen, May 09-12, 2017




                                Figure 3: Visualization of a location based game design simulation routine




component uses the well-known python libraries “shapely”4             a hyperlink. This will further improve communication about
and “pyproject”5. To enable simulations with realistic player         problems or benefits of applying game design patterns to
locomotion the routing functionality presented in Heinz and           certain conditions.
Schlieder 2015 was recreated. A browser based visualization of          A next topic to explore are the combinations and interactions
a pattern simulation is shown in figure 3. To create map based        between different patterns. Computational tools will be added
visualizations, the software library “leaflet”6 was used. Map         on top of the existing simulation routines. This will help
tiles originate from the OpenStreetMap project. Both, the             designers with the task of balancing game mechanics for
editor, as well as the simulation visualization web application       specific spatial environments.
are also able to run on mobile devices (e.g. smartphone, tablet).
As a consequence, simulation configurations and simulation            References
runs can be created/run on-site if desired. Depending on the
kind of pattern, each game entity, placed in a configuration, is      Adams, E. and Dormans, J. (2012). Game mechanics: advanced
associated with a specific, built-in agent-behavior. Agents act            game design. New Riders.
in such a way that they try to transform a patterns state from the    Davidsson, O., Peitz, J. and Björk, S. (2004). Game design
given preconditions to the specified postconditions. In doing so           patterns for mobile games. Project report to Nokia
they try to match human player behavior in the same way as it              Research Center.
is described in Heinz and Schlieder 2015.                             Dormans, J. (2013). Making design patterns work. In
                                                                           Proceedings of the Second Workshop on Design Patterns
                                                                           in Games, DPG ’13.
4       Discussion and Outlook                                        Heinz, T. and Schlieder, C. (2015). An Agent-Based
                                                                           Simulation Framework for Location-Based Games.
This paper presents a small selection of location-based game          Jacob, N. and Coelho, A. F. (2011). Issues in the development
design patterns. In the future the library of game design patterns         of location-based games. International Journal of
is going to be extended. Moreover, it will be easily applicable            Computer Games Technology
to wide variety of game design problems due to its usage of an        Masad, D. and Kazil, J. (2015). Mesa: An Agent-Based
abstract game model. Usage and implementation of the                       Modeling Framework. 14th PYTHON in Science
described patterns is facilitated by their formal description.             Conference, 53-60.
  The simulation of these patterns via a web based simulation         Randell, D., Zhan C., and Anthony C. A spatial logic based on
framework already works flawlessly. Being able to set up self-             regions and connection. KR 92 (1992): 165-176.
chosen configurations in all kinds of geographic environments,        Schlieder, C., Kiefer, P. and Matyas, S. (2005). Geogames: A
without the need for any kind of special hardware seems like a             conceptual framework and tool for the design of location-
promising approach for designers of location-based games and               based games from classic board games. Intelligent
applications. With this kind of simulation framework – usable              Technologies for Interactive Entertainment, 164-173.
on any portable device – users are able to create and simulate        Will, C. (2013). A Pattern Language for Designing Location-
pattern configurations for site specific game mechanics, while             based Games. Diploma Thesis, RWTH Aachen
being on-site and making themselves familiar with the                      University.
environment. Users can easily share simulations with others via

    4 http://toblerity.org/shapely/project.html                         6 http://leafletjs.com/
    5 https://jswhit.github.io/pyproj/