#This repo is made for a project in Deep Learning and Multimedia Data Analysis in MCS Artificial Inteligence of Aistotle University of Thessaloniki.
This project implements Deep Reinforcement Learning (DRL) techniques to train agents to play Doom using the ViZDoom environment. The repository includes training scripts, utility functions, and custom gym environments for experimentation.
- DRL_Doom/train/: Contains training scripts and configurations.
- utils/: Includes utility functions such as
DoomGym.py
for custom gym environments. - DRL_Doom/github/ViZDoom/: Contains the ViZDoom environment files.
- scenarios/: Includes predefined Doom scenarios (
basic.cfg
,defend_the_center.cfg
,deadly_corridor_s1.cfg
) for training and testing.
- scenarios/: Includes predefined Doom scenarios (
-
Clone the Repository:
git clone <repository-url> cd DRL_Doom
-
Install Dependencies: Ensure you have Python installed. Then, install the required packages:
pip install -r requirements.txt
-
Set Up ViZDoom:
- Download and install the ViZDoom engine from ViZDoom GitHub.
- Ensure the
scenarios/
folder contains the necessary.cfg
files for the Doom scenarios.
In the testing baseline.ipynb you can see how the agent and env is initialized and how to run the project.
The DoomGym.py
file provides custom OpenAI Gym environments for different Doom scenarios:
VizDoomGym
: For thebasic.cfg
scenario.VizDoomGym_DC
: For thedefend_the_center.cfg
scenario.VizDoomGym_DeadlyCorridor
: For thedeadly_corridor_s1.cfg
scenario.
Example usage:
import gym
from utils.DoomGym import VizDoomGym
env = VizDoomGym(render=True, config="github/ViZDoom/scenarios/basic.cfg")
state = env.reset()
# Interact with the environment
action = env.action_space.sample()
state, reward, terminated, truncated, info = env.step(action)
The VizDoomGym_DeadlyCorridor
environment includes reward shaping based on:
- Movement reward.
- Damage taken and inflicted.
- Ammo usage.
This helps the agent learn more complex behaviors in challenging scenarios.
To visualize the logs, run the following on the log file.
tensorboard --logdir=.
This project is licensed under the MIT License. See the LICENSE
file for details.