✨ Imagine the richness of Minecraft: open worlds, procedural generation, fully destructible voxel environments... but open source, without Java, easily extensible in Lua, and with the modern Gymnasium and PettingZoo APIs for AI single-and multi-agent research... This is Craftium! ✨

Craftium is a fully open-source platform for creating fast, rich, and diverse single and multi-agent environments. Craftium is based on the amazing Luanti voxel game engine and the popular Gymnasium and PettingZoo APIs.
Check the installation instructions and the getting started pages to start using craftium!
- GitHub repository: https://github.com/mikelma/craftium
- Online documentation: https://craftium.readthedocs.io/en/latest/
- Paper (ArXiv): https://arxiv.org/abs/2407.03969
Features ✨
-
Super extensible 🧩: Luanti is built with modding in mind! The game engine is completely extensible using the Lua programming language. Easily create mods to implement the environment that suits the needs of your research! See environments for a showcase of what is possible with craftium.
-
Blazingly fast ⚡: Craftium achieves +2K steps per second more than Minecraft-based alternatives! Environment richness, 3D, computational efficiency all meet in craftium!
-
Extensive documentation 📚: Craftium extensively documents how to use existing environments and create new ones. The documentation also includes a low-level reference of the exported Python classes and gymnasium Wrappers, extensions to the Lua API, and code examples. Moreover, Craftium greatly benefits from existing Luanti documentation like the wiki, reference, and modding book.
-
Modern API 🤖: Craftium implements the well-known Gymnasium's PettingZoo APIs, opening the door to a huge number of existing tools and libraries compatible with these APIs. For example, stable-baselines3 or CleanRL (check examples section!).
-
Fully open source 🤠: Both, craftium and Luanti are fully open-source projects. This allowed us to modify Luanti's source code to tightly integrate it with our library, reducing the number of ugly hacks.
-
No more Java 👹: The Minecraft game is written in Java, not a very friendly language for clusters and high-performance applications. Contrarily, Luanti is written in C++, much more friendly for clusters, and highly performant!
Citing Craftium 📑
To cite Craftium in publications:
@article{malagon2024craftium,
title={Craftium: An Extensible Framework for Creating Reinforcement Learning Environments},
author={Mikel Malag{\'o}n and Josu Ceberio and Jose A. Lozano},
journal={arXiv preprint arXiv:2407.03969},
year={2024}
}
Contributing 🏋️
We appreciate contributions to craftium! craftium is in early development, so many possible improvements and bugs are expected. If you have found a bug or have a suggestion, please consider opening an issue if it isn't already covered. In case you want to submit a fix or an improvement to the library, pull requests are also very welcome!