关于无限跑游戏中LLM辅助重构与游戏玩法功能生成的探索性案例研究
An Exploratory Case Study of LLM-Assisted Refactoring and Gameplay Feature Generation in an Endless Runner Game
摘要
大型语言模型在软件开发中得到了广泛应用,但在游戏开发领域的实际应用效果却尚未得到充分研究,尤其是当生成的代码需要被整合到现有的游戏软件系统中时。本文通过一项探索性实证研究,对GPT-4o在自定义Python/Pygame endless runner游戏中的表现进行了分析。研究涉及了六个具体的开发任务:三个与本地化重构相关的任务,以及三个与游戏功能开发相关的任务。这些实现效果通过软件指标、单元测试以及手动游戏测试来进行评估。在这项研究中,所有三个本地化重构任务都成功完成,而三个游戏功能开发任务中只有一项实现了正确的集成效果。研究结果表明,在这种情境下,GPT-4o在处理本地化改造任务时表现得更为可靠,而处理需要跨多个现有系统进行新游戏交互的任务则相对困难。由于这是一项探索性研究,因此这些结果应被视为具有特殊意义的观察结果,而非可以推广到不同场景的模型性能证据。总体而言,本文为理解大型语言模型在现有游戏软件系统中的应用机会与限制提供了有价值的案例分析。
English Abstract
Large language models (LLMs) are increasingly used to support software development, but their practical usefulness in applied game-development settings remains underexplored, especially when generated code must be integrated into an existing game software system. This paper presents an exploratory empirical case study of GPT-4o in a custom Python/Pygame endless runner. The study examines six selected development tasks: three localized refactoring tasks and three tasks involving gameplay feature generation. The resulting implementations were evaluated using software metrics, unit tests, and manual gameplay assessments. In this case study, all three selected refactoring tasks were completed successfully in functional terms, whereas only one of the three selected gameplay feature generation tasks resulted in a correctly integrated feature. The findings suggest that, in this setting, GPT-4o handled localized transformations more reliably than tasks requiring new gameplay interactions across multiple existing systems. Given the exploratory single-case design, these results are best interpreted as indicative observations rather than as generalizable evidence of category-level model performance. Overall, the paper contributes a transparent case-based account of the opportunities and limitations of LLM-assisted refactoring and gameplay feature generation in an existing game software system.