Skip to content

Commit 5ff7e32

Browse files
authored
Merge pull request #594 from Farama-Foundation/remove-gym-wrapper
Remove the original OpenAI Gym wrapper
2 parents 03ed0a5 + 53cfa8a commit 5ff7e32

18 files changed

+35
-925
lines changed

Diff for: .github/workflows/build-docs-dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: sudo apt install cmake git libboost-all-dev libsdl2-dev libopenal-dev
2626

2727
- name: Install ViZDoom
28-
run: pip install .[gym]
28+
run: pip install .
2929

3030
- name: Install docs dependencies
3131
run: pip install -r docs/requirements.txt

Diff for: .github/workflows/build-docs-manual-version.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: sudo apt install cmake git libboost-all-dev libsdl2-dev libopenal-dev
3838

3939
- name: Install ViZDoom
40-
run: pip install .[gym]
40+
run: pip install .
4141

4242
- name: Install docs dependencies
4343
run: pip install -r docs/requirements.txt

Diff for: .github/workflows/build-docs-version.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: sudo apt install cmake git libboost-all-dev libsdl2-dev libopenal-dev
2323

2424
- name: Install ViZDoom
25-
run: pip install .[gym]
25+
run: pip install .
2626

2727
- name: Install docs dependencies
2828
run: pip install -r docs/requirements.txt

Diff for: README.md

+6-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ViZDoom is based on [ZDoom](https://zdoom.org) engine to provide the game mechan
1414
## Features
1515
- Multi-platform (Linux, macOS, Windows),
1616
- API for Python and C++,
17-
- [Gymnasium](https://gymnasium.farama.org/)/[OpenAI Gym](https://www.gymlibrary.dev/) environment wrappers (thanks to [Arjun KG](https://github.com/arjun-kg) [Benjamin Noah Beal](https://github.com/bebeal), [Lawrence Francis](https://github.com/ldfrancis), and [Mark Towers](https://github.com/pseudo-rnd-thoughts)),
17+
- [Gymnasium](https://gymnasium.farama.org/)/Gym environment wrappers (thanks to [Arjun KG](https://github.com/arjun-kg) [Benjamin Noah Beal](https://github.com/bebeal), [Lawrence Francis](https://github.com/ldfrancis), and [Mark Towers](https://github.com/pseudo-rnd-thoughts)),
1818
- Easy-to-create custom scenarios (visual editors, scripting language, and examples available),
1919
- Async and sync single-player and multiplayer modes,
2020
- Fast (up to 7000 fps in sync mode, single-threaded),
@@ -81,7 +81,7 @@ Both x86-64 and AArch64 (ARM64) architectures are supported.
8181
Wheels are available for Python 3.8+ on Linux.
8282

8383
If Python wheel is not available for your platform (Python version <3.8, distros below manylinux_2_28 standard), pip will try to install (build) ViZDoom from the source.
84-
ViZDoom requires a C++11 compiler, CMake 3.12+, Boost 1.54+ SDL2, OpenAL (optional), and Python 3.8+ to install from source. See [documentation](https://vizdoom.farama.org/introduction/pythonQuickstart/) for more details.
84+
ViZDoom requires a C++11 compiler, CMake 3.12+, Boost 1.54+ SDL2, OpenAL (optional), and Python 3.8+ to install from source. See [documentation](https://vizdoom.farama.org/introduction/python_quickstart/) for more details.
8585

8686

8787
### macOS
@@ -111,20 +111,13 @@ Wheels are available for Python 3.9+ on Windows.
111111

112112
Please note that the Windows version is not as well-tested as Linux and macOS versions.
113113
It can be used for development and testing but if you want to conduct serious (time and resource-extensive) experiments on Windows,
114-
please consider using [Docker](https://docs.docker.com/docker-for-windows/install/) or [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10) with Linux version.
114+
please consider using [Docker](https://docs.docker.com/docker-for-windows/install/) or [WSL](https://docs.microsoft.com/en-us/windows/wsl) with Linux version.
115115

116116

117117
### Gymnasium/Gym wrappers
118-
Gymnasium environments are installed along with ViZDoom.
118+
Gymnasium environments are installed along with ViZDoom and are available on all platforms.
119119
See [documentation](https://github.com/Farama-Foundation/ViZDoom/blob/master/doc/Gymnasium.md) and [examples](https://github.com/Farama-Foundation/ViZDoom/blob/master/examples/python/gymnasium_wrapper.py) on the use of Gymnasium API.
120120

121-
OpenAI-Gym wrappers are also available, to install them run:
122-
```
123-
pip install vizdoom[gym]
124-
```
125-
See [documentation](https://github.com/Farama-Foundation/ViZDoom/blob/master/doc/Gym.md) and [examples](https://github.com/Farama-Foundation/ViZDoom/blob/master/examples/python/gym_wrapper.py) on the use of Gym API.
126-
**OpenAI-Gym wrappers are deprecated and will be removed in future versions in favor of Gymnasium.**
127-
128121

129122
## Examples
130123
- [Python](https://github.com/Farama-Foundation/ViZDoom/blob/master/examples/python) (contain learning examples implemented in PyTorch, TensorFlow, and Theano)
@@ -166,6 +159,8 @@ Useful articles (for advanced users who want to create custom environments/scena
166159
- [LevDoom](https://github.com/TTomilin/LevDoom) - Generalization benchmark in ViZDoom featuring difficulty levels in visual complexity.
167160
- [COOM](https://github.com/hyintell/COOM) - Continual learning benchmark in ViZDoom offering task sequences with diverse objectives.
168161

162+
If you have a cool project that uses ViZDoom or could be interesting to ViZDoom community, feel free to open PR to add it to this list!
163+
169164

170165
## Contributions
171166
This project is maintained and developed in our free time. All bug fixes, new examples, scenarios, and other contributions are welcome! We are also open to feature ideas and design suggestions.

Diff for: docs/environments/default.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ game = vzd.DoomGame()
1515
game.load_config(os.path.join(vzd.scenarios_path, "basic.cfg")) # or any other scenario file
1616
```
1717

18-
When using Gymnasium (or Gym) API the scenario can be loaded by passing the scenario id to `make` method like-this:
18+
When using Gymnasium API the scenario can be loaded by passing the scenario id to `make` method like-this:
1919

2020
```{code-block} python
2121
import gymnasium

Diff for: docs/introduction/apis_and_wrappers.md

+5-13
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,19 @@ and implements the necessary API to function as a Gymnasium API.
3535

3636
See the following examples for use:
3737
- [examples/python/gymnasium_wrapper.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/gymnasium_wrapper.py) for basic usage
38-
- [examples/python/learning_stable_baselines.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/learning_stable_baselines.py) for example training with [stable-baselines3](https://github.com/DLR-RM/stable-baselines3/) (Update - Currently facing issues, to be fixed)
38+
- [examples/python/learning_stable_baselines.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/learning_stable_baselines.py) for example training with [stable-baselines3](https://github.com/DLR-RM/stable-baselines3/).
3939

4040

4141
## OpenAI Gym wrappers
4242

43-
> Gym is deprecated in favor of Gymnasium and these wrappers will be removed in the future.
43+
> Original OpenAI Gym wrappers are no longer maintained and were removed from master branch. We recommend using Gymnasium wrappers instead.
4444
45-
Installing ViZDoom with `pip install vizdoom[gym]` will include
46-
Gym wrappers to interact with ViZDoom over Gym API.
47-
48-
These wrappers are under `gym_wrappers`, containing the basic environment and
49-
a few example environments based on the built-in scenarios. This environment
50-
simply initializes ViZDoom with the settings from the scenario config files
51-
and implements the necessary API to function as a Gym API.
52-
53-
See the following examples for use:
54-
- [examples/python/gym_wrapper.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/gym_wrapper.py) for basic usage
45+
Installing ViZDoom version < 1.3.0 with `pip install vizdoom[gym]` will include
46+
Gym 0.26 wrappers to interact with ViZDoom over Gym API.
5547

5648

5749
## Julia, Lua, and Java APIs
5850

59-
> Julia, Lua, and Java bindings are no longer maintained.
51+
> Julia, Lua, and Java bindings are no longer maintained and were removed from master branch
6052
6153
Julia, Lua, and Java can be found in [julia](https://github.com/Farama-Foundation/ViZDoom/tree/julia) and [java&lua](https://github.com/Farama-Foundation/ViZDoom/tree/java%26lua) branches for manual building.

Diff for: docs/introduction/building.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Building from source
22

33
Here we describe how to build ViZDoom from source.
4-
If you want to install pre-build ViZDoom wheels for Python, see [Python quick start](./pythonQuickstart.md).
4+
If you want to install pre-build ViZDoom wheels for Python, see [Python quick start](./python_quickstart.md).
55

66

77
## Dependencies
@@ -67,7 +67,6 @@ python setup.py build && python setup.py install
6767

6868

6969
### MacOS
70-
7170
To build ViZDoom on MacOS, the following dependencies are required:
7271
* CMake 3.12+
7372
* Clang 5.0+
@@ -135,7 +134,6 @@ Instructions below can be used to build ViZDoom manually.
135134
We recommend doing it only if you want to use C++ API, work on the ViZDoom, or if you have problems with pip installation.
136135

137136
### Linux / MacOS
138-
139137
In ViZDoom's root directory:
140138
```bash
141139
mkdir build
@@ -148,7 +146,6 @@ where `-DBUILD_ENGINE=ON` and `-DBUILD_PYTHON=ON` CMake options are optional (de
148146

149147

150148
### Windows
151-
152149
1. Run CMake GUI or cmake command in cmd/powershell in ViZDoom root directory with the following paths provided:
153150
* BOOST_ROOT
154151
* BOOST_INCLUDEDIR
@@ -176,5 +173,4 @@ Compilation output will be placed in `build/bin` and it should contain the follo
176173

177174

178175
### Manual installation
179-
180176
To manually install Python package copy `vizdoom_root_dir/build/bin/pythonX.X/vizdoom` contents to `python_root_dir/lib/pythonX.X/site-packages/site-packages/vizdoom`.

Diff for: docs/introduction/python_quickstart.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Python quick start
22

3+
34
## Linux
45
To install the latest release of ViZDoom, just run:
56
```sh
@@ -9,7 +10,6 @@ Both x86-64 and AArch64 (ARM64) architectures are supported.
910
Wheels are available for Python 3.8+ on Linux.
1011

1112
### Audio buffer requirement
12-
1313
If you want to use audio buffer, you need to have OpenAL library installed.
1414
It is installed by default in many desktop distros. Otherwise it can be installed from the package manager.
1515
On apt-based distros (Ubuntu, Debian, Linux Mint, etc.), you can install it by running:
@@ -23,13 +23,11 @@ dnf install openal-soft
2323
On RHEL/CentOS/Alma/Rocky Linux 9, you may need first enable crb repository by running `dnf --enablerepo=crb install`.
2424

2525
### Installing from source distribution on Linux
26-
2726
If Python wheel is not available for your platform (distros incompatible with manylinux_2_28 standard), pip will try to install (build) ViZDoom from the source.
2827
ViZDoom requires a C++11 compiler, CMake 3.12+, Boost 1.54+ SDL2, OpenAL (optional), and Python 3.8+ to install from source.
2928
Below, you will find instructions on how to install these dependencies.
3029

3130
#### apt-based distros (Ubuntu, Debian, Linux Mint, etc.)
32-
3331
To build ViZDoom run (it may take a few minutes):
3432
```sh
3533
apt install cmake git libboost-all-dev libsdl2-dev libopenal-dev
@@ -38,7 +36,6 @@ pip install vizdoom
3836
We recommend using at least Ubuntu 18.04+ or Debian 10+ with Python 3.7+.
3937

4038
#### dnf/yum-based distros (Fedora, RHEL, CentOS, Alma/Rocky Linux, etc.)
41-
4239
To install ViZDoom, run (it may take a few minutes):
4340
```sh
4441
dnf install cmake git boost-devel SDL2-devel openal-soft-devel
@@ -48,7 +45,6 @@ We recommend using at least Fedora 35+ or RHEL/CentOS/Alma/Rocky Linux 9+ with P
4845
To install openal-soft-devel on RHEL/CentOS/Alma/Rocky Linux 9, one needs to enable crb repository first by running `dnf --enablerepo=crb install`.
4946

5047
### Installing master branch version
51-
5248
To install the master branch version of ViZDoom run:
5349
```sh
5450
pip install git+https://github.com/Farama-Foundation/ViZDoom
@@ -59,14 +55,20 @@ It requires the to have the above dependencies installed.
5955
## macOS
6056
To install the latest release of ViZDoom, just run (it may take a few minutes as it will build ViZDoom from source on M1/M2 chips):
6157
```sh
62-
brew install cmake boost sdl2 openal-soft
6358
pip install vizdoom
6459
```
65-
Both Intel and Apple Silicon (M1/2/3) CPUs are supported.
60+
Both Intel and Apple Silicon CPUs are supported.
61+
Pre-build wheels are available for Intel macOS 12.0+ and Apple Silicon macOS 14.0+.
62+
63+
If Python wheel is not available for your platform (Python version <3.8, older macOS version), pip will try to install (build) ViZDoom from the source.
64+
In this case, install the required dependencies using Homebrew:
65+
```sh
66+
brew install cmake boost sdl2 openal-soft
67+
```
6668
We recommend using at least macOS High Sierra 10.13+ with Python 3.8+.
67-
On Apple Silicon, make sure you are using Python/Pip for Apple Silicon.
69+
On Apple Silicon (M1, M2, and M3), make sure you are using Python/Pip for Apple Silicon.
6870

69-
To install the master branch version of ViZDoom, run:
71+
To install the master branch version of ViZDoom, run, in this case you also need to have the above dependencies installed:
7072
```sh
7173
pip install git+https://github.com/Farama-Foundation/ViZDoom
7274
```
@@ -78,9 +80,9 @@ To install the latest release of ViZDoom, just run:
7880
pip install vizdoom
7981
```
8082
At the moment, only x86-64 architecture is supported on Windows.
81-
Wheels are available for Python 3.8+ x86-64 on Windows.
83+
Wheels are available for Python 3.9+ x86-64 on Windows.
8284

8385
Please note that the Windows version is not as well-tested as Linux and macOS versions.
8486
It can be used for development and testing but if you want to conduct serious (time and resource-extensive) experiments on Windows,
85-
please consider using [Docker](https://docs.docker.com/docker-for-windows/install/) or [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10) with Linux version.
87+
please consider using [Docker](https://docs.docker.com/docker-for-windows/install/) or [WSL](https://docs.microsoft.com/en-us/windows/wsl) with Linux version.
8688
Windows version is bundled with OpenAL library, so you don't need to install it separately.

Diff for: examples/python/audio_buffer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# Setting game.set_sound_enabled(True) is not required for audio buffer to work.
2828
# Note: This requires OpenAL library to be installed on your system.
2929
# It is installed by default on many Linux desktop distros.
30-
# And it can be installed from package manager, see: https://vizdoom.farama.org/introduction/pythonQuickstart/#audio-buffer-requirements
30+
# And it can be installed from package manager, see: https://vizdoom.farama.org/introduction/python_quickstart/#audio-buffer-requirements
3131
AUDIO_BUFFER_ENABLED = True
3232
game.set_audio_buffer_enabled(AUDIO_BUFFER_ENABLED)
3333

@@ -95,7 +95,7 @@
9595
"[WARNING] Audio buffers were full of silence. This is a common bug on e.g. Ubuntu 20.04\n"
9696
" See https://github.com/Farama-Foundation/ViZDoom/pull/486\n"
9797
" There are some possible fixes:\n"
98-
" 1) Check that you have OpenAL installed, if not install, see: https://vizdoom.farama.org/introduction/pythonQuickstart/#audio-buffer-requirements\n"
98+
" 1) Check that you have OpenAL installed, if not install, see: https://vizdoom.farama.org/introduction/python_quickstart/#audio-buffer-requirements\n"
9999
" 2) Try setting game.add_game_args('+snd_efx 0'). This my disable some audio effects\n"
100100
" 3) Try installing a newer version of OpenAL Soft library, see https://github.com/Farama-Foundation/ViZDoom/pull/486#issuecomment-889389185"
101101
)

Diff for: examples/python/gym_wrapper.py

-21
This file was deleted.

Diff for: examples/python/gymnasium_wrapper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22

33
#####################################################################
4-
# Example for running a vizdoom scenario as a gym env
4+
# Example for running a vizdoom scenario as a Gymnasium env
55
#####################################################################
66

77
import gymnasium

Diff for: gym_wrapper/__init__.py

-62
This file was deleted.

0 commit comments

Comments
 (0)