Spaces:
Sleeping
Doom Environment - GIF Generation Guide
This guide explains how to generate GIFs of different Doom scenarios for the README.
Quick Start
# Navigate to doom_env directory
cd src/envs/doom_env
# Install with GIF generation dependencies
pip install -e ".[gif_generation]"
# Or install specific packages
pip install imageio
# Generate GIFs (this will take a few minutes)
python generate_gifs.py
What Gets Generated
The script will create 4 GIF files in the assets/ directory:
- basic.gif - Basic scenario showing simple movement and shooting
- deadly_corridor.gif - Corridor navigation with monsters
- defend_the_center.gif - Defending a central position
- health_gathering.gif - Collecting health packs
Each GIF will be:
- 80 frames long
- 12 fps (frames per second)
- 320x240 resolution
- Approximately 1-3 MB in size
Custom Generation
You can customize the generation:
# Different scenarios
python generate_gifs.py --scenario basic my_way_home take_cover
# More frames and higher FPS
python generate_gifs.py --frames 150 --fps 20
# Higher resolution (larger file size)
python generate_gifs.py --resolution RES_640X480
# Single scenario
python generate_gifs.py --scenario basic --frames 100 --fps 15
Available Scenarios
basic- Simple movement and shootingdeadly_corridor- Navigate corridor with monstersdefend_the_center- Defend central positiondefend_the_line- Defend a line against enemieshealth_gathering- Collect health packsmy_way_home- Navigate to target locationpredict_position- Predict object positionstake_cover- Learn cover mechanics
Troubleshooting
ImportError: No module named 'imageio'
Install with GIF generation support:
pip install -e ".[gif_generation]"
Or install imageio directly:
pip install imageio
ImportError: No module named 'vizdoom'
Install the doom_env package (includes ViZDoom):
pip install -e .
Scenario not found
Make sure you're using one of the built-in scenario names listed above, or provide a full path to a .cfg file:
python generate_gifs.py --scenario /path/to/custom_scenario.cfg
README Integration
The GIFs are already referenced in the README.md file in the "Scenarios Gallery" section. Once generated, they will automatically display when viewing the README.
The references look like:

Re-generating GIFs
To update the GIFs with different settings or refresh them:
- Delete old GIFs:
rm assets/*.gif - Run the generator with your desired settings
- The new GIFs will replace the old ones
Note
The script runs headless (no window) and uses random actions to showcase the environments. The GIFs show what the agent sees, not necessarily optimal gameplay.