• No results found

A Study on Fitness Functions and Their Impact in PCG

N/A
N/A
Protected

Academic year: 2021

Share "A Study on Fitness Functions and Their Impact in PCG"

Copied!
18
0
0

Loading.... (view fulltext now)

Full text

(1)

Faculty of Technology and Society

Department of Computer Science and Media Technology

Master Thesis Project 15p, Spring 2018

Supervisors:

By

A Study on Fitness Functions and Their Impact in PCG

Simon Johansson

José Maria Font Fernandes

Johan Holmgren

Examiner:

(2)

Contact information

Simon Johansson

E-mail: simon.johansson@fjelie.com

José Maria Font Fernandes

E-mail: jose.font@mau.se

Malmö University, Department of Computer Science and Media Technology.

Johan Holmberg

E-mail: johan.holmberg@mau.se

Malmö University, Department of Computer Science and Media Technology.

Johan Holmgren

E-mail: johan.holmgren@mau.se

Malmö University, Department of Computer Science and Media Technology.

Author:

Supervisors:

(3)

A Study on Fitness Functions and

Their Impact in PCG

Simon Johansson

simon.johansson@fjelie.com

Master’s Programme (one-year)

Computer Science and Media Technology

Malm¨o University

Sweden

Abstract—Procedural Content Generation (PCG) is a tool for developers to take advantage of the computational power of the computer in order to create new content. There are many different method that a PCG program is able to utilize but finding the most optimal may be very challenging. In this paper we improved Evolution Dungeon Designer (EDD) [1] by integrate symmetry and similar fitness function. We evaluated them with experiments and a user study that involved participants that are active in the field of game development. We can see that both symmetry and similar functions can easily be integrated for creating 2D dungeon rooms but has the potential of overwhelm the existing functions.

Index Terms—Procedural Content Generation, Symmetry, Mixed-initiative, Dungeon Rooms.

I. INTRODUCTION

Procedural Content Generation (PCG) is an ever growing topic in gaming which helps game developers create content within their games. It is a tool that takes advantage of the computational power of the computer to create content. It can be applied to almost everything, items that the player find or the map that they play on. If done properly it is something that will fully immerse players into their games.

Symmetry is a natural phenomenon and can be found everywhere in nature. It is so common that we usually don’t realize just how much exist in the environment seen in Figure 1. The reason we would like to replicate symmetry in games is it represents a natural feel and we already model most of our architecture based on symmetry.

Figure 1: Symmetry shown in fruit and foliage

Mixed-initiative interaction is a method that includes both a computer and a human in the calculation of the generator. This is mostly done by having an User Interface (UI) that the helps a human manipulate values to produces different results. Mixed-initiative is not something new and has been explored

upon in other different fields but is uncommon to find within game design.

Evolutionary Dungeon Designer (EDD) is a tool created by Baldwin and Holmberg [1] that with the help of a game designer is able to create 2D dungeon rooms. This is achieved by combining several different mechanisms with the core PCG method being a genetic algorithmic function that holds the information of the dungeon room. A dungeon room in 2D gaming context means an area containing small rooms, corridors, enemy’s and treasure. This together with analyzing game design patterns and mixed-initiative interaction creates the structure of the tool. Having access to the code and creator of the tool makes a good ground to continue and base a study on.

EDD’s User Study[1] gave relevant feedback on the limita-tions of the old EDD version. We analyzed their user study and evaluated improvements that we implemented, experimented and underwent our own user study. The two biggest elements that the participants felt missing from the suggested dungeon rooms was symmetry within the room and being able to give slight variants of rooms from the one that they are working on. Based on these feedback we provided the new version with both a symmetry and similarity fitness functions that determine the outcome of the generated rooms.

A. Motivations

Today’s modern games have evolved to become more time and cost consuming to produce which makes it more risky for a company to create games. The rising costs are mainly due for the modern gameplay that a player has grown accustom of receiving and having to build a massive world that draws them in. This is why Folmer [2] tries to tackle these rising cost by building a Component Based Game Development Architecture which gives an overview of developing games and their components. This lets the game companies be able to more optimally build their games. Future more to combat the rising cost of game development it has become more popular to utilize the computer to create content for the player to find or explore. This is called Procedural Content Generation (PCG) and has helped multiple companies publish their games successfully at a reduced cost [3][4][5]. PCG is already explored today in Hendrikx’s et al. [6] survey that evaluates games that utilize PCG in creating their content.

(4)

While PCG may be a great way of reducing cost, it is difficult to creating a generator that is able to produce content with a natural feel on the layout it produces. There are also various approaches in developing a PCG program but finding the most optimal method is very difficult. This is why we took a look at Baldwin and Holmberg’s Evolutionary Dungeon Designer [1] and implement our symmetry and similarity fitness function. We later analyzed the effect it causes on the content that it produces through experiments and a user study.

B. Goals and Research Questions

The main goal is to create a PCG program that produces content that a person can not or has difficulties in distinguish-ing from somethdistinguish-ing that a game designer created. While we may not come close to achieving this goal, we may improve on top of the existing EDD [1] with methods we review in Section II [7][8][9].

This was achieved by using three step. First step is to analyze EDD 2.0 and the dungeon rooms it produces before any modifications have been made. Second step is to integrate our symmetry and similarity fitness function in their generator creating EDD 3.0. This will be done in an iterative cycle in order to most optimally incorporate our implementation. The last step will be comparing dungeon rooms that both versions create to give us enough data to justify if there has been any improvements.

• RQ: Will symmetry and/or similarity fitness function improve the overall usage of suggested dungeon rooms that EDD produce?

II. RELATEDWORK

To get a better understanding on Procedural Content Gen-eration (PCG) and the difference between approaches when creating a program, it becomes crucial to gain knowledge on how previous work were implemented.

A. Symmetry

Lightman explores in his book [7] why we are drawn to symmetry and how we can understand these patterns by first studying nature. He theorized that nature is an ongoing experiment that strives to find that which cost the least energy or that require the fewest different parts to come together. Mimicking nature’s symmetry into EDD may increase quality for the dungeon rooms.

Symmetry is also found in architectural design and prevalent in almost every building we have today. This is why Mitra and Pauly [10] devised an algorithm that is able to scan and detect how much symmetry found on objects. We may not use their algorithms to calculate symmetry but it will help us defining how to find symmetry for our program.

B. Mixed-Initiative

First by understanding what Mixed-Initiative is will help us get a better grasp of how to guide us in our project. In 1997 Novick and Sutton created a paper [11] which explores issue

of factors by analyzing a series of scenarios. Even though the paper is old, the basic concepts still apply to today’s standards. The scenarios they explore are only fictitious exchanges be-tween a user and a program. With these scenarios they were able to introduce some ideas that give rise towards a theory that is still relevant today.

Some more recent papers that have integrated a mixed-Initiative interaction into their application can be seen with Smith et al. when they worked on their project “Tanagra” [9]. They created a level design tool that with the help of a human be able to create 2D platforms. The program works by having the PCG methods validate and mutate the platform while a human gives input of what to save and change.

C. PCG in Games

Ashlock et al. with their paper [8] created a program that is able to generate maze like levels for the use in game. They built five different fitness functions which influence a single value that indicates the quality of the created content. It showed that the the five different functions gave different results and is the major factor of the outcome for the content that they produce. This shows that fitness functions can be unpredictable but manageable and heavily relies on the weight each fitness function receives. It will be crucial when we integrate symmetry in EDD to not overwhelm the already existing fitness function values.

Baldwin and Holmberg’s work [1] is a good example of infusing mixed-initiative interaction [11] with a game design tool. With the help of a human their program is able to create and modify a room represented as a 2D grid that holds treasure, entrances, monsters, walls and exits. Unlike what Smith et al. [9] applied in their prototype by only using input from the human, Baldwin and Holmberg [1] have integrated game design patterns for generating rooms by finding different patterns within the room and categorizing them into different chambers. This is to make it easier to grasp what patterns exist and reduce the computational power for the program by working on a higher level of detail.

III. RESEARCHMETHODS

With the methods we researched in section II and under-standing most of the different approaches of PCG, we are more able to delve into EDD [1] by modifying their fitness function with our symmetry and similarity functions.

In this chapter we discuss the chosen Research Methodology and approaches that were used in our study. It is important to understand what needs and contributions our research contain before deciding what methods that we will be using. We decided to use a design science research approach in creating our Procedural Content Generation (PCG) while using both experiments and a small user study to conclude if our implementation improves the results.

A. Design Science

Because our study is built on top of EDD’s [1] room generator then it becomes most logical to use a design science

(5)

approach in conducting our research. We will be following a framework from the Design Science Research Methodology (DSRM) written by Peffers et al. [12] which follows 6 dis-tinct optional steps shown in Figure 2 that follows: problem identification and motivation, definition of the objectives for a solution, design and development, demonstration, evaluation and communication.

Figure 2: Design Science Research Methodology from Peffers et al. [12]

We have already identified the first two steps in previous section I-A and II with our “motivations” and “objectives of a solution” by understanding the need for symmetry and how to implement it. For the remaining steps we will be designing the new PCG by creating our artifact with the help of the symmetry functions. Later we will be demonstrating and evaluating them by both experiments and later a small user study. This is to see if our solution have improved EDD in terms of generating 2D dungeons rooms that resembles more of what a person would have done.

B. Experiments

By having analyzed the feedback that EDD received during their user study [1] we chose to improve upon some aspects that were lacking. With the new PCG version we examined if any improvements where made from the original. For this we, at each iteration of the iteration process, use quantifiable measurements on the fitness functions to conclude if the new PCG method is suitable for the application. The independent variables during our experiments were aspects that define the rooms by corridor ratio, chamber ratio [1] and our new aspects created in iterations. The dependent variable will be the dungeon rooms in form of images. Afterwards we will be evaluating each to see if there has been any improvements.

C. User Study

In addition of using a Design Science approach for improv-ing the PCG within EDD did a user study to conclude if our newly improved version gives better results from a perspective of from the original. We conducted this user study based on the framework of how Baldwin and Holmberg’s managed their user study on EDD [1]. This is to reduce any variables in the process and give a fair result in the comparison between the two different versions. We took advantage of guidelines that Runeson and H¨ost [13] created to be able to structure the whole process more thoroughly with data collection and interviewing.

D. Limitations and Threats to Validity

Procedural Content Generation (PCG) is a broad term and includes many different field so it’s important to note that our study only focuses on generating 2D dungeon rooms that games will be played on. Our study will optimize and

improve on top of Baldwin and Holmberg’s EDD [1] which is a good foundation and eliminates the need to create everything from scratch. We also had contact with one of the creators of EDD who helped explain their code, thus facilitate improvements to the existing code.

IV. EVOLUTIONARYDUNGEONDESIGNER

It is important to get a basic understanding on what Evo-lutionary Dungeon Designer (EDD) [1] is and what we are able to modify. EDD consists of two primary components, a graphical UI and the generator. We will only focus on the generator because that is where we are able to modify in order to our run experiments and assess whether symmetry enhances the generated content.

A. Building Blocks

The current version of EDD consists of six different building blocks that represents doors, enemies, entries, floors, treasures and walls. Together they form a n ∗ m size room which at minimal holds at least one of each tile. Both the tiles and the a finished room can be seen in figure 3.

Figure 3: Shows all the different tiles and a generated room

B. Generator

EDD’s generator consists of having multiple individuals inside a population that over numerous generations will breed new populations. This is done by merging their genomes with each other with a chance of mutation in order to breed the most superior room.

(6)

1) FI-2pop GA: The overlying structure of the generator is based upon Kimbrough’s et al. [14] implementation of utilizing the feasible-infeasible two population genetic algo-rithm (FI-2Pop). The biggest significant change is having two populations: feasible and infeasible. By separating these two populations they are able to have their own distinct functions that operate in different ways. The feasible population hold all rooms that pass all the criteria for a room to be functional, e.g. all floor tiles are connected and no doors are blocked. If they don’t meet the criteria then they will move to the infeasible population. Inside this population the function is more aggressive in evolving the rooms to make them feasible again.

2) Spacial Micro-Patterns: By grouping adjacent tiles to-gether we are able to form patterns that we are able to be classified and later be identified in the generator. The 5 basic of these patterns are: Chambers, Corridors, T-junctions, turns and Intersections which can be seen in figure 4. With these patterns they are able to categorize different parts of the room to help with determining the fitness function.

Figure 4: All micro-patterns that can be found in EDD

3) Meso-Patterns: Meso-patterns are formed from the micro-patterns in order to produce a map from a grid which categorizes the rooms and corridors with different properties. Figure 5 shows five of the different meso-pattern that are recognized by the generator. These just as micro-patterns which broaden the tools that the generator is able to utilize in order to create new and unique fitness functions.

Figure 5: Shows the five Meso image representation that can be found in EDD

V. IMPLEMENTATIONS

In this section we will be taking a look at how we im-plemented our fitness functions together into EDD and show implications that we had during the process.

A. Symmetry Implementation

Symmetry can be defined differently depending on the scale of which you measure by. It can range from measuring each room individually to the whole room which will yield totally different end results. We are however limited by the time it will take to compute these values. This is because EDD’s dungeon evolution of the rooms goes through 150 generations with each generation evaluating 100 individuals in the population. That is why the computational speed is the biggest factor in deciding how we will be implementing the symmetry functions. This is why we chose to focus on the macro scale by splitting the room into two sides with a center line in the middle. Which gives us an O(n) and makes the function linear in time cost. At the same time, there are unlimited ways of deciding what degree the center line should have. But for simplicity’s sake, we chose to only evaluate 4 different angles. Figure 6 Shows the different symmetry splits that accrue in the calculations: horizontal, vertical, backslash-diagonal and frontslash-diagonal.

Figure 6: Symmetry splits scanned during the symmetry fitness function

To calculate the symmetric value that the room consists of we evaluate every tile on one side of the split with the corresponding tile on the other side. By adding together all the walls that are symmetric we are able to calculate a curve ranging from 0 to 1 that will represent our fitness value. How we define the curve will alter the end result of the room. With small testing we found that a linear curve yielded best results with the equation 1.

symmetry = wallsW ithSymmetry

totalW alls (1) To integrate our newly developed symmetry fitness function we had to include it to the existing calculations seen in Equa-tion 2. a, b and c are weights that define the outcome of the generator. We needed to find right weights for each functions otherwise they may overwhelm and negate the others.

ff itness(r) = a 10finventorial(r) + b 10fspacial(r) + c 10fsymmetry(r) (2)

(7)

1) Implementation Issues: When we implemented the first iteration we quickly saw mayor issues with integrating the symmetry fitness function into their system. We saw that we were heavily weighting the symmetry fitness based on the percent similar walls found on both sides. This became an issue because it was culling to many walls to make it symmetric while somehow maintaining both the mesa and micro-pattern generation. this can be seen in figure 7 and without any prevention will not yield maps that looks engaging for a player.

Figure 7: Symmetry implemented without wall culling preven-tion

The foremost issue that we needed to address was reducing the culling of walls that the new symmetry function produced. To combat this issue we devised a temporary function that takes in consideration of an ideal lowest limit of walls. we called this value lowestW allCount and if the total walls in the room is under this value, then we reduce the symmetric fitness value.

symmetry = symmetry ∗ wallsInRoom

lowestW allCount (3)

With this function we were able to both achieve symmetry for the rooms while also prevents the generator to favor more walls. Figure 6 shows the effect from this function.

B. Similarity Implementation

Based on the user study that EDD presented [1], the participants wanted it to be able to produce rooms that give slight variations of the current room that they are working on. This gave us the solution of implementing a similarity fitness function. Just as we implemented symmetry in Section V-A, we needed to have the function give us a an O(n) in computational speed because of the vast rooms that needs to be generated. This is why we chose to compare every tile from the original with the corresponding tile of the generated room. This gave us a value which represent how many tiles that are similar on both rooms. We also chose to ignore enemies and treasures in the calculation because we are only looking for the overall structure of the room. The process can be seen Figure 8 which shows what tiles that are counted in the fitness function.

Figure 8: Image (a) shows the original room while showing the different changes that are present from the generated room in image (b)

To calculate the similarity value between the two rooms, we need to divide the number of similar tiles with the total amount of tiles in the room which can be seen in Equation 4.

percentSimilar = totalT iles − notSimilarT iles totalT iles (4)

Having a room that is 100% similar is not desirable when trying to give slight variation of the rooms. This is why we implemented a curve in the function that weights the final fitness value on how similar the two rooms are. the curve is based on an input parameter for the function which we called idealP ercentSimilarity. When the given parameter is set to 0.9 the final fitness value will become 1 if the percentSimilar value calculated before also has the value 0.9. The graph in Figure 9 show in a visual way what values the final fitness function will receive based on the percentSimilar.

Figure 9: This represents visually what the final fitness value will become when the idealP ercentSimilarity parameter set to 0.9 (the red line)

We needed to include 2 calculation for the final fitness value in order to get a value between 0 and 1 and is determined by the idealP ercentSimilarity. If the percentSimilar is

(8)

under the idealP ercentSimilarity then we use Equation 5 otherwise we use Equation 6.

similarityF itness = percentSimilar

idealP ercentSimilarity (5)

similarityF itness = 1 − percentSimilar

1 − idealP ercentSimilarity (6) Now that we have our similarity fitness value, we need to integrating it with the existing functions. Because we want it to generate similar rooms we put a heavier weight on the fitness value over the other existing functions. This leads us to the integration seen in the Equation 7 which shows how our similarity value multiplies the existing functions in order to produce the final fitness value.

ff itness(r) = ( 1 2finventorial(r) + 1 2fspacial(r)) ∗ fsimilarity(r) (7)

C. Similarity & Symmetry Integration

Because our study involves integrating both symmetry and similarity into EDD, we wanted to see how they interact with each other. Because our implementation were made dynamically, we therefore just need to connect the two fitness functions together with the original. This can be seen in Equation 8 how we combined both integration’s together into the calculation. ff itness(r) = ( a 10finventorial(r) + b 10fspacial(r) + c 10fsymmetry(r)) ∗ fsymmetry(r) (8) VI. EXPERIMENTS

These experiments will take a look at the ramifications each new fitness function brings to EDD and how we can most optimally integrate them with each other. These experiments were performed in three iterations: first experimenting the two fitness functions separately and then when they are combined. This was to determine if they were able to work together and what values that are acceptable that we used in the user study.

A. Variable Parameters

For all of the experiments each room are generated from a gene that determine the outcome. By altering these values we made 4 distinct rooms that we test in our experiments. These rooms consist of themes ranging from corridor, big, medium and small chambers. The parameters in the gene are as followed:

• Target chamber ratio, Tchamber

• Target corridor ratio, Tcorridor

• Target chamber area, Tchamberarea

• Target corridor length, Tcorridorlength

• Squareness weight, Wsquareness

• Size weight, Wsize

• Turn quality, QT

• Turn Intersection Quality, QI

B. Symmetry Experiment

During these experiments we altered the ratio and weights that effect the micro-pattern. This is so that we can see if the symmetry function behaves differently and if there are some irregularities. Every experiment will be executed four times. First without any symmetry and the others with different values of symmetry so that we can compare each versions and observe if the symmetry function over weighs or neglects the other values.

1) Experimental Setup: Each test ran a total of 100 times that consist of 150 generations with a total of 100 individuals in the population. We generated each room with 11x11 tiles and analyzed in total of 23 combinations of the following input parameters seen in Section VI-A in addition of: Room symmetry weight, Wsymmetry.

2) Results: In this section we will be taking a look at samples taken from the batch cases that were created during the experiment. Each result will contain the same micro-pattern values which were chosen based on the type of room we want to create. the results will be presented with four different rooms with the variation being the Wsymmetry values ranging from 0 to 0.6.

Figure 10: From (a) to (d) the Wsymmetry weights are, in order: 0.0, 0.2, 0.4 and 0.6.

Figure 10: (a) shows expected results from the parame-ters from the configuration: Tchamber = 1, Tcorridor = 0, Tchamberarea= 9, Tcorridorlength= 2, Wsquareness= 0, Wsize = 1, QT = 0.7, QI = 0.3. With only having Wsymmetry = 0.2 in image (b) we see how symmetry has integrated into the overall structure while still holding the same format as (a). However when we increase the Wsymmetry as seen in (c) and (d) we notice a significant deviation from the (a) by ignoring the micro-patterns and favoring symmetry.

(9)

Figure 11: From (a) to (d) the Wsymmetry weights are, in order: 0.0, 0.2, 0.4 and 0.6.

Figure 11: (a) shows expected results from the parame-ters from the configuration: Tchamber = 1, Tcorridor = 0, Tchamberarea = 25, Tcorridorlength = 3, Wsquareness = 0.3, Wsize= 0.7, QT = 0.7, QI = 0.3. We see a faster decline in consistency with (b) with Wsymmetry= 0.2 starting to deviate from (a) by opting for smaller rooms. It only get progressively worse with (b) and (c).

Figure 12: From (a) to (d) the Wsymmetry weights are, in order: 0.0, 0.2, 0.4 and 0.6.

Figure 12: (a) shows expected results from the parame-ters from the configuration: Tchamber = 0, Tcorridor = 1, Tchamberarea = 9, Tcorridorlength = 3, Wsquareness = 0.4, Wsize = 0.6, QT = 0.1, QI = 0.9. With these values we see that the generator is able to retain the structure of (a) at higher values of Wsymmetry. It starts to become noticeable at (d) that it is starting to loose the format.

Figure 13: From (a) to (d) the Wsymmetry weights are, in order: 0.0, 0.2, 0.4 and 0.6.

Figure 13: (a) shows expected results from the parame-ters from the configuration: Tchamber = 1, Tcorridor = 0, Tchamberarea = 49, Tcorridorlength = 4, Wsquareness = 0.5, Wsize = 0.5, QT = 0.5, QI = 0.5. With these extreme values we see that (a) doesn’t construct any form of concrete design. However as the symmetry value increases with (b)(c)(d), we see increased structural layout that forms more solid room designs.

3) Analysis & Discussion: During the experiment we an-alyzed a broad range of different possible input for the generator. Every input was able to get desirable results but at different Wsymmetry value. The biggest factor for this lie in the size of the desired rooms and the weight they hold. This can be seen in figure 11 and figure 12 which shows large rooms starting to deteriorate from the desired values much more earlier than rooms with only corridors. This may be caused by the breeding process of the population which causes ideal micro-patterned rooms to be split. The problem stems from the low chance of getting paired with another room that produces the ideal size of the room. This causes it to instead favors higher fitness values from the symmetry function.

When we sifted through our symmetric batches of rooms, we saw a greater number of rooms that were created symmetri-cal on the diagonal and we rarely saw any that were horizontal or vertical as displayed in Figure 6. This becomes a potential problem of not being able to produce the whole spectrum of symmetrical rooms. This may be caused by the difficulties of having rooms horizontal/vertical with corridors connecting them. However, it could be fixed with adding weights for the different symmetrical splits.

We also saw strange behavior when the generator was given extreme values such as in figure 13. The rooms created without any symmetry produced minimal numbers of walls which leaves the room undesirable to use. However when the symmetry function was added we saw improvements on how the rooms were structured. Even if they stray away from the desired input, the end results have become more desirable.

(10)

While we didn’t have major issues integrating the symmetry function into EDD [1] we did found out, just as Ashlock et al. [8], that the input for each fitness function drastically changes the output of the content. However after many attempts, we were able to alter the fitness functions to get desired results. Just as nature has built symmetry into their patterns [7], we have successfully been able to implement symmetry in EDD’s design which has further increased the possibility of unique dungeon rooms that the developer can choose from. Because we are so drawn to symmetry as seen with building designs [10] we therefore have increased the overall attraction to the dungeon rooms.

C. Similarity Experiment

These experiments will show how the generator is able to produce similar room given a specific room. We will be following the same setup as the symmetry experiment in Section VI-B where every experiment will be executed four times. First image is the given input room and the others three are generated rooms with different values of similarity. this will make us able to compare each versions and observe to what extent the maps are deemed as similar.

1) Experimental Setup: We ran each test a total of 100 times which consist of 150 generations and a total of 100 individuals in the population. Because the similarity function needs a room as an input, we will be using their gene values for the generator. We analyzed in total of 18 different rooms that holds the following variable parameters found in Section VI-A. The only value that will change during each test is the similarity weight (WSimilarity) which determines how much percent similar the generated map strives to become.

2) Results: The rooms are taken from the batches produced during the experiments. Each test case was generated from a single rooms that created similar rooms with different degree of Wsimilarity. We demonstrate our results with 4 images taken from each batch with the first being the original while the other 3 having Wsimilarity values between 0.85 to 0.95 percent similar.

Figure 14: Image (a) is the original room with (b) to (d) having WSimilarity weights in order: 0.95, 0.90 and 0.85.

Image (a) in Figure 14 has the gene configuration: Tchamber = 1, Tcorridor = 0, Tchamberarea = 9, Tcorridorlength = 2, Wsquareness= 0, Wsize= 1, QT = 0.5, QI = 0.5. When creat-ing rooms with small chambers we can see that WSimilarityof 0.95 and 0.9 generates rooms with slight variation and doesn’t alter the overall room to a greater degree. However at 0.85 we begin to see how the room begins to change with chunks of walls appearing at different locations.

Figure 15: Image (a) is the original room with (b) to (d) having WSimilarity weights in order: 0.95, 0.90 and 0.85.

Image (a) in Figure 15 has the gene configuration: Tchamber = 1, Tcorridor = 0, Tchamberarea = 25, Tcorridorlength = 3, Wsquareness = 0.3, Wsize = 0.7, QT = 0.7, QI = 0.3. Rooms with medium sized chambers seems to be able to hold the overall theme of the original even with WSimilarity of 0.85 beginning to diverge from the structure. This is mostly due to the room is surrounded by walls which takes a big share in the calculation of similarity.

Figure 16: Image (a) is the original room with (b) to (d) having WSimilarity weights in order: 0.95, 0.90 and 0.85.

(11)

Image (a) in Figure 16 has the gene configuration: Tchamber = 0, Tcorridor = 1, Tchamberarea = 9, Tcorridorlength = 3, Wsquareness= 0.4, Wsize= 0.6, QT = 0.1, QI = 0.9. Corridor rooms seems to suffer greatly starting at WSimilarity of 0.9 on account of each walls position greatly alters if it open ups a new path.

Figure 17: Image (a) is the original room with (b) to (d) having WSimilarity weights in order: 0.95, 0.90 and 0.85.

Image (a) in Figure 17 has the gene configuration: Tchamber = 1, Tcorridor = 0, Tchamberarea = 49, Tcorridorlength = 4, Wsquareness= 0.5, Wsize = 0.5, QT = 0.5, QI = 0.5. Just as with corridor rooms, big rooms seens to suffer even at high WSimilarity value and it’s due to the same reason that each wall holds greater value in the overall structure of the room and altering them greatly transforms the layout.

3) Analysis & Discussion: As we can see from the results we are fully able to generate similar maps from an original room. The issue becomes of how much similarity we need to input for the function because otherwise we might see dissimilar rooms. This can clearly be seen with Figure 14 and Figure 16 where the tolerance of WSimilarityfavors small rooms over rooms filled with corridors. Having a function that dynamically changes the value of idealP ercentSimilarity based on what kind of theme of the room would be the most optimal way of handling this kind of issue.

When we looked through all the different rooms in each test case we saw many rooms that favored removing walls in order to fulfill the desired idealP ercentSimilarity curve (see Section V-B for the implementation). This is something we want to avoid because it undermines the original room by just eliminating walls and doesn’t give the developer any variety of their original room. Even if it’s not as a major threat to the generator as symmetry faced in section V-A1 it is still noteworthy and needs to be addressed in future development. We were able to smoothly implement similarity fitness function into the existing generator and in our experiment we see that it is able to produce rooms that are similar. However, at this stage of the development we haven’t yet

evaluate the program with the developers which will determine if our implementation of similarity fitness functions works.

D. Similarity & Symmetry Experiment

With the similarity and symmetry fitness functions imple-mented together we need to evaluate if they are compatible with each other. This experiment was performed the same way the earlier two experiments were conducted by creating multiple batches and displaying the interesting findings from each batch with four images. Because we are dealing with multiple fitness function and parameter the test cases have grown exponentially if we were to test every combination. That is why we need to limit us by only changing a small number of variables.

1) Experimental Setup: Based on the experiment done in section VI-B we set the WSymmetryweight to 0.4 which could generate symmetric rooms a wide diversity of different room variation. Each test case ran a total of 100 times that consist of 150 generations with a total of 100 individuals in the pop-ulation. We evaluated 21 combinations of the following input parameters seen in Section VI-A in addition of WSimilarity.

2) Results: Given that we set the Wsimilarity value to 0.4 we were still able to get a wide variety of results with Wsimilarity values ranging between 0.80 to 0.95 percent similar.

Figure 18: Image (a) is the original room with (b) to (d) having WSimilarity weights in order: 0.95, 0.87 and 0.80.

Image (a) in Figure 18 has the gene configuration: Tchamber = 1, Tcorridor = 0, Tchamberarea = 9, Tcorridorlength = 2, Wsquareness = 0, Wsize = 1, QT = 0.5, QI = 0.5. We can clearly see that the generator has a hard time building a symmetric rooms when we have a high WSimilarity value as seen in image (b) however, it has started to become symmetrical. Even going to image (b) we can see that is has become more symmetrical but lost most of the over all structure from the original room. The sweet spot seems to be between 0.95 and 0.87 when dealing with small rooms.

(12)

Figure 19: Image (a) is the original room with (b) to (d) having WSimilarity weights in order: 0.95, 0.87 and 0.80.

Image (a) in Figure 19 has the gene configuration: Tchamber = 1, Tcorridor = 0, Tchamberarea = 25, Tcorridorlength = 3, Wsquareness = 0.3, Wsize = 0.7, QT = 0.7, QI = 0.3. Just as with small chamber rooms we can see the same pattern where symmetry was almost achieved in image (b). However, it managed to hold similarity in image (c) by adding more walls on the sides of the room.

Figure 20: Image (a) is the original room with (b) to (d) having WSimilarity weights in order: 0.95, 0.87 and 0.80.

Image (a) in Figure 20 has the gene configuration: Tchamber = 0, Tcorridor = 1, Tchamberarea = 9, Tcorridorlength = 3, Wsquareness= 0.4, Wsize = 0.6, QT = 0.1, QI = 0.9. Unlike were very high WSimilarity value drastically undermines the overall structure during the similarity experiment in section VI-C. When combined it was able to produce similar rooms even in image (c) when the WSimilarity value was 0.85. However, going even lower will not hold any similarity at all.

Figure 21: Image (a) is the original room with (b) to (d) having WSimilarity weights in order: 0.95, 0.87 and 0.80.

Image (a) in Figure 21 has the gene configuration: Tchamber = 1, Tcorridor = 0, Tchamberarea = 49, Tcorridorlength = 4, Wsquareness = 0.5, Wsize = 0.5, QT = 0.5, QI = 0.5. We can see that image (b) is able to hold both symmetry and similarity even at the highest WSimilarityvalue. This is mostly due to there are few walls so it becomes easy to mirror them on the opposite side of the room. As we go further lower in WSimilarityvalue we see that it builds as it pleases and strives away from big chambers and similarity.

3) Analysis & Discussion: The implementation of the two fitness functions together went smoothly without any compli-cations as seen Section V-C. However, in our experiment we had difficulties with generating maps that are both symmetric and similar from an original room. This is mostly due with the generator favoring one or the other fitness functions depending on the original room. This made it hard to find a balance between the two functions.

Even if we were able to merge them together, as we can see results the outcome becomes hard to justify to use in a real situation. For this, further development needs to be implemented and experimented in order to increase the consistency of the results.

Because we were not able to constantly produce rooms with both symmetry and similarity together we did not test the two functions merged in the user study. We instead tested each of the individual fitness functions on their own making us able to focus more on their impact with a developer.

VII. USERSTUDY

A big part of assessing if our symmetry and similarity implementation into EDD improves the overall quality of generated rooms is accomplished through a user study. This was done in collaboration with another Master Thesis project that focused on improving EDD’s UI. While we both survey different aspects of EDD, we were able to extract different data that is relevant for our own papers. We strove to make our study resemble Baldwin and Holmberg’s user study [1] to

(13)

eliminate any unnecessary threats of validity and may change the overall result of the study. However, we followed some guidelines that Runeson and H¨ost [13] created to be able to structure the whole process more thoroughly with data collection and interviewing.

The user study consisted of four distinct phases that will guide each participants through the program and give us data through observations and questionnaires.

• Introduction: The first phase gives a short introduction on who we are, why we were are there and what our thesis projects focuses on. A short introduction is also given on EDD on what kind of program that they will be using.

• Demonstration: The demonstration will consist of show-ing how the standard EDD workflow works as intended, cover the basic understanding of how to use the program and describe what they are capable in the current version. • Room Creation: The participants will be tasked to create a world with 3x3 dungeons while being able to ask questions during the time. During this phase we are going to do observations to document how they use the PCG created dungeon rooms to their advantage.

• Interview: The interview will consist of questions delv-ing on their thoughts process when usdelv-ing the program and if any improvements or weak points that they felt on the generated dungeon levels. Se appendix 1 to find our interview questions. Just as Runeson and H¨ost [13] recommends in their guideline we are going to record the discussions in a suitable audio format. This is only used as a backup about the interview with all participants giving consent and will be anonymous.

A. User Study Setup

The user study consists of 5 different participants that work in the gaming industry with various degree time spent within the field. The participants were introduced and questioned separately to give each participant enough time to understand the program. They were instructed to generate a world with 3x3 dungeons using the new improved UI during a 10 minute period. During this phase, we observe how each participant constructed their world and how they utilized the generated rooms to their advantage. Lastly each participant was inter-viewed with questions that can be found in appendix 1.

B. Participants

The five participants that we interviewed are professional game developers employed at the same company. They were happy to be able to let us come and test our program and take a little time of their day. These are contacts that previous Baldwin and Holmberg used in their own user study in EDD [1].

• Participant 1 has worked in the industry for over 10 years as a data scientist. Out of all the participants in this user study, he was the only one that played the older version of EDD. This reduced the time to get familiar with the program and let him to test the limits of the EDD.

• Participant 2 is fairly new in the industry working as a project coordinator for only 6 months. However, being familiar with both Mixed-Initiative and played dungeon crawlers let him get a grasp of the program fast. • Participant 3 has for over 6 years worked as a user

ex-perience researcher / biometric expert. He hasn’t worked with level design but has a basic understanding of PCG. • Participant 4 works as a senior user experience re-searcher for over 9 years. However he is not familiar with the concept of mixed-initiative but plays occasionally dungeon crawler games.

• Participant 5 is new in the industry with just having worked for 3 weeks as a Game User Researcher. He is also the only one that does not play dungeon crawler games is his free time nor have any prior knowledge of mixed-initiative.

C. Results

In this section we will show each participants world that they constructed during the time frame given to them and we will present our recorded observations during the phase. These observations will show how they interact with the suggested rooms and their mindset of what they wanted to achieve from the interview.

Algorithm/Users User 1 User 2 User 3 User 4 User 5

Classic 0 3 5 0 4

Symmetric 0 4 0 3 0

Similar 0 1 2 1 6

Table I: Number of suggested rooms chosen by the participants

During the Room Creation phase, we took notes of how often they took any of the suggested rooms and what fitness functions that the room was configured to use. These can be found in Table I. Given that each participant envisioned and built their world differently, they also took advantage of the various algorithms.

1) Participant 1: He was an exception by not using any of the suggested rooms at all. This was mostly due to him having an overall theme that stretches over multiple rooms and converge together. This can clearly be seen in Figure 22. During the last minutes he played with the symmetry and similarity suggested rooms but found no acceptable rooms that fit together. However, he found them an interesting concept but needs improvements by calculating with adjacent rooms into account.

(14)

Figure 22: World created by Participant 1

2) Participant 2: By choosing suggested rooms from the start and then altering them, he was able to create rooms that he preferred as seen in Figure 23. However, the suggested rooms appeared too chaotic and had to multiple times generate more rooms before choosing the right one. He would have liked more control over the values of the generator in some form of slides. This would help in not only let the user have more options but mostly let them determine the suggested rooms before generating them.

Figure 23: World created by Participant 2

3) Participant 3: The world he created was based on suggested rooms and later altered to fit his preferred liking as seen in Figure 24. He saw the benefit of having similarity fitness functions for bigger projects but felt that with only a 3x3 world, the variant of different rooms helped him more in deciding how to build each room. Providing with the option of choosing the opposite of similar would support the suggested generated rooms more.

Figure 24: World created by Participant 3

4) Participant 4: By mixing between creating rooms from scratch and choosing suggested symmetric rooms he was able to provide with a wide range of rooms as seen in Figure 25. He also took in consideration the adjacent rooms in deciding on how to build each room and where in the world it is positioned. The similarity and symmetry function felt out of control and would have liked some form of slides to be able to alter how much of each they give to the suggested rooms.

Figure 25: World created by Participant 4

5) Participant 5: By having the least knowledge of Dun-geon Crawlers and mixed-initiative he took the most advantage of the suggested rooms for creating the world as seen in Figure 26. By also selecting similarity he was able to alter the rooms slightly until satisfied. Because we are using the basic tiles in EDD he felt it hard to create a difficult room with enemy placement and corridors and was therefore prone to use the suggested rooms.

(15)

Figure 26: World created by Participant 5

D. Analysis & Discussion

From the user study we were able to summarize the most important features from the generator by what aspects it lacked in and what it was efficient in.

All of them felt that the similarity and symmetry functions were interesting and helped most of them in building their world. However, it was lacking with being able to control over how much each value gets. This could be remedied by integrating check-boxes and slides into the User Interface (UI) which would let the user choose what algorithms the generator uses and the amount of each value they want for the rooms. By using these functions the user would be able to have rooms that are opposite of the similar function just as participant in Section VII-C3 suggested.

Because the current version of EDD calculates each room separately and focuses on making them valid, dividing rooms into sections (as seen with participant in section VII-C1) that are only accessible through adjacent rooms becomes impossible for the generator to calculate in the current version. However, if we were able to further develop EDD by taking account of adjacent rooms and splitting individual rooms then the tool would be able to handle even more advanced and unique worlds.

Everyone built their world differently making it hard to say what aspects of the generator that is best. However, because we made the generator dynamic through being able to choose what algorithms to run, we expanded the usability of the program to fit with more people.

VIII. CONCLUSION

We see from our results in section VI that we successfully integrated both symmetry and similarity (see section V-B and V-A on integration) into Baldwin and Holmberg’s EDD [1]. However we stumbled upon issues with the symmetry implementation (see section V-A1 on symmetry issues) that producing undesirable rooms but was quickly addressed. We were also not able to merge the two functions together because it was not consistent enough with balancing the two fitness functions. From the user study we saw a wide variety of different ways to create dungeons. They all used one or the

other algorithm which made the program more dynamical. In the end we were able to produce dungeon rooms that both held the overlying structure of the micro-patterns with symmetry and similar dungeon rooms stemming from a single room.

IX. FUTURERESEARCH

No research is ever complete and it also applies to our re-search. With our integration of symmetry and fitness functions we saw an improvement on EDD’s PCG. However, there are so many different kinds of methods and approaches that can be applied when trying to create a PCG program and we only covered a fraction of them. Implementing new and interesting fitness functions to EDD and observe their impact would be future increase our knowledge of fitness function.

Games are not the only area that PCG can be applied to were we are able to implement symmetry and similarity into. An example would be implementing these fitness functions into a PCG program that calculates the most appealing way the layout of a garden should be built, reducing the cost of a garden designer.

GLOSSARY

dungeon rooms A dungeon room consist of pathways and chambers which holds both monsters and treasure. 1–3, 8, 11, 13

fitness function An operation in the generator that calculates a value that depicts how valuable the given input is. 1–6, 8–13

generator A system that involves different components that produces content depending on the input given. 1–5, 7– 10, 12, 13

level A section or part of a game. 2, 11

UI An interface that lets a human manipulate the programs values. 1, 3, 10, 11, 13

REFERENCES

[1] A. Baldwin and J. Holmberg, “Mixed-initiative procedural generation of dungeons using game design patterns,” in ., p. 79, Malm¨o h¨ogskola, 2017.

[2] E. Folmer, Component Based Game Development – A Solution to Escalating Costs and Expanding Deadlines?, pp. 66–73. Springer Berlin Heidelberg, 2007.

[3] BlizzardNorth, “Diablo 2,” 2000. [4] TelltaleGame, “Borderlands,” 2009. [5] M. Persson, “Minecraft,” 2009.

[6] M. Hendrikx, S. Meijer, J. Van Der Velden, and A. Iosup, “Procedural content generation for games: A survey,” ACM Trans. Multimedia Comput. Commun. Appl., vol. 9, pp. 1:1–1:22, Feb. 2013.

[7] A. Lightman, The Accidental Universe: The World You Thought You Knew. Knopf Doubleday Publishing Group, 2014.

[8] D. Ashlock, C. Lee, and C. McGuinness, “Search-based procedural generation of maze-like levels.,” IEEE Trans. Comput. Intellig. and AI in Games, vol. 3, no. 3, pp. 260–273, 2011.

[9] G. Smith, J. Whitehead, and M. Mateas, “Tanagra: A mixed-initiative level design tool,” in Proceedings of the Fifth International Conference on the Foundations of Digital Games, FDG ’10, pp. 209–216, ACM, 2010.

(16)

[10] N. J. Mitra and M. Pauly, “Symmetry for architectural design,” in Advances in Architectural Geometry, pp. 13–16, 2008.

[11] D. G. Novick and S. Sutton, “What is mixed-initiative interaction,” in In Procedings of the AAAI Spring Symposium on Computational Models for Mixed Initiative Interaction, pp. 114–116, 1997.

[12] A. R. Hevner, S. T. March, J. Park, and S. Ram, “Design science in information systems research,” MIS Q., vol. 28, pp. 75–105, Mar. 2004. [13] P. Runeson and M. H¨ost, “Guidelines for conducting and reporting case study research in software engineering,” Empirical Software Engineer-ing, vol. 14, p. 131, Dec 2008.

[14] S. O. Kimbrough, G. J. Koehler, M. Lu, and D. H. Wood, “On a feasible-infeasible two-population (fi-2pop) genetic algorithm for constrained optimization: Distance tracing and no free lunch,” European Journal of Operational Research, vol. 190, no. 2, pp. 310 – 327, 2008.

(17)

PRE-QUESTIONNAIRE

1. How long have you been working in game development?

2. What is your current role and position in it?

3. Have you played or do you play games with dungeon-style levels?

4. Are you familiar with the concept of mixed-initiative? If so, briefly explain it in

your own words.

5. Have you used mixed-initiative tools before? If so, what are they and what did

you think of them?

MAIN QUESTIONNAIRE

1. First impressions about the application?

2. World grid view

a. Do you like the strictly top-down approach of going from the world view

to the other views?

b. Did you find the ability to remove rooms useful in creating complex

designs?

c. Do you prefer starting with an empty room or a suggested generated

room?

d. Are there any features missing you’d like to see in the world grid view?

e. Does the removal of rooms make sense in the design context to you?

3. Room view

a. Do you find the minimap useful in designing your world?

b. Do you prefer navigating in the world using the directional buttons or

the minimap?

c. Do you prefer checking the adjacent rooms in the world using the

directional buttons or the minimap?

d. Were the stats helpful on deciding whether you want to use a generated

room or not?

e. Do you find the patterns helpful in designing your room?

f. Do you find it useful to be able to go back to the world grid or is the

minimap sufficient? Or would you prefer to have the world view’s

functionalities present in the room view with the minimap?

4. Suggestions and PCG

a. Did you find the provided suggestions interesting? Why or why not?

b. How interesting did you find similarity and symmetry?

(18)

similarity/symmetry in the generated suggestions?

c. Do you prefer to build from scratch or on top of a suggested room?

d. Are there any features missing you’d like to see in the suggestions

view?

5. General questions

a. Do you feel that the design process is restricted in any way when

thinking about the world’s complexity?

b. Do you want the program to assist you more while manually editing a

room?

c. Are the generated suggestions enough recommendations in the design

process or do you want the program to suggest more recommendations

in other areas?

d. How often do you wanna see the design patterns on the map?

e. How much do you care about the dark theme?

Figure

Figure 1: Symmetry shown in fruit and foliage Mixed-initiative interaction is a method that includes both a computer and a human in the calculation of the generator.
Figure 2: Design Science Research Methodology from Peffers et al. [12]
Figure 5 shows five of the different meso-pattern that are recognized by the generator
Figure 8: Image (a) shows the original room while showing the different changes that are present from the generated room in image (b)
+7

References

Related documents

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

Parallellmarknader innebär dock inte en drivkraft för en grön omställning Ökad andel direktförsäljning räddar många lokala producenter och kan tyckas utgöra en drivkraft

Närmare 90 procent av de statliga medlen (intäkter och utgifter) för näringslivets klimatomställning går till generella styrmedel, det vill säga styrmedel som påverkar

• Utbildningsnivåerna i Sveriges FA-regioner varierar kraftigt. I Stockholm har 46 procent av de sysselsatta eftergymnasial utbildning, medan samma andel i Dorotea endast

I dag uppgår denna del av befolkningen till knappt 4 200 personer och år 2030 beräknas det finnas drygt 4 800 personer i Gällivare kommun som är 65 år eller äldre i

Při návrhu konceptů je snaha zachovat původní funkci kola, čím se myslí zdvih kola, a přidat pružící element tak, aby se snížilo namáhání rámu stroje rázy vstupujících