Spaces:
Sleeping
Sleeping
File size: 2,863 Bytes
952f360 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# Doom Environment - GIF Generation Guide
This guide explains how to generate GIFs of different Doom scenarios for the README.
## Quick Start
```bash
# 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:
1. **basic.gif** - Basic scenario showing simple movement and shooting
2. **deadly_corridor.gif** - Corridor navigation with monsters
3. **defend_the_center.gif** - Defending a central position
4. **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:
```bash
# 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 shooting
- `deadly_corridor` - Navigate corridor with monsters
- `defend_the_center` - Defend central position
- `defend_the_line` - Defend a line against enemies
- `health_gathering` - Collect health packs
- `my_way_home` - Navigate to target location
- `predict_position` - Predict object positions
- `take_cover` - Learn cover mechanics
## Troubleshooting
### ImportError: No module named 'imageio'
Install with GIF generation support:
```bash
pip install -e ".[gif_generation]"
```
Or install imageio directly:
```bash
pip install imageio
```
### ImportError: No module named 'vizdoom'
Install the doom_env package (includes ViZDoom):
```bash
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:
```bash
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:
```markdown

```
## Re-generating GIFs
To update the GIFs with different settings or refresh them:
1. Delete old GIFs: `rm assets/*.gif`
2. Run the generator with your desired settings
3. 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.
|