Behavioural Cloning in VizDoom

Ryan Spick, Timothy J. Bradley, Ayush Raina, Pierluigi Vito Amadori, Guy Moss · DOI

Abstract

This paper describes methods for training autonomous agents to play the game "Doom 2" through Imitation Learning (IL) using only pixel data as input. We also explore how Reinforcement Learning (RL) compares to IL for humanness by comparing camera movement and trajectory data. Through behavioural cloning, we examine the ability of individual models to learn varying behavioural traits. We attempt to mimic the behaviour of real players with different play styles, and find we can train agents that behave aggressively, passively, or simply more human-like than traditional AIs. We propose these methods of introducing more depth and human-like behaviour to agents in video games. The trained IL agents perform on par with the average players in our dataset, whilst outperforming the worst players. While performance was not as strong as common RL approaches, it provides much stronger human-like behavioural traits to the agent.

Introduction

In the development of autonomous game agents, a significant gap exists between high performance and human-like behavior. While Reinforcement Learning (RL) agents can achieve superhuman performance, they often exhibit robotic, jerky movements that break player immersion. These agents typically require direct access to game engine data and optimize purely for rewards, leading to unnatural behaviors like instantaneous 180-degree turns. This research investigates whether Behavioural Cloning (BC), a form of Imitation Learning, can bridge this gap by training agents on visual input to capture the distinct "personalities" and movement patterns of human players.

Methodology

The researchers framed the problem as a supervised learning task, utilizing a dataset of human-vs-human VizDoom matches. The model was trained to predict actions (key presses and mouse movements) based on a sequence of past frames.

Technical Implementation

  • Multimodal Input: The agent processes a 5-channel input: RGB, a depth map, and a segmentation map. While depth and labels were used, the authors note these can be estimated from raw pixels, maintaining a "pixel-only" philosophy.
  • Architecture: A CNN feature extractor is coupled with a ConvLSTM, providing the agent with temporal memory.
  • Exponential Frame Skipping: To manage memory while maintaining a wide historical view, a novel exponential skip was used, keeping recent frames dense and older frames sparse.
  • Signed-MSE Loss: A custom loss function was implemented to reduce mouse jitter by heavily penalizing movements in the incorrect direction.

Results and Discussion

The study found that IL agents could achieve an average of 11 kills per 3-minute match, performing on par with average human players. Beyond raw performance, the agents successfully inherited the specific playstyles of the players they were trained on.

Personality and Trajectory

Trajectory heatmaps revealed that IL agents mirrored the movement patterns of their human counterparts. For instance, an agent trained on the player LeanCeiling adopted a cautious style, sticking to map edges, whereas one trained on PointlessSolitaire became an aggressive rusher.

Trajectory heatmap for player LeanCeiling, illustrating a cautious, edge-favoring playstyle.

Movement Smoothness

Quantitatively, IL agents exhibited camera movements statistically closer to humans than RL agents. Using Wasserstein distance to measure probability distributions, the researchers showed that IL agents' angular velocity and acceleration nearly matched human patterns, avoiding the high-acceleration spikes typical of RL agents that prioritize reward over energy conservation.

Conclusion

While IL agents face a performance ceiling compared to top-tier RL agents, they offer significantly more human-like behavior and distinct playstyles. The authors suggest that the "holy grail" might be a hybrid approach: using Behavioural Cloning for a human-like foundation and Reinforcement Learning for fine-tuning competitive performance without losing the human feel.

Summary updated

BibTeX
@misc{spick2024behavioural,
  author = {Ryan Spick and Timothy J. Bradley and Ayush Raina and Pierluigi Vito Amadori and Guy Moss},
  title = {{Behavioural Cloning in VizDoom}},
  year = {2024},
  eprint = {2401.03993},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.03993},
}
Figure