A Benchmark Environment for Offline Reinforcement Learning in Racing Games

Girolamo Macaluso, Alessandro Sestini, Andrew D. Bagdanov

Introduction

In the development of high-fidelity AAA games, Reinforcement Learning (RL) is often hindered by the "sample hunger" of traditional online algorithms. Training agents through millions of trial-and-error interactions is computationally expensive and time-consuming in complex, high-resolution environments. Offline Reinforcement Learning (ORL) offers a compelling alternative by allowing agents to learn from pre-collected datasets, such as player logs or previous simulation runs, without requiring live environment interaction during the initial training phase.

While benchmarks for ORL exist in robotics and simple locomotion (e.g., D4RL), there is a notable lack of specialized testbeds for gaming. To address this, researchers have introduced OfflineMania, a Unity-based benchmark environment designed for high-speed navigation and complex visual-spatial tasks inspired by the TrackMania series.

The OfflineMania Environment

Developed using the Unity 3D engine and the ML-Agents toolkit, OfflineMania provides a high-fidelity racing task where the objective is to navigate a track as efficiently as possible.

Task and Action Space

The agent perceives its environment through 15 raycasts that detect obstacles and track boundaries, combined with its own velocity data. Control is managed through a continuous action space for steering, acceleration, and braking. The reward function is specifically tuned to encourage progress along the track's centerline while imposing heavy penalties for collisions, creating a clear signal for successful navigation.

Dataset Composition

A core contribution of the OfflineMania project is its diverse suite of datasets, generated by PPO agents at varying levels of proficiency:

  • Basic, Medium, and Expert: Each containing 100,000 transitions, representing a spectrum from agents that struggle with the first turn to those capable of perfect laps.
  • Mixed Datasets (mix large and mix small): These combine data from different expertise levels to test an algorithm's ability to "stitch" together optimal behaviors from inconsistent sources.
  • Small Datasets: Containing only 5,000 transitions, these are designed to test the robustness of algorithms under extreme data scarcity.

Experimental Results

The researchers evaluated three categories of algorithms: Online RL (PPO, SAC), Offline RL (CQL, TD3BC, IQL), and Offline-to-Online hybrid methods (JSRL, PEX, SDBG).

The Dominance of IQL

Implicit Q-Learning (IQL) emerged as the most effective offline method. It consistently outperformed other offline algorithms and, notably, was often able to derive a policy that exceeded the performance of the expert agent used to collect the original data. While PPO eventually learned the track after 15 million interactions, IQL achieved superior results using only static data.

The "Expertise Trap"

One of the more surprising findings was the failure of popular offline algorithms like TD3BC and CQL when trained on the expert dataset. Despite the high quality of the data, these models produced negative rewards and failed to navigate the track. The authors suggest this is due to high sensitivity to hyperparameters and a potential inability to generalize when the data distribution is too narrow or lacks sufficient exploration noise.

The Offline-to-Online Transition

Transitioning from offline pre-training to online fine-tuning remains a significant hurdle. When an offline-trained agent begins interacting with the live environment, it inevitably encounters states not present in the training data. This distributional shift often causes the Q-function—the agent's internal value estimator—to become highly inaccurate, leading to a collapse in performance.

In the challenging "mix small" dataset scenario, only the SDBG-IQL (Small Dataset Big Gains) approach successfully bridged this gap, significantly improving the offline policy during fine-tuning where standard IQL failed.

Conclusion and Future Work

OfflineMania establishes a robust framework for testing ORL in the context of gaming, highlighting both the potential of algorithms like IQL and the persistent challenges of distributional shift. Current "Offline-to-Online" methods still struggle to maintain performance during the transition to live environments.

Future iterations of the benchmark aim to expand into more complex track geometries, multi-agent racing scenarios, and the exploration of world-model-based augmentations to improve generalization from limited datasets.

Summary updated

BibTeX
@inproceedings{macaluso2024benchmark,
  author = {Girolamo Macaluso and Alessandro Sestini and Andrew D. Bagdanov},
  title = {{A Benchmark Environment for Offline Reinforcement Learning in Racing Games}},
  booktitle = {CoG},
  year = {2024},
  doi = {10.1109/cog60054.2024.10645657},
}
Figure