# Procedural Video Game Scene Generation by Genetic and Neutrosophic WASPAS Algorithms

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Related Work

## 3. Scene Layout Modeling and Optimization Algorithm

#### 3.1. Game Scene Encoding Modeling

- Player (number 0)—represents the starting position of the subject, which is intended to play the game;
- Exit (number 1)—marks the location that the player should reach to finish the game;
- Empty space (number 2)—traversable and empty space, which can be used to navigate by the player;
- Wall (number 3)—object that blocks player navigation;
- Hazzard or enemy (number 4)—a traversable object, which is dangerous for the player;
- Collectible (number 5)—a desirable object that can be collected by the player;
- Ground—this object is not encoded in the chromosome matrix but is used during the 3D projection visualization step as a floor layer.

#### 3.2. Game Scene Procedural Generation Criteria List

- Symmetry calculation for aesthetic purposes. The chromosome grid is crossed with a horizontal and vertical slice to form 4 smaller 5 × 5 grids. Each object is checked to determine if it has an identical vertically and horizontally symmetrically matching object (Figure 2 and Figure 3) in the 5 × 5 grid. The final results are calculated by dividing the symmetrical matches by the maximal possible matches (each object has two matching objects with touching 5 × 5 grids) (1). x and y represent the size of the grid, s is a binary value, the value of which is 0 if the object does not have a matching pair. Each object is measured twice for each axis.

- Balance criteria for aesthetic purposes. Calculate how close to 50% is the ratio between empty game object count and total object count (Figure 4).

- Distance between player and exit game objects. x and y represent the coordinates of the player and exit (4). This rule makes sure that the player can see as much of the generated scene as possible while traveling to the exit point;

- The safe zone criteria calculate the amount of Hazzard-type objects in a defined square around the Player and divide the result by the total area of this square (5).

- Scan the chromosome grid and check if Player object exists;
- Scan chromosome grid and check if an exit object exists;
- Pathfinding algorithm to check if there is a passable way between Player and Exit.

#### 3.3. Application of WASPAS-SVNS in Genetic Algorithm

- Combining criteria evaluation data into matrix $X$ where one dimension represents the index of a chromosome, and another dimension represents the index of the criteria (6);$$X=\left[\begin{array}{cccc}{x}_{11}& {x}_{12}& \cdots & {x}_{1n}\\ {x}_{21}& {x}_{22}& \cdots & {x}_{2n}\\ \vdots & \vdots & \ddots & \vdots \\ {x}_{m1}& {x}_{m2}& \cdots & {x}_{mn}\end{array}\right]$$
- The original algorithm normalizes the data here, inside the WASPAS-SVNS algorithm, but for the iterative process it does not work because the local min–max and global min–max values are not the same, so we need to define boundaries before this step [33]. Normalization is made in the criteria functions to fit in the range of 0 to 1 (7). $v$ represents current criteria value and ${v}_{max}$ is the highest possible value for that criterion for the selected matrix size. ${\tilde{x}}_{ij}$ is a normalized index ij criteria value of matrix $X$;$${\tilde{x}}_{ij}=\frac{v}{{v}_{max}}$$
- Neutrosophication step. In this step, we convert results from our normalized criteria function results into neutrosophic sets. The neutrosophic set consists of three numbers: truth (t), intermediary (i), and falsehood (f). For this, we map criteria results with neutrosophic numbers, but we do a linear conversion as even the slightest non-proportional shifts can make a huge error in the long evolutionary run. N represents a neutrosophic number and S represents a scalar number (8);$$N\left(t,i,f\right)=\{\begin{array}{c}S\\ 1-S\\ 1-S\end{array}$$
- Sum of the total relative importance of the alternative (single evolutionary iteration chromosome);
- Total relative importance of the product of the alternative;
- A joint generalized criterion for the ranking alternatives (step 4 and step 5) (9);$${\tilde{Q}}_{i}=0.5{\tilde{Q}}_{i}^{\left(1\right)}+0.5{\tilde{Q}}_{i}^{\left(2\right)}$$
- Neutrosophic numbers (truth, intermediacy, and falsehood) are converted to scalar numbers using this formula and then used for chromosome evaluation in the genetic algorithm (10);$$S\left({\tilde{Q}}_{i}\right)=\frac{3+{t}_{i}-2{i}_{i}-{f}_{i}}{4}$$

#### 3.4. Proposed Extension of Genetic Algorithm

Algorithm 1. Genetic algorithm. |

InitializeRandomPopulation: DoFullEvolution: for amountOfEvolutionCycles CalculateAllCriteria for populationSizeValidation PlayerExists ExitExists PathBetweenPlayer-ExitExists Symetry EmptySpaceBalance Player-ExitDistance SafeZone FindUnderperformersAndPerformers for populationSize calculateFitnessWASPAS-SVNS EvolveUnderperformersWithGeneticAlgorithm DrawGrid(best fitness): |

## 4. Results

## 5. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Dick, S. Artificial Intelligence. Harv. Data Sci. Rev.
**2019**, 1–8. [Google Scholar] [CrossRef] - Lamb, C.; Brown, D.G.; Clarke, C.L.A. Evaluating Computational Creativity: An Interdisciplinary Tutorial. ACM Comput. Surv.
**2018**, 51, 1–34. [Google Scholar] [CrossRef] - Carballal, A.; Fernandez-Lozano, C.; Rodriguez-Fernandez, N.; Castro, L.; Santos, A. Avoiding the Inherent Limitations in Datasets Used for Measuring Aesthetics When Using a Machine Learning Approach. Complexity
**2019**, 2019, 4659809. [Google Scholar] [CrossRef] - Ventura, D. Mere generation: Essential barometer or dated concept? In Proceedings of the Seventh International Conference on Computational Creativity ICCC 2016, Paris, France, 27 June–1 July 2016; Available online: http://www.computationalcreativity.net/iccc2016/wp-content/uploads/2016/01/Mere-Generation.pdf (accessed on 7 July 2021).
- Cook, M.; Colton, S.; Gow, J. Nobody’s A Critic: On the Evaluation of Creative Code Generators—A Case Study in Video Game Design; ICCC: Sydney, Australia, 2013. [Google Scholar]
- Toivonen, H.; Gross, O. Data mining and machine learning in computational creativity. Wiley Interdiscip. Rev. Data Min. Knowl. Discov.
**2015**, 5, 265–275. [Google Scholar] [CrossRef] - Franceschelli, G.; Musolesi, M. Creativity and Machine Learning: A Survey. arXiv
**2021**, arXiv:2104.02726 2021. [Google Scholar] - Summerville, A.; Snodgrass, S.; Guzdiaz, M.; Holmgård, C.; Hoover, A.K.; Isaksen, A.; Nealen, A.; Togelius, J. Procedural content generation via machine learning (PCGML). IEEE Trans. Games
**2018**, 10, 257–270. [Google Scholar] [CrossRef][Green Version] - Togelius, J.; Champandard, A.J.; Lanzi, P.L.; Mateas, M.; Paiva, A.; Preuss, M.; Stanley, K.O. Procedural content generation: Goals, challenges and actionable steps. Dagstuhl Follow-Ups
**2013**, 6, 61–75. [Google Scholar] - Risi, S.; Togelius, J. Increasing generality in machine learning through procedural content generation. Nat. Mach. Intell.
**2020**, 2, 428–436. [Google Scholar] [CrossRef] - Isaksen, A.; Gopstein, D.; Togelius, J.; Nealen, A. Discovering Unique Game Variants Computational. In Proceedings of the Creativity and Games Workshop at the 2015 International Conference on Computational Creativity, Park City, UT, USA, 29 June–2 July 2015. [Google Scholar]
- Liapis, A.; Yannakakis, G.N.; Togelius, J. Limitations of Choice-Based Interactive Evolution for Game Level Design; AAAI: Stanford, CA, USA, 2012. [Google Scholar]
- Cook, M.; Colton, S.; Pease, A.; Llano, M.T. Framing in Computational Creativity—A Survey and Taxonomy; ICCC: Charlotte, NC, USA, 2019. [Google Scholar]
- Khalifa, A.; de Mesentier Silva, F.; Togelius, J. Level Design Patterns in 2D Games. In Proceedings of the 2019 IEEE Conference on Games (CoG), London, UK, 20–23 August 2019; pp. 1–8. [Google Scholar] [CrossRef]
- Togelius, J.; Schmidhuber, J. An experiment in automatic game design. In Proceedings of the 2008 IEEE Symposium on Computational Intelligence and Games, Perth, WA, Australia, 15–18 December 2008; pp. 111–118. [Google Scholar]
- Sweetser, P.; Wyeth, P. GameFlow: A model for evaluating player enjoyment in games. Comput. Entertain.
**2005**, 3, 3. [Google Scholar] [CrossRef] - Sorenson, N.; Pasquier, P. Towards a Generic Framework for Automated Video Game Level Creation. In European Conference on the Applications of Evolutionary Computation; Springer: Berlin/Heidelberg, Germany, 2010; pp. 131–140. [Google Scholar]
- Lara-Cabrera, R.; Cotta, C.; Fernández-Leiva, A.J. On balance and dynamism in procedural content generation with self-adaptive evolutionary algorithms. Nat. Comput.
**2014**, 13, 157–168. [Google Scholar] [CrossRef] - Lescauskiene, I.; Bausys, R.; Zavadskas, E.K.; Juodagalviene, B. VASMA weighting: Survey-based criteria weighting methodology that combines ENTROPY and WASPAS-SVNS to reflect the psychometric features of the VAS scales. Symmetry
**2020**, 12, 1641. [Google Scholar] [CrossRef] - Morkunaite, Z.; Bausys, R.; Zavadskas, E.K. Contractor Selection for Sgraffito Decoration of Cultural Heritage Buildings Using the WASPAS-SVNS Method. Sustainability
**2019**, 11, 6444. [Google Scholar] [CrossRef][Green Version] - Bausys, R.; Juodagalviene, B.; Žiuriene, R.; Pankrasovaite, I.; Kamarauskas, J.; Usovaite, A.; Gaižauskas, D. The Residence Plot Selection Model for Family House in Vilnius by Neutrosophic WASPAS Method; VGTU Press: Vilnius, Lithuania, 2020; Volume 24, pp. 182–196. [Google Scholar]
- Bausys, R.; Kazakeviciute-Januskeviciene, G. Qualitative rating of lossy compression for aerial imagery by neutrosophic WASPAS method. Symmetry
**2021**, 13, 273. [Google Scholar] [CrossRef] - Semenas, R.; Bausys, R.; Zavadskas, E.K. A novel environment exploration strategy by m-generalised q-neutrosophic WASPAS. In Studies in Informatics and Control; National Institute for R&D in Informatics, ICI Bucharest: Bucharest, Romania, 2021; Volume 30, pp. 19–28. [Google Scholar]
- Bausys, R.; Kazakeviciute-Januskeviciene, G.; Cavallaro, F.; Usovaite, A. Algorithm Selection for Edge Detection in Satellite Images by Neutrosophic WASPAS Method. Sustainability
**2020**, 12, 548. [Google Scholar] [CrossRef][Green Version] - Ali, J.; Bashir, Z.; Rashid, T. WASPAS-based decision making methodology with unknown weight information under uncertain evaluations. Expert Syst. Appl.
**2020**, 168, 114143. [Google Scholar] [CrossRef] - Pereira, L.T.; Toledo, C.; Ferreira, L.N.; Lelis, L.H. Learning to Speed up Evolutionary Content Generation in Physics-Based Puzzle Games. In Proceedings of the 2016 IEEE 28th International Conference on Tools with Artificial Intelligence (ICTAI), San Jose, CA, USA, 6–8 November 2016; pp. 901–907. [Google Scholar]
- Thakkar, S.; Cao, C.; Wang, L.; Choi, T.J.; Togelius, J. Autoencoder and Evolutionary Algorithm for Level Generation in Lode Runner. In Proceedings of the IEEE Conference on Games (CoG), London, UK, 20–23 August 2019; pp. 1–4. [Google Scholar]
- Zafar, A.; Mujtaba, H.; Beg, M.O. Search-based procedural content generation for GVG-LG. Appl. Soft Comput.
**2020**, 86, 105909. [Google Scholar] [CrossRef] - Volz, V.; Justesen, N.; Snodgrass, S.; Asadi, S.; Purmonen, S.; Holmgård, C.; Togelius, J.; Risi, S. Capturing Local and Global Patterns in Procedural Content Generation via Machine Learning. In Proceedings of the 2020 IEEE Conference on Games (CoG), Osaka, Japan, 24–27 August 2020; pp. 399–406. [Google Scholar]
- Safak, A.B.; Bostanci, E.; Soylucicek, A.E. Automated Maze Generation for Ms. Pac-Man Using Genetic Algorithms. Int. J. Mach. Learn. Comput.
**2016**, 6, 226–230. [Google Scholar] [CrossRef] - Petrovas, A.; Bausys, R. Automated Digital Terrain Elevation Modification by Procedural Generation Approach. In Proceedings of the 2019 Open Conference of Electrical, Electronic and Information Sciences (eStream), Vilnius, Lithuania, 25 April 2019; pp. 1–5. [Google Scholar] [CrossRef]
- Stanujkić, D.; Karabašević, D.; Popović, G.; Pamučar, D.; Stević, Ž.; Zavadskas, E.K.; Smarandache, F.A. Single-Valued Neutrosophic Extension of the EDAS Method. Axioms
**2021**, 10, 245. [Google Scholar] [CrossRef] - Padhye, N.; Deb, K. Multi-objective optimisation and multi-criteria decision making in SLS using evolutionary approaches. Rapid Prototyp. J.
**2011**, 17, 458–478. [Google Scholar] [CrossRef] - Whitley, D. A genetic algorithm tutorial. Stat. Comput.
**1994**, 4, 65–85. [Google Scholar] [CrossRef]

**Figure 14.**Symmetry and empty space balance. The numbers ‘1’ and ‘2’ represent the corresponding symmetrical objects. ‘50%’ represents the balance between the number of objects and the empty space.

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Petrovas, A.; Bausys, R.
Procedural Video Game Scene Generation by Genetic and Neutrosophic WASPAS Algorithms. *Appl. Sci.* **2022**, *12*, 772.
https://doi.org/10.3390/app12020772

**AMA Style**

Petrovas A, Bausys R.
Procedural Video Game Scene Generation by Genetic and Neutrosophic WASPAS Algorithms. *Applied Sciences*. 2022; 12(2):772.
https://doi.org/10.3390/app12020772

**Chicago/Turabian Style**

Petrovas, Aurimas, and Romualdas Bausys.
2022. "Procedural Video Game Scene Generation by Genetic and Neutrosophic WASPAS Algorithms" *Applied Sciences* 12, no. 2: 772.
https://doi.org/10.3390/app12020772