[Paper Review] Towards Interactive Training of Non-Player Characters in Video Games
This paper proposes an interactive imitation learning framework for training non-player characters (NPCs) in video games using human-in-the-loop demonstrations. By employing a multi-resolution ensemble of Markov models with extended states that include action history, the method achieves high-performance NPC behaviors with minimal human effort, demonstrating effective skill acquisition in both a gym environment and a first-person shooter game within under a minute of interactive training.
There is a high demand for high-quality Non-Player Characters (NPCs) in video games. Hand-crafting their behavior is a labor intensive and error prone engineering process with limited controls exposed to the game designers. We propose to create such NPC behaviors interactively by training an agent in the target environment using imitation learning with a human in the loop. While traditional behavior cloning may fall short of achieving the desired performance, we show that interactivity can substantially improve it with a modest amount of human efforts. The model we train is a multi-resolution ensemble of Markov models, which can be used as is or can be further "compressed" into a more compact model for inference on consumer devices. We illustrate our approach on an example in OpenAI Gym, where a human can help to quickly train an agent with only a handful of interactive demonstrations. We also outline our experiments with NPC training for a first-person shooter game currently in development.
Motivation & Objective
- To address the scalability and realism limitations of hand-crafted NPC behaviors in video games.
- To enable game designers to train high-quality, human-like NPCs through interactive demonstrations with minimal intervention.
- To improve generalization and style fidelity in imitation learning by incorporating action history and quantized state representations.
- To develop a lightweight, real-time compatible model suitable for deployment on consumer hardware.
- To demonstrate the feasibility of interactive training in complex, open-world game environments.
Proposed method
- The method uses a multi-resolution ensemble of Markov models trained on human demonstrations to capture hierarchical and stylistic behaviors.
- Extended states are constructed by combining current observations with a history of recent actions (up to n steps), enhancing the model's ability to preserve human-like style.
- Quantization of state and action spaces enables generalization from limited demonstrations, reducing model complexity and improving inference speed.
- The model is trained iteratively with human-in-the-loop control, where the designer takes over when the agent fails, providing corrective demonstrations.
- The framework supports model compression via DAGGER or bootstrap-based data generation for deployment in real-time game environments.
- Game state features are transformed into relative, semantically meaningful representations (e.g., relative position, line of sight, health, ammo) to improve learning efficiency.
Experimental results
Research questions
- RQ1Can interactive, human-in-the-loop imitation learning significantly improve NPC behavior quality compared to standard behavior cloning?
- RQ2How effective is the use of extended states with action history in preserving stylistic elements of human gameplay?
- RQ3To what extent can quantized, multi-resolution Markov models generalize from a small number of interactive demonstrations?
- RQ4Can this method train competent, real-time responsive NPCs in complex, open-world first-person shooter games?
- RQ5How does the model’s performance scale with increasing numbers of interactive demonstrations and varying quantization schemes?
Key findings
- In the Lunar Lander environment, the model achieved substantially better performance than a random agent after only a few interactive demonstrations, with at least one episode fully solved.
- The Markov Ensemble model learned aggressive attack behaviors in a first-person shooter game within 40 seconds of human interaction, eliminating the need for hard-coded fallback logic.
- The model’s inference efficiency remained high, with loading and inference time scaling linearly with the number of demonstrations, enabling real-time use.
- Quantization of state and action spaces enabled effective generalization despite limited training data, improving robustness across unseen states.
- The method demonstrated that even sub-optimal human demonstrations significantly outperform random policies, especially when combined with interactive correction.
- The framework supports model compression via DAGGER or synthetic data generation, enabling deployment of compact, high-performance models on consumer-grade hardware.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.