Customizable Procedural Content Generation with LLMs
Resumo
Introduction: Procedural Content Generation (PCG) faces challenges in creating customizable levels with specific characteristics, such as difficulty patterns and unique layouts. Large Language Models (LLMs) offer a promising solution due to their natural language understanding and generative capabilities. Objective: This study proposes fine-tuning the DeepSeek-R1 LLM to generate customizable 2D game levels (similar to The Legend of Zelda), evaluating its feasibility for PCG. Methodology: Using a dataset with around 1000 playable levels of the Zelda-like game the model (DeepSeek-R1-DistillLlama-8B-unsloth-bnb-4bit) was fine-tuned with instructions specifying element quantities (e.g., enemies, blocks), and then evaluated using various metrics, including playability (ASTAR agent), novelty (Levenshtein distance), diversity (graph-based analysis), and accuracy (input adherence). Results: The model achieved very high results on novelty, diversity and playability, but falling a little on the accuracy tests. However it still shows impressive adherence for the inputs specifications, demonstrating LLMs’ potential for customizable PCG, outperforming earlier models like GPT-2/3.
Palavras-chave:
Procedural Content Generation, Large Language Models, Level Design, Game Development
Referências
AI, D. (2024). Deepseek-r1 model architecture. [link]. Accessed: 2024-07-20.
de Pontes, R. G. e Gomes, H. M. (2020). Evolutionary procedural content generation for an endless platform game. In 2020 19th Brazilian Symposium on Computer Games and Digital Entertainment (SBGames), pages 80–89. IEEE.
DeepSeek (2024). Deepseek chat. [link]. Accessed: [Insert Access Date].
Hendrikx, M., Meijer, S., Van Der Velden, J., e Iosup, A. (2013). Procedural content generation for games: A survey. ACM Transactions on Multimedia Computing, Communications, and Applications (TOMM), 9(1):1–22.
Khalifa, A., Bontrager, P., Earle, S., e Togelius, J. (2020). Pcgrl: Procedural content generation via reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment, pages 95–101.
Mitsis, K., Kalafatis, E., Zarkogianni, K., Mourkousis, G., e Nikita, K. S. (2020). Procedural content generation based on a genetic algorithm in a serious game for obstructive sleep apnea. In 2020 IEEE Conference on Games (CoG), pages 694–697. IEEE.
Moghadam, A. B. e Rafsanjani, M. K. (2017). A genetic approach in procedural content generation for platformer games level creation. In 2017 2nd Conference on Swarm Intelligence and Evolutionary Computation (CSIEC), pages 141–146. IEEE.
Nintendo (1986). The Legend of Zelda. [Nintendo Entertainment System].
OpenAI (2024). Página oficial da openai. Accessed: 27 de outubro de 2024.
Perez-Liebana, D., Liu, J., Khalifa, A., Gaina, R. D., Togelius, J., e Lucas, S. M. (2019). General video game ai: A multitrack framework for evaluating agents, games, and content generation algorithms. IEEE Transactions on Games, 11(3):195–214.
Sudhakaran, S., González-Duque, M., Freiberger, M., Glanois, C., Najarro, E., e Risi, S. (2024). Mariogpt: Open-ended text2level generation through large language models. Advances in Neural Information Processing Systems, 36.
Summerville, A., Snodgrass, S., Guzdial, M., Holmgård, C., Hoover, A. K., Isaksen, A., Nealen, A., e Togelius, J. (2018). Procedural content generation via machine learning (pcgml). IEEE Transactions on Games, 10(3):257–270.
Taori, R., Gulrajani, I., Zhang, T., Dubois, Y., Li, X., Guestrin, C., Liang, P., e Hashimoto, T. B. (2023). Stanford alpaca: An instruction-following llama model. [link].
Team, G., Anil, R., Borgeaud, S., Alayrac, J.-B., Yu, J., Soricut, R., Schalkwyk, J., Dai, A. M., Hauth, A., Millican, K., et al. (2023). Gemini: a family of highly capable multimodal models. arXiv preprint arXiv:2312.11805.
Todd, G., Earle, S., Nasir, M. U., Green, M. C., e Togelius, J. (2023). Level generation through large language models. In Proceedings of the 18th International Conference on the Foundations of Digital Games, pages 1–8.
Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., Azhar, F., et al. (2023). Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.
Unsloth (2024). Unsloth. Accessed: 2024.
Zafar, A. (2023). Zelda game levels. Accessed: 10/2024.
Zhao, W. X., Zhou, K., Li, J., Tang, T., Wang, X., Hou, Y., Min, Y., Zhang, B., Zhang, J., Dong, Z., et al. (2023). A survey of large language models. arXiv preprint arXiv:2303.18223.
de Pontes, R. G. e Gomes, H. M. (2020). Evolutionary procedural content generation for an endless platform game. In 2020 19th Brazilian Symposium on Computer Games and Digital Entertainment (SBGames), pages 80–89. IEEE.
DeepSeek (2024). Deepseek chat. [link]. Accessed: [Insert Access Date].
Hendrikx, M., Meijer, S., Van Der Velden, J., e Iosup, A. (2013). Procedural content generation for games: A survey. ACM Transactions on Multimedia Computing, Communications, and Applications (TOMM), 9(1):1–22.
Khalifa, A., Bontrager, P., Earle, S., e Togelius, J. (2020). Pcgrl: Procedural content generation via reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment, pages 95–101.
Mitsis, K., Kalafatis, E., Zarkogianni, K., Mourkousis, G., e Nikita, K. S. (2020). Procedural content generation based on a genetic algorithm in a serious game for obstructive sleep apnea. In 2020 IEEE Conference on Games (CoG), pages 694–697. IEEE.
Moghadam, A. B. e Rafsanjani, M. K. (2017). A genetic approach in procedural content generation for platformer games level creation. In 2017 2nd Conference on Swarm Intelligence and Evolutionary Computation (CSIEC), pages 141–146. IEEE.
Nintendo (1986). The Legend of Zelda. [Nintendo Entertainment System].
OpenAI (2024). Página oficial da openai. Accessed: 27 de outubro de 2024.
Perez-Liebana, D., Liu, J., Khalifa, A., Gaina, R. D., Togelius, J., e Lucas, S. M. (2019). General video game ai: A multitrack framework for evaluating agents, games, and content generation algorithms. IEEE Transactions on Games, 11(3):195–214.
Sudhakaran, S., González-Duque, M., Freiberger, M., Glanois, C., Najarro, E., e Risi, S. (2024). Mariogpt: Open-ended text2level generation through large language models. Advances in Neural Information Processing Systems, 36.
Summerville, A., Snodgrass, S., Guzdial, M., Holmgård, C., Hoover, A. K., Isaksen, A., Nealen, A., e Togelius, J. (2018). Procedural content generation via machine learning (pcgml). IEEE Transactions on Games, 10(3):257–270.
Taori, R., Gulrajani, I., Zhang, T., Dubois, Y., Li, X., Guestrin, C., Liang, P., e Hashimoto, T. B. (2023). Stanford alpaca: An instruction-following llama model. [link].
Team, G., Anil, R., Borgeaud, S., Alayrac, J.-B., Yu, J., Soricut, R., Schalkwyk, J., Dai, A. M., Hauth, A., Millican, K., et al. (2023). Gemini: a family of highly capable multimodal models. arXiv preprint arXiv:2312.11805.
Todd, G., Earle, S., Nasir, M. U., Green, M. C., e Togelius, J. (2023). Level generation through large language models. In Proceedings of the 18th International Conference on the Foundations of Digital Games, pages 1–8.
Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., Azhar, F., et al. (2023). Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.
Unsloth (2024). Unsloth. Accessed: 2024.
Zafar, A. (2023). Zelda game levels. Accessed: 10/2024.
Zhao, W. X., Zhou, K., Li, J., Tang, T., Wang, X., Hou, Y., Min, Y., Zhang, B., Zhang, J., Dong, Z., et al. (2023). A survey of large language models. arXiv preprint arXiv:2303.18223.
Publicado
30/09/2025
Como Citar
JÚNIOR, Marcelo; ADANIYA, Mario; NUNES, Luiz.
Customizable Procedural Content Generation with LLMs. In: SIMPÓSIO BRASILEIRO DE JOGOS E ENTRETENIMENTO DIGITAL (SBGAMES), 24. , 2025, Salvador/BA.
Anais [...].
Porto Alegre: Sociedade Brasileira de Computação,
2025
.
p. 680-690.
DOI: https://doi.org/10.5753/sbgames.2025.10297.
