Introduction
Researchers have developed a "Game Engine Search" algorithm that learns the underlying rules and physics of a video game simply by watching gameplay video. Most AI research in gaming focuses on training agents to maximize scores, often treating the game as a "black box." This work addresses Automated Game Understanding: deriving a complete, formalized model of a game’s engine directly from visual input. By parsing pixels into symbolic facts and using a greedy search to find the simplest IF-THEN rules, the system reconstructs a functional forward-simulation model that outperforms standard deep learning approaches.
Methods: From Pixels to Symbolic Logic
The system employs a two-stage pipeline to bridge the gap between raw pixels and abstract logic:
- Frame Parsing: Using a pre-defined "sprite palette," the system locates objects in every frame and converts them into a list of facts (spatial coordinates, velocity, and neighbor relationships).
- Engine Search: A greedy search algorithm scans parsed frames for discrepancies between expected and actual outcomes. Upon finding an error, it generates a new IF-THEN rule (e.g., "IF Mario touches a floor, THEN set downward velocity to 0"). The search prioritizes simpler engines to avoid overfitting.
Experimental Setup
The study focuses on Super Mario Bros. (Level 1-1). Training data consisted of "speedrunner" videos for dense action sequences, while "explorer" videos were used for testing generalization. The learned engine was compared against a "Naive" baseline and a Convolutional Neural Network (CNN) designed for frame prediction.
Results and Key Insights
The symbolic rule-based approach proved superior to neural networks in capturing discrete game physics. While CNNs often produce "blurry" predictions, the learned engine maintains the sharp, discrete movements characteristic of the original game.
Quantitatively, the learned engine predicted future frames with significantly lower pixel error than the CNN baseline ($p < 2.2e^{-16}$). Furthermore, reinforcement learning agents trained on the learned engine performed identically to those trained on the actual game engine, demonstrating the model's functional equivalence and utility for agent planning.
Limitations and Future Work
The search process is currently computationally intensive, taking up to two weeks for a single level. Additionally, the system relies on hand-authored fact types and struggles with sudden visual shifts like "Game Over" screens or level transitions. Future work aims to automate fact discovery and scale the approach to 3D environments or real-world video.
Summary updated