Instruction-Driven Game Engines on Large Language Models
Hongqiu Wu, Yan Wang, Xingyuan Liu, Hai Zhao, Min Zhang
TL;DR
IDGE is a neural game engine built on LLMs that follows instruction scripts to autonomously progress turn-based gameplay by predicting next in-game states. It formulates gameplay as Next State Prediction with a curriculum that starts from a poker domain and generalizes to diverse variants; the NSP objective is $\sum_{t=1}^{T}\log p_\theta(s_t|s_{t-1},x_t,z)$, approximated with a dependence on the previous state ($k=1$) to manage long contexts. Training data come from a poker simulator and are balanced across rare states; a three-stage pipeline—Core Set warmup, Standard NSP training, and Diverse Segment Rephrasing—improves stability and linguistic generalization. In-domain experiments show fine-tuned, SR-enabled CodeLLaMA models achieve high state and round success, while out-of-domain scripts require few-shot samples or user-guided continue-training via DPO to reach satisfactory performance. The work suggests a practical path toward rapid, instruction-driven game design with LLM-based engines and prompts a broader exploration across more complex, real-time games.
Abstract
The Instruction-Driven Game Engine (IDGE) project aims to democratize game development by enabling a large language model (LLM) to follow free-form game rules and autonomously generate game-play processes. The IDGE allows users to create games by issuing simple natural language instructions, which significantly lowers the barrier for game development. We approach the learning process for IDGEs as a Next State Prediction task, wherein the model autoregressively predicts in-game states given player actions. It is a challenging task because the computation of in-game states must be precise; otherwise, slight errors could disrupt the game-play. To address this, we train the IDGE in a curriculum manner that progressively increases the model's exposure to complex scenarios. Our initial progress lies in developing an IDGE for Poker, a universally cherished card game. The engine we've designed not only supports a wide range of poker variants but also allows for high customization of rules through natural language inputs. Furthermore, it also favors rapid prototyping of new games from minimal samples, proposing an innovative paradigm in game development that relies on minimal prompt and data engineering. This work lays the groundwork for future advancements in instruction-driven game creation, potentially transforming how games are designed and played.
