QuestGuard: Quality Gates and Diversity-Aware Repair for Reliable LLM-Generated Game Quests

  • Lucas Vieira dos Santos Souza UNESP
  • Murilo Mazzotti Silvestrini UNICAMP
  • Leopoldo Lusquino Filho UNESP / UNICAMP

Resumo


Once an LLM-generated quest crosses the boundary from prose into a game engine, it becomes a software artifact: it must satisfy a structural interface, link to existing world entities, expose an executable objective flow, and provide testable completion conditions. QuestGuard addresses this software-engineering problem through a modular Software Quality Assurance pipeline in which a JSON Schema acts as a lightweight type system and executable contract, deterministic validators operate as quality gates, and rejected artifacts enter a bounded repair–revalidation loop before publication. The architecture combines structural, referential, graph, and content-rule checks with an evidence-adjudicated semantic audit, and compares validity-oriented repair with a diversity-aware alternative. We report an exploratory proof-of-concept study with five configurations, three independent runs, and 90 quests per configuration. Prompt-only and schema-guided generation produced no fully valid artifacts, although schema guidance reduced the mean number of detected errors from 9.67 to 3.38 per quest. Since the repair configurations are designed to iterate correction and revalidation until artifacts pass or bounded attempts are exhausted, the main empirical result is the repair overhead required to reach deterministic validity: both repair configurations reached 100% final yield, while C4 used two and C5 used eight LLM repair calls across 90 quests. Diversity-aware repair increased mean unique structural signatures from 14.00 to 17.67, reduced duplicate signatures from 83.33% to 63.33%, and lowered entity concentration and pairwise similarity. QuestGuard therefore improves deployability under explicit software contracts; it does not claim to optimize entertainment value, and its diversity measures capture structural rather than complete experiential or narrative diversity.
Palavras-chave: Large Language Models, Procedural Content Generation, Game Quests, Software Quality Assurance, Quality Gates, Continuous Integration, Automated Repair

Referências

Paul M. Duvall, Steve Matyas, and Andrew Glover. 2007. Continuous Integration: Improving Software Quality and Reducing Risk. Addison-Wesley Professional.

Roberto Gallotta, Graham Todd, Marvin Zammit, Sam Earle, Antonios Liapis, Julian Togelius, and Georgios N. Yannakakis. 2024. Large Language Models and Games: A Survey and Roadmap. arXiv:2402.18659 [cs.AI] DOI: 10.48550/arXiv.2402.18659

Marko Gluhak and Luka Pavlič. 2022. A Quality Gate Role in a Software Delivery Pipeline. In Proceedings of the Ninth Workshop on Software Quality Analysis, Monitoring, Improvement, and Applications (CEUR Workshop Proceedings, Vol. 3237). 1–12. [link]

Daniele Gravina, Ahmed Khalifa, Antonios Liapis, Julian Togelius, and Georgios N. Yannakakis. 2019. Procedural Content Generation through Quality Diversity. In 2019 IEEE Conference on Games. 1–8. DOI: 10.1109/CIG.2019.8848053

Minkyung Kim, Junsik Kim, Hwidong Bae,Woongcheol Yang, Sangdon Park, and Sohee Bae. 2025. State-Inference-Based Prompting for Natural Language Trading with Game NPCs. arXiv:2507.07203 [cs.AI] DOI: 10.48550/arXiv.2507.07203

Claire Le Goues, ThanhVu Nguyen, Stephanie Forrest, andWestleyWeimer. 2012. GenProg: A Generic Method for Automatic Software Repair. IEEE Transactions on Software Engineering 38, 1 (2012), 54–72. DOI: 10.1109/TSE.2011.104

Bertrand Meyer. 1992. Applying “Design by Contract”. Computer 25, 10 (1992), 40–51. DOI: 10.1109/2.161279

Flemming Nielson, Hanne Riis Nielson, and Chris Hankin. 1999. Principles of Program Analysis. Springer. DOI: 10.1007/978-3-662-03811-6

Ollama. 2026. Ollama Generate API Documentation. [link].

Benjamin C. Pierce. 2002. Types and Programming Languages. MIT Press.

Noor Shaker, Julian Togelius, and Mark J. Nelson. 2016. Procedural Content Generation in Games. Springer. DOI: 10.1007/978-3-319-42716-4

Eliezio Soares, Gustavo Sizilio, Jadson Santos, Daniel Alencar da Costa, and Uira Kulesza. 2022. The Effects of Continuous Integration on Software Development: A Systematic Literature Review. Empirical Software Engineering 27, 3 (2022), 78. DOI: 10.1007/s10664-021-10114-1

Jaewoo Song, Andrew Zhu, and Chris Callison-Burch. 2024. You Have Thirteen Hours in Which to Solve the Labyrinth: Enhancing AI Game Masters with Function Calling. arXiv:2409.06949 [cs.CL] DOI: 10.48550/arXiv.2409.06949

Adam Summerville, Sam Snodgrass, Michael Mateas, Santiago Ontañón, John R. H. Mariño, and Julian Togelius. 2018. Procedural Content Generation via Machine Learning. IEEE Transactions on Games 10, 3 (2018), 257–270. DOI: 10.1109/TG.2018.2846639

Penny Sweetser. 2024. Large Language Models and Video Games: A Preliminary Scoping Review. In Proceedings of the 6th ACM Conference on Conversational User Interfaces. 1–8. DOI: 10.1145/3640794.3665582

Julian Togelius, Georgios N. Yannakakis, Kenneth O. Stanley, and Cameron Browne. 2011. Search-Based Procedural Content Generation: A Taxonomy and Survey. IEEE Transactions on Computational Intelligence and AI in Games 3, 3 (2011), 172–186. DOI: 10.1109/TCIAIG.2011.2148116

Susanna Värtinen, Perttu Hämäläinen, and Christian Guckelsberger. 2024. Generating Role-Playing Game Quests With GPT Language Models. IEEE Transactions on Games 16, 1 (2024), 127–139. DOI: 10.1109/TG.2022.3228480

Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric P. Xing, Hao Zhang, Joseph E. Gonzalez, and Ion Stoica. 2023. Judging LLM-as-a-Judge with MTBench and Chatbot Arena. In Advances in Neural Information Processing Systems, Vol. 36. [link]
Publicado
08/09/2026
SOUZA, Lucas Vieira dos Santos; SILVESTRINI, Murilo Mazzotti; LUSQUINO FILHO, Leopoldo. QuestGuard: Quality Gates and Diversity-Aware Repair for Reliable LLM-Generated Game Quests. In: WORKSHOP SOBRE ENGENHARIA DE SOFTWARE PARA DESENVOLVIMENTO DE JOGOS (SE4GAMES), 2. , 2026, São Paulo/SP. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2026 . p. 17-23. DOI: https://doi.org/10.5753/se4games.2026.32875.