4Hammer: a board-game reinforcement learning environment for the hour long time frame
Massimo Fioravanti, Giovanni Agosta
TL;DR
4Hammer tackles the challenge of long-horizon decision making by providing a digital reinforcement learning environment that emulates Warhammer 40,000 Combat Patrol. Built on the Rulebook DSL and a Godot-based graphical engine, it supports both headless RL and graphical interaction to facilitate LLM-based state understanding and traditional reinforcement learning. The architecture centers on modular libraries (Stats, Board, Rules) with serialization into textual, binary, and tensor formats, and includes drivers and outputs for integration with ML pipelines. Preliminary experiments validate robustness and demonstrate RL (PPO) in headless mode and graphical-driver testing with Gemini 2 Flash, establishing a testbed for hour-long, text-rich board-game AI research and LLM evaluation.
Abstract
Large Language Models (LLMs) have demonstrated strong performance on tasks with short time frames, but struggle with tasks requiring longer durations. While datasets covering extended-duration tasks, such as software engineering tasks or video games, do exist, there are currently few implementations of complex board games specifically designed for reinforcement learning and LLM evaluation. To address this gap, we propose the 4Hammer reinforcement learning environment, a digital twin simulation of a subset of Warhammer 40,000-a complex, zero-sum board game. Warhammer 40,000 features intricate rules, requiring human players to thoroughly read and understand over 50 pages of detailed natural language rules, grasp the interactions between their game pieces and those of their opponents, and independently track and communicate the evolving game state.
