This repository contains the code for the project "The Legend of Zelda: Reinforcement Learning", it's purpose is to train an agent to play the game "The Legend of Zelda: Link's Awakening" for GameBoy using Reinforcement Learning.
Clone the repository
git clone https://github.com/msosav/zelda-reinforcement-learning
cd zelda-reinforcement-learning
Create a virtual environment and activate it
Note
You need to have python 3.11 installed in your machine.
python3.11 -m venv venv
source venv/bin/activate
Install the requirements
pip install -r requirements.txt
The program is divided into two main parts: the training and the testing.
Note
You need to create a folder called roms
in the root of the project and put the rom of the game "The Legend of Zelda: Link's Awakening" for GameBoy in it and name it ZeldaLinksAwakening.gb
.
To train the agent, run the following command:
python main.py train
To test the agent, run the following command:
python main.py test ./checkpoints/<checkpoint>.zip
Example:
python main.py test ./checkpoints/best_model_5000.zip
The reward system is based on the following rules:
+1
for each item in the inventory