| Definition | gym-sokoban is an environment collection that simulate the classic Sokoban puzzle game, designed for reinforcement learning, challenging the irreversible mistake problem. |
| No of environments | 129 |
The gym-sokoban environment is a Python implementation of the classic Sokoban puzzle game, where players push boxes onto designated targets within a confined space. This environment presents unique challenges, especially for reinforcement learning algorithms, as it requires strategic thinking and the ability to anticipate the consequences of actions to avoid irreversible mistakes. The gym-sokoban package follows the guidelines established in DeepMind’s research on Imagination Augmented Agents, incorporating randomly generated rooms that ensure diverse training scenarios and prevent overfitting to predefined layouts. The game incorporates fundamental elements such as walls, boxes, targets, and a player, which interact dynamically based on a set of defined actions.
Each room’s configuration and complexity can vary, with rewards assigned based on gameplay actions: a reward of 10 points for completing the puzzle, positive and negative rewards for moving boxes on or off targets, and a penalty for each step taken to encourage efficiency. The environment supports multiple variations, including fixed targets, multiple players, and the ability to push or pull boxes, catering to various difficulty levels. Additionally, the environment features different rendering modes, such as standard visuals and TinyWorld graphics, providing flexibility in how the game is presented and interacted with, making it a valuable tool for both educational purposes and algorithm development.
| Example observations | |
| Example actions | |
| Example reward |

