Skip to content

A reinforcement learning model aiming to play through Minecraft.

License

Notifications You must be signed in to change notification settings

hhxc-0/dear_ender_dragon

Repository files navigation

dear_ender_dragon

Table of Contents

About

This project is focused on training reinforcement learning models to play Minecraft, with the ultimate goal of successfully playing through the game and defeating the Ender Dragon using only reinforcement learning techniques. The repository's name reflects this objective.

Currently, the training script supports training CNN models for simple tasks. I'm also developing a feature to use Optuna for automatic hyperparameter tuning. The PPO training script is based on the CleanRL implementation, and MineDojo is used as the training environment.

Setup

Follow these steps to set up the project. It is recommended to use a virtual environment such as venv or conda.

  1. Set Up MineDojo:

    • Refer to the MineDojo installation guide.
    • If you choose to install directly:
      • Use Python 3.9.5 for compatibility.
      • Downgrade pip, setuptools, and wheel using the following commands:
        pip install pip==23.1
        pip install setuptools==65.5.0 "wheel<0.40.0"
    • You might encounter Gradle build errors when running run_training.bat. Here are some potential error messages and their solutions:
      • If you encounter an error related to MixinGradle-dcfaf61, refer to the GitHub issue for a solution.
      • For errors related to mcpbot, check the solution provided here.
      • If certain classes fail to download, it might be due to inactive download sources. Search for a mirror source hosting the class file and add it to the Maven section in minedojo/sim/Malmo/Minecraft/build.gradle in your MineDojo installation directory.
      • If these solutions do not resolve your issue, consult the MineDojo or Malmo issue trackers.
      • At this rate, I’ll master Docker and Gradle just from setting up this project!
  2. Install Requirements:

    • Run the following command in the project root directory:
      pip install -r requirements.txt

Usage

  1. Run the launch script to start training:
    run_training.bat
  2. View TensorBoard statistics:
    run_tensorboard.bat