OpenSpiel is a research framework for reinforcement learning and search or planning in games. It provides game environments, learning algorithms, and analysis tools under one API, with games represented as procedural extensive-form games plus some natural extensions.
The environments span n-player games (single-agent and multi-agent) that are zero-sum, cooperative, or general-sum, one-shot or sequential, turn-taking or simultaneous-move, and of perfect or imperfect information. It also includes traditional multi-agent environments such as partially and fully observable grid worlds and social dilemmas. Example games used in its tutorials include Kuhn poker, Leduc poker, and Goofspiel.
The core API and games are written in C++ and exposed to Python, and algorithms and tools are written in both languages, so OpenSpiel can also be used as a C++ library. Tutorials cover implementing algorithms such as CFR and REINFORCE, and analyzing learning dynamics with methods such as replicator dynamics.
Features
- Game coverage: zero-sum, cooperative, and general-sum games with perfect or imperfect information, turn-taking or simultaneous moves
- Multi-agent environments: grid worlds and social dilemmas alongside classic games
- Algorithms: reinforcement learning and search or planning algorithms, including CFR and REINFORCE
- Learning-dynamics analysis: tools to analyze learning dynamics and compute common evaluation metrics
- C++ core with Python bindings: games and the core API in C++, exposed to Python
- Extensive-form representation: games modeled as procedural extensive-form games

