A C++17 Baba Is You simulator with Python bindings, GUI, and reinforcement-learning examples
baba-is-auto simulates a subset of Baba Is You: it loads a text map, parses rules formed by word tiles, applies movement and object interactions, and exposes the resulting state to C++ and Python callers.
The repository provides:
- A reusable C++17 simulator library.
- A
pyBabaPython extension built with pybind11. - A pygame GUI that consumes the Python API.
- Gym-style reinforcement-learning environments with DQN and REINFORCE examples.
- An optional C++ ImGui level editor.
For the simulator design and behavior contract, see ARCHITECTURE.md. Contributors and coding agents should also read AGENTS.md.
Baba Is You is an award-winning puzzle game in which the rules are physical blocks. Moving those blocks can change the player, obstacles, and win condition while a level is in progress.
- CMake 3.31.6 or later
- A C++17 compiler
- Python 3 with development headers
- Git
Platform-specific tools:
- Windows: Visual Studio 2022 with the Desktop development with C++ workload.
- macOS: Xcode Command Line Tools, plus
autoconf,autoconf-archive,automake,curl,libtool,pkg-config,tar,unzip, andzip. - Ubuntu:
build-essential,autoconf,autoconf-archive,automake,curl,libtool,pkg-config,python3-dev,python3-setuptools,tar,unzip, andzip.
Clone and bootstrap vcpkg, then expose its location to CMake.
macOS and Linux:
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
export VCPKG_ROOT="$PWD/vcpkg"Windows PowerShell:
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
$env:VCPKG_ROOT = (Resolve-Path .\vcpkg)The environment variable only needs to be set in the shell used to build the project. Alternatively, set CMAKE_TOOLCHAIN_FILE to the absolute path of scripts/buildsystems/vcpkg.cmake inside the vcpkg checkout.
git clone https://github.com/utilForever/baba-is-auto.git
cd baba-is-autocmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Releasevcpkg installs the dependencies declared in vcpkg.json during configuration. The root CMake project then builds the baba-is-auto library, pyBaba extension, and UnitTests executable.
macOS and Linux:
./build/bin/UnitTestsWindows release builds:
.\build\bin\Release\UnitTests.exeBuild and install pyBaba with:
python -m pip install .Enable the optional editor feature and build its target:
cmake -S . -B build-editor -DBABA_BUILD_EDITOR=ON
cmake --build build-editor --target BabaEditor --config ReleaseEach bundled environment uses the actions UP, DOWN, LEFT, and RIGHT.
| Environment | Level | Algorithms |
|---|---|---|
baba-babaisyou-v0 |
Environment | DQN, REINFORCE |
baba-outofreach-v0 |
Environment | DQN, REINFORCE |
baba-volcano-v0 |
Environment | DQN, REINFORCE |
| Area | Paths |
|---|---|
| Core C++ API | Includes/baba-is-auto/ |
| Core C++ implementation | Sources/baba-is-auto/ |
| Python binding | Extensions/BabaPython/ |
| GUI simulator | Extensions/BabaGUI/ |
| Level editor | Extensions/BabaEditor/ |
| RL examples | Extensions/BabaRL/ |
| C++ and Python tests | Tests/UnitTests/, Tests/PythonTests/ |
| Map fixtures | Resources/Maps/ |
The C++ core is the source of simulator behavior, and Extensions/BabaPython/ mirrors its public surface. Changes to games, maps, rules, enums, objects, or agents should keep both layers in sync. The aggregate header Includes/baba-is-auto/baba-is-auto.hpp is generated during the CMake build; edit the individual headers or generator instead.
Run the Python checks used by CI after building the extension in place:
python -m pip install --require-hashes -r requirements.txt
python setup.py build_ext --inplace
python -m pytest Tests/PythonTests/GitHub Actions builds and tests the project on Ubuntu, macOS, and Windows. See AGENTS.md for the complete validation matrix and repository rules.
Issues and pull requests are welcome. Keep changes focused, add the narrowest test that covers behavior changes, and follow AGENTS.md.
Thank you to Arvi "Hempuli" Teikari for allowing this project to be developed. Baba Is You and its original game concepts belong to Hempuli.
This project is licensed under the MIT License.
Copyright © 2020-2026 Chris Ohk.