CraftGround provides a lightweight and customizable environment for reinforcement learning experiments using Minecraft.
- Installation
- Run your first experiment
- Environment Specifications
- Technical Details
- License and Acknowledgements
- Development / Customization
conda create -n my_experiment_env python=3.11
conda activate my_experiment_env
conda install conda-forge::openjdk=21 conda-forge::cmake conda-forge::glew-dev conda-forge::libpng conda-forge::libzlib conda-forge::libopengl conda-forge::libflite
pip install craftground
Refer to the provided Dockerfile for a complete setup.
sudo apt-get update
sudo apt-get install -y openjdk-21-jdk python3-pip git \
libgl1-mesa-dev libegl1-mesa-dev libglew-dev \
libglu1-mesa-dev xorg-dev libglfw3-dev xvfb
apt-get clean
pip3 install --upgrade pip
pip3 install cmake # You need latest cmake, not the one provided by apt-get
pip3 install craftground
Note: you may need to enable long file path due to windows limitation. You can enable it by editing registry as mentioned here
In the latest versions of Windows, this limitation can be expanded to approximately 32,000 characters. Your administrator will need to activate the “Enable Win32 long paths” group policy, or set LongPathsEnabled to 1 in the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem.
The following command does the same as the above instruction:
reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f
Using conda is recommended for Windows users. You can install conda from here. Make sure to execute
powershell -ExecutionPolicy Bypass
conda init powershell
if you are using PowerShell, in the anaconda powershell prompt.
Refer to Headless Environment Setup for setting up a headless environment.
pip install git+https://github.com/yhs0602/CraftGround.git@dev
- Check the example repository for benchmarking experiments.
from craftground import craftground
from stable_baselines3 import A2C
# Initialize environment
env = craftground.make(port=8023, isWorldFlat=True, ...)
# Train model
model = A2C("MlpPolicy", env, verbose=1)
model.learn(total_timesteps=10000)
model.save("a2c_craftground")
For detailed specifications, refer to the following documents:
See Technical Details for detailed technical information.
This project is licensed under the LGPL v3.0 license. The project includes code from the following sources:
- Source: Dejavu Fonts
This project includes code licensed under the GNU Lesser General Public License v3.0:
- Source: Gamma Utils project
This project includes code from the Fabric Carpet project, licensed under the MIT License:
- Source: Fabric-Carpet Project
For detailed development and customization instructions, see Develop.