Creating a Newer and Improved Procedural Content Generation (PCG) Algorithm with Minimal Human Intervention for Computer Gaming Development †
Abstract
:1. Introduction
2. Concepts of PCG
2.1. The Role of Algorithms in PCG
2.2. PCG via Machine Learning
2.3. Generative Adversarial Networks
2.4. Scenario Needs
3. Content Quality
3.1. Quality Diversity
3.2. Intelligent Diversity
4. The Improved Spawn Algorithm
- Large rooms: 11 ( and );
- Medium rooms: 465 ( and );
- Small rooms: 20,825 ( and ).
4.1. Algorithm Complexity
4.2. Worst-Case Complexity
5. Results
6. Discussion
7. Conclusions
Future Trends
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Appendix A
Input: 15 rows × 50 columns grid area, where maximum number of large, medium, and small rooms is set to 1, 2, and 3, respectively. |
2 dimension vectors: map[x, y] Variables: i, j as counters. |
Random values: 0 → large room, 1 → medium room, 2 → small room, 3 → no room |
Maximum elements number: large rooms → 1, medium rooms → 2, small rooms → 3, decorations (fountain) → 1 |
–Grid Map creation– |
1. for i = 1 to maxColumns(50) do |
2. for j = 1 to maxRows(15) do |
3. map[i, j] = new Vector2(x, y) |
4. y = y + 1 (+1 tile in the row) |
5. end for (j) |
6. y = 0 (initiate the row tile) |
7. x = x + 1 (+1 tile in the column) |
8. end for (i) |
–Large column loop– |
9. for i = 1 to largeColumns(10) do |
–The nested "for j" loops chooses in which large row the rooms and decorations will be placed– |
–Large room loop– |
10. for j = 1 to largeRows(3) do |
11. randomGenerator = randomValue 0 to 3 |
12. if randomGenerator == 0 and maxNumberLargeRoom != 0 and noPresenceOfAnotherLargeRoom |
13. choose a direction other than no face wall |
14. create a large room as Vector3(map[i,j].x, map[i,j].y, direction) |
15. choose a random scale |
16. reduce the maxNumberLargeRoom by 1 |
17. end if |
18. end for (j) |
–Medium room loop– |
19. for j = 1 to largeRows do |
20. randomGenerator = randomValue 0 to 3 |
21. if randomGenerator == 0 and maxNumberMediumRoom != 0 and noPresenceOfAnotherLargeRoom |
22. choose a random direction |
23. create a medium room as Vector3(map[i,j].x, map[i,j].y, direction) |
24. choose a random scale |
25. reduce the maxNumberMediumRoom by 1 |
26. end if |
27. end for (j) |
–Small room loop– |
28. for j = 1 to largeRows do |
29. randomGenerator = randomValue 0 to 3 |
30. if randomGenerator == 2 and maxNumberSmallRoom != 0 and noPresenceOfAnotherLargeRoom |
31. choose a freely random direction |
32. create a small room as Vector3(map[i,j].x, map[i,j].y, direction) |
33. choose a random scale |
34. reduce the maxNumberSmallRoom by 1 |
35. end if |
36. end for (j) |
–Decoration (fountain) loop– |
37. for j = 1 to largeRows do |
38. randomFountainGenerator = randomValue 0 to 1 |
39. if randomFountainGenerator == 1 and maxNumberFountain != 0 |
40. create a fountain as Vector3(map[i,j].x, map[i,j].y, direction) |
41. reduce the maxNumberFountain by 1 |
42. end if |
43. end for (j) |
–Move to next map large column– |
44. nextPointerLargeGridX = 0 |
45. nextPointerLargeGridY = nextPointerLargeGridY + stepY (10) |
46. end for (i) |
References
- Viana, B.M.; dos Santos, S.R. Procedural Dungeon Generation: A Survey. J. Interact. Syst. 2021, 12, 83–101. [Google Scholar] [CrossRef]
- Barriga, N.A. A short introduction to procedural content generation algorithms for videogames. Int. J. Artif. Intell. Tools 2019, 28, 1930001. [Google Scholar] [CrossRef]
- Edmund M, F.H. The Binding of Isaac. Available online: https://bindingofisaac.fandom.com (accessed on 16 August 2024).
- Persson, M. Minecraft. Available online: https://www.minecraft.net/en-us (accessed on 16 August 2024).
- Electronic-Arts. APEX Legends. Available online: https://www.ea.com/games/apex-legends (accessed on 16 August 2024).
- Games, R. Grand Theft Auto Online. Available online: https://www.rockstargames.com/gta-online (accessed on 16 August 2024).
- Namco, B. Dark Souls III. Available online: https://en.bandainamcoent.eu/dark-souls/dark-souls-iii (accessed on 16 August 2024).
- Shi, T.; Zou, Z.; Shi, Z.; Yuan, Y. Neural rendering for game character auto-creation. IEEE Trans. Pattern Anal. Mach. Intell. 2020, 44, 1489–1502. [Google Scholar] [CrossRef] [PubMed]
- Shi, T.; Zuo, Z.; Yuan, Y.; Fan, C. Fast and robust face-to-parameter translation for game character auto-creation. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 7–12 February 2020; Volume 34, pp. 1733–1740. [Google Scholar]
- Zhao, J.; Cheng, Y.; Cheng, Y.; Yang, Y.; Zhao, F.; Li, J.; Liu, H.; Yan, S.; Feng, J. Look across elapse: Disentangled representation learning and photorealistic cross-age face synthesis for age-invariant face recognition. In Proceedings of the AAAI Conference on Artificial Intelligence, Honolulu, HI, USA, 27 January–1 February 2019; Volume 33, pp. 9251–9258. [Google Scholar]
- Lazaridis, L.; Kollias, K.F.; Maraslidis, G.; Michailidis, H.; Papatsimouli, M.; Fragulis, G.F. Auto Generating Maps in a 2D Environment. In Proceedings of the International Conference on Human-Computer Interaction, Virtual Event, 26 June 26–1 July 2022; pp. 40–50. [Google Scholar]
- Freitas, V.M.R.d. Procedural Generation of Cave-Like Maps for 2D Top-Down Games. Bachelor’s Thesis, Universidade Federal Do Rio Grande Do Sul Instituto De InformáTica Curso De Engenharia De ComputaçãO, Porto Alegre, Brazil, 2021. [Google Scholar]
- Viana, B.M.; dos Santos, S.R. A survey of procedural dungeon generation. In Proceedings of the 2019 18th Brazilian Symposium on Computer Games and Digital Entertainment (SBGames), Rio de Janeiro, Brazil, 28–31 October 2019; pp. 29–38. [Google Scholar]
- Minini, P.; Assuncao, J. Combining Constructive Procedural Dungeon Generation Methods with WaveFunctionCollapse in Top-Down 2D Games. In Proceedings of the SBGames, Recife, Brazil, 7–10 November 2020. [Google Scholar]
- Lai, G.; Latham, W.; Leymarie, F.F. Towards friendly mixed initiative procedural content generation: Three pillars of industry. In Proceedings of the International Conference on the Foundations of Digital Games, Bugibba, Malta, 15–18 September 2020; pp. 1–4. [Google Scholar]
- Gellel, A.; Sweetser, P. A hybrid approach to procedural generation of roguelike video game levels. In Proceedings of the International Conference on the Foundations of Digital Games, Bugibba Malta, 15–18 September 2020; pp. 1–10. [Google Scholar]
- De Kegel, B.; Haahr, M. Procedural puzzle generation: A survey. IEEE Trans. Games 2019, 12, 21–40. [Google Scholar] [CrossRef]
- Green, M.C.; Khalifa, A.; Alsoughayer, A.; Surana, D.; Liapis, A.; Togelius, J. Two-step constructive approaches for dungeon generation. In Proceedings of the 14th International Conference on the Foundations of Digital Games, San Luis Obispo, CA, USA, 26–30 August 2019; pp. 1–7. [Google Scholar]
- Liapis, A. 10 Years of the PCG workshop: Past and Future Trends. In Proceedings of the International Conference on the Foundations of Digital Games, Bugibba, Malta, 15–18 September 2020; pp. 1–10. [Google Scholar]
- Gisslén, L.; Eakins, A.; Gordillo, C.; Bergdahl, J.; Tollmar, K. Adversarial reinforcement learning for procedural content generation. In Proceedings of the 2021 IEEE Conference on Games (CoG), Copenhagen, Denmark, 17–20 August 2021; pp. 1–8. [Google Scholar]
- Song, A.; Whitehead, J. TownSim: Agent-based city evolution for naturalistic road network generation. In Proceedings of the 14th International Conference on the Foundations of Digital Games, San Luis Obispo, CA, USA, 26–30 August 2019; pp. 1–9. [Google Scholar]
- Mawhorter, R.; Smith, A. Softlock Detection for Super Metroid with Computation Tree Logic. In Proceedings of the 16th International Conference on the Foundations of Digital Games, Montreal, QC, Canada, 3–6 August 2021; pp. 1–10. [Google Scholar]
- Cook, M.; Raad, A. Hyperstate space graphs for automated game analysis. In Proceedings of the 2019 IEEE Conference on Games (CoG), London, UK, 20–23 August 2019; pp. 1–8. [Google Scholar]
- Chang, K.; Aytemiz, B.; Smith, A.M. Reveal-more: Amplifying human effort in quality assurance testing using automated exploration. In Proceedings of the 2019 IEEE Conference on Games (CoG), London, UK, 20–23 August 2019; pp. 1–8. [Google Scholar]
- Nintendo Ltd. Super Mario Bros. Available online: https://www.nintendo.com/en-gb/Games/NES/Super-Mario-Bros-803853.html (accessed on 17 August 2024).
- Bontrager, P.; Togelius, J. Learning to Generate Levels From Nothing. In Proceedings of the 2021 IEEE Conference on Games (CoG), Copenhagen, Denmark, 17–20 August 2021; pp. 1–8. [Google Scholar]
- Summerville, A. Expanding expressive range: Evaluation methodologies for procedural content generation. In Proceedings of the Fourteenth Artificial Intelligence and Interactive Digital Entertainment Conference, Edmonton, AB, Canada, 13–17 November 2018. [Google Scholar]
- Snodgrass, S.; Ontanón, S. Learning to generate video game maps using markov models. IEEE Trans. Comput. Intell. AI Games 2016, 9, 410–422. [Google Scholar] [CrossRef]
- Adams, C.; Louis, S. Procedural maze level generation with evolutionary cellular automata. In Proceedings of the 2017 IEEE Symposium Series on Computational Intelligence (SSCI), Honolulu, HI, USA, 27 November–1 December 2017; pp. 1–8. [Google Scholar]
- Flores-Aquino, G.O.; Ortega, J.D.D.; Arvizu, R.Y.A.; Muñoz, R.L.; Gutierrez-Frias, O.O.; Vasquez-Gomez, J.I. 2D Grid Map Generation for Deep-Learning-based Navigation Approaches. arXiv 2021, arXiv:2110.13242. [Google Scholar]
- Thompson, T.; Lavender, B. A generative grammar approach for action-adventure map generation in the legend of zelda. 2017. In Proceedings of the 7th International Symposium for AI & Games, Artificial Intelligence and Simulation of Behaviour, Bath, UK, 18–21 April 2017. [Google Scholar]
- Summerville, A.; Snodgrass, S.; Guzdial, 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]
- Gutierrez, J.; Schrum, J. Generative adversarial network rooms in generative graph grammar dungeons for the legend of zelda. In Proceedings of the 2020 IEEE Congress on Evolutionary Computation (CEC), Glasgow, UK, 19–24 July 2020; pp. 1–8. [Google Scholar]
- Torrado, R.R.; Khalifa, A.; Green, M.C.; Justesen, N.; Risi, S.; Togelius, J. Bootstrapping conditional gans for video game level generation. In Proceedings of the 2020 IEEE Conference on Games (CoG), Osaka, Japan, 24–27 August 2020; pp. 41–48. [Google Scholar]
- Sutton, R.S.; Barto, A.G. Reinforcement Learning: An Introduction; MIT Press: Cambridge, MA, USA, 2018. [Google Scholar]
- Khalifa, A.; Bontrager, P.; Earle, S.; Togelius, J. Pcgrl: Procedural content generation via reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment, Online, 19–23 October 2020; Volume 16, pp. 95–101. [Google Scholar]
- Delarosa, O.; Dong, H.; Ruan, M.; Khalifa, A.; Togelius, J. Mixed-initiative level design with rl brush. In Proceedings of the International Conference on Computational Intelligence in Music, Sound, Art and Design (Part of EvoStar), Virtual Event, 7–9 April 2021; Springer: Cham, Switzerland, 2021; pp. 412–426. [Google Scholar]
- Liu, J.; Snodgrass, S.; Khalifa, A.; Risi, S.; Yannakakis, G.N.; Togelius, J. Deep learning for procedural content generation. Neural Comput. Appl. 2021, 33, 19–37. [Google Scholar] [CrossRef]
- Alvarez, A.; Dahlskog, S.; Font, J.; Togelius, J. Empowering quality diversity in dungeon design with interactive constrained map-elites. In Proceedings of the 2019 IEEE Conference on Games (CoG), London, UK, 20–23 August 2019; pp. 1–8. [Google Scholar]
- Silva, R.C.; Fachada, N.; De Andrade, D.; Códices, N. Procedural generation of 3D maps with snappable meshes. IEEE Access 2022, 10, 43093–43111. [Google Scholar] [CrossRef]
- Gravina, D.; Khalifa, A.; Liapis, A.; Togelius, J.; Yannakakis, G.N. Procedural content generation through quality diversity. In Proceedings of the 2019 IEEE Conference on Games (CoG), London, UK, 20–23 August 2019; pp. 1–8. [Google Scholar]
- Yannakakis, G.N.; Togelius, J. Artificial Intelligence and Games; Springer: New York, NY, USA, 2018; Volume 2. [Google Scholar]
- Juliani, A.; Berges, V.P.; Teng, E.; Cohen, A.; Harper, J.; Elion, C.; Goy, C.; Gao, Y.; Henry, H.; Mattar, M.; et al. Unity: A general platform for intelligent agents, 2018. arXiv 1809, arXiv:1809.02627. [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]
- Werneck, M.; Clua, E.W. Generating procedural dungeons using machine learning methods. In Proceedings of the 2020 19th Brazilian Symposium on Computer Games and Digital Entertainment (SBGames), Recife, Brazil, 7–10 November 2020; pp. 90–96. [Google Scholar]
- Levine, K. Bioshock. Available online: https://2k.com/en-US/game/bioshock-the-collection/ (accessed on 23 August 2024).
- Park, K.; Mott, B.W.; Min, W.; Boyer, K.E.; Wiebe, E.N.; Lester, J.C. Generating educational game levels with multistep deep convolutional generative adversarial networks. In Proceedings of the 2019 IEEE Conference on Games (CoG), London, UK, 20–23 August 2019; pp. 1–8. [Google Scholar]
- Volz, V.; Schrum, J.; Liu, J.; Lucas, S.M.; Smith, A.; Risi, S. Evolving mario levels in the latent space of a deep convolutional generative adversarial network. In Proceedings of the Genetic and Evolutionary Computation Conference, Kyoto, Japan, 15–19 July 2018; pp. 221–228. [Google Scholar]
- Giacomello, E.; Lanzi, P.L.; Loiacono, D. Doom level generation using generative adversarial networks. In Proceedings of the 2018 IEEE Games, Entertainment, Media Conference (GEM), Galway, Ireland, 15–17 August 2018; pp. 316–323. [Google Scholar]
- id Software. Doom. Available online: https://www.idsoftware.com/en (accessed on 25 August 2024).
- Alvarez, A.; Dahlskog, S.; Font, J.; Holmberg, J.; Johansson, S. Assessing aesthetic criteria in the evolutionary dungeon designer. In Proceedings of the 13th International Conference on the Foundations of Digital Games, Malmö, Sweden, 7–10 August 2018; pp. 1–4. [Google Scholar]
- Alvarez, A.; Dahlskog, S.; Font, J.; Holmberg, J.; Nolasco, C.; Österman, A. Fostering creativity in the mixed-initiative evolutionary dungeon designer. In Proceedings of the 13th International Conference on the Foundations of Digital Games, Malmö, Sweden, 7–10 August 2018; pp. 1–8. [Google Scholar]
- Liu, S.; Chaoran, L.; Yue, L.; Heng, M.; Xiao, H.; Yiming, S.; Licong, W.; Ze, C.; Xianghao, G.; Hengtong, L.; et al. Automatic generation of tower defense levels using PCG. In Proceedings of the 14th International Conference on the Foundations of Digital Games, San Luis Obispo, CA, USA, 26–30 August 2019; pp. 1–9. [Google Scholar]
- Yu, D. Spelunky. Available online: https://spelunkyworld.com/original.html (accessed on 24 August 2024).
- Lee, N.; Morris, J. A Procedural generation platform to create randomized gaming maps using 2D model and machine learning. In Proceedings of the CS & IT Conference Proceedings, Jakarta, Indonesia, 16 February 2023; Volume 13. [Google Scholar]
- Entertainment, B. Diablo. Available online: https://us.shop.battle.net/en-us/product/diablo (accessed on 29 August 2024).
- Pereira, L.T.; de Souza Prado, P.V.; Lopes, R.M.; Toledo, C.F.M. Procedural generation of dungeons’ maps and locked-door missions through an evolutionary algorithm validated with players. Expert Syst. Appl. 2021, 180, 115009. [Google Scholar] [CrossRef]
- Nam, S.; Ikeda, K. Generation of diverse stages in turn-based role-playing game using reinforcement learning. In Proceedings of the 2019 IEEE Conference on Games (CoG), London, UK, 20–23 August 2019; pp. 1–8. [Google Scholar]
- Nam, S.G.; Hsueh, C.H.; Ikeda, K. Generation of game stages with quality and diversity by reinforcement learning in turn-based RPG. IEEE Trans. Games 2021, 14, 488–501. [Google Scholar] [CrossRef]
- Entertainment, B. Diablo II. Available online: https://diablo2.blizzard.com/en-us/ (accessed on 27 August 2024).
- Dutra, P.V.M.; Villela, S.M.; Neto, R.F. Procedural content generation using reinforcement learning and entropy measure as feedback. In Proceedings of the 2022 21st Brazilian Symposium on Computer Games and Digital Entertainment (SBGames), Natal, Brazil, 24–27 October 2022; pp. 1–6. [Google Scholar]
- Shu, T.; Liu, J.; Yannakakis, G.N. Experience-driven PCG via reinforcement learning: A Super Mario Bros study. In Proceedings of the 2021 IEEE Conference on Games (CoG), Copenhagen, Denmark, 17–20 August 2021; pp. 1–9. [Google Scholar]
- Lucas, S.M.; Volz, V. Tile pattern KL-divergence for analysing and evolving game levels. In Proceedings of the Genetic and Evolutionary Computation Conference, Prague, Czech Republic, 13–17 July 2019; pp. 170–178. [Google Scholar]
- Lazaridis, L.; Papatsimouli, M.; Kollias, K.F.; Sarigiannidis, P.; Fragulis, G.F. Hitboxes: A survey about collision detection in video games. In Proceedings of the International Conference on Human-Computer Interaction, Virtual Event, 24–29 July 2021; Springer: Cham, Switzerland, 2021; pp. 314–326. [Google Scholar]
- Ironhide. Kingdom Rush: Frontiers. Available online: https://www.kingdomrush.com/kingdom-rush-frontiers (accessed on 29 August 2024).
- Re-Logic. Terraria. Available online: https://terraria.org/ (accessed on 29 August 2024).
Training Sample Required | Space | Predefined Levels | Asset Rotation | |
---|---|---|---|---|
Minecraft | No | 3D | No | No need |
Binding of Isaac | No | 2D | Merely | No |
Spelunky | No | 2D | Merely | No |
Diablo | No | 2D (map overlay) | Yes | No |
Super Mario | Yes | 2D | Merely | No need |
Doom levels | Yes | 3D | No | No |
Kingdom Rush: Frontiers | No | 2D | No | No |
Our Spawn algorithm | No | 2D | No | Merely |
Method | Trained Dataset Required | Room Sizes (Total) | Map Size | |
---|---|---|---|---|
Initial algorithm | Cellular Automata | No | 3 | cells |
Improved algorithm | Cellular Automata | No | 93 | cells |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 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
Lazaridis, L.; Fragulis, G.F. Creating a Newer and Improved Procedural Content Generation (PCG) Algorithm with Minimal Human Intervention for Computer Gaming Development. Computers 2024, 13, 304. https://doi.org/10.3390/computers13110304
Lazaridis L, Fragulis GF. Creating a Newer and Improved Procedural Content Generation (PCG) Algorithm with Minimal Human Intervention for Computer Gaming Development. Computers. 2024; 13(11):304. https://doi.org/10.3390/computers13110304
Chicago/Turabian StyleLazaridis, Lazaros, and George F. Fragulis. 2024. "Creating a Newer and Improved Procedural Content Generation (PCG) Algorithm with Minimal Human Intervention for Computer Gaming Development" Computers 13, no. 11: 304. https://doi.org/10.3390/computers13110304
APA StyleLazaridis, L., & Fragulis, G. F. (2024). Creating a Newer and Improved Procedural Content Generation (PCG) Algorithm with Minimal Human Intervention for Computer Gaming Development. Computers, 13(11), 304. https://doi.org/10.3390/computers13110304