Skip to main content

Native-vector Gymnasium environments for high-throughput ViZDoom rollouts

Project description

vizdoom-turbo

vizdoom-turbo is a Python library for reinforcement-learning researchers who need fast, parallel ViZDoom environments. It provides a Gymnasium vector environment that can be used directly or selected as an isolated environment provider in rlab.

Each vector lane owns an independent DoomGame. Lanes advance concurrently through ViZDoom's native API, while Rust processes frames in batches for policy-ready observations.

Install

git clone git@github.com:tsilva/ViZDoom-turbo.git
cd ViZDoom-turbo
uv sync --all-extras

Run Python and project commands through uv run.

Use

import numpy as np
from vizdoom_turbo import VizdoomTurboVecEnv

env = VizdoomTurboVecEnv(
    "VizdoomBasic-v1",
    num_envs=16,
    num_threads=8,
    obs_resize=(84, 84),
    obs_grayscale=True,
    obs_layout="chw",
    frame_skip=4,
    frame_stack=4,
    use_restricted_actions="minimal",
)

try:
    observations, infos = env.reset(seed=7)
    actions = np.zeros(env.num_envs, dtype=np.int64)
    observations, rewards, terminated, truncated, infos = env.step(actions)

    done = terminated | truncated
    if np.any(done):
        observations, infos = env.reset(
            options={
                "reset_mask": done,
                "state_indices": np.zeros(env.num_envs, dtype=np.int32),
            }
        )
finally:
    env.close()

The package accepts registered Vizdoom... Gymnasium IDs and ViZDoom .cfg paths. It also registers ...-Turbo-v0 vector aliases for the built-in visual scenarios.

Use with rlab

Install this distribution in the rlab runtime, then select its provider:

environment:
  env_provider: vizdoom-turbo
  env_config:
    game: VizdoomBasic-v1
    state: default
    n_envs: 16
    env_args:
      num_threads: 8
      use_restricted_actions: minimal
      obs_grayscale: true
      obs_layout: chw
      frame_stack: 4
    preprocessing:
      frame_skip: 4
      max_pool_frames: true
      observation_size: 84
      obs_resize_algorithm: area
    task:
      id: identity
      action: {set: native}
      signals: {}
      events: {}
      termination: {}
      reward: {reward_mode: native}

Commands

uv sync --all-extras                                      # install project and dev dependencies
uv run pytest -q                                          # run Python and live-environment tests
uv run ruff check .                                       # lint Python
cargo fmt --check                                         # check Rust formatting
cargo clippy --all-targets --all-features -- -D warnings  # lint Rust
uv build --wheel                                          # build the distributable wheel

Notes

  • Python 3.11–3.14 is supported. Source builds require Rust 1.85 or newer.
  • ViZDoom 1.3.0 supplies built-in scenarios and Freedoom assets. Commercial Doom IWADs are not included; pass one with rom_path when required.
  • Autoreset is disabled. Terminal lanes retain their final observation and must be selected explicitly with a masked reset.
  • Preprocessing supports crop removal or masking, max-pooling, nearest/bilinear/area resize, grayscale or RGB, frame skip, frame stacking, and CHW or HWC layouts.
  • The native vector path supports image observations, rgb_array rendering, and one player. Recording is not supported.

Architecture

vizdoom-turbo architecture

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vizdoom_turbo-0.1.1.tar.gz (2.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vizdoom_turbo-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl (245.9 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ x86-64

vizdoom_turbo-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl (235.3 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

vizdoom_turbo-0.1.1-cp311-abi3-macosx_11_0_arm64.whl (220.9 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

vizdoom_turbo-0.1.1-cp311-abi3-macosx_10_15_x86_64.whl (231.1 kB view details)

Uploaded CPython 3.11+macOS 10.15+ x86-64

File details

Details for the file vizdoom_turbo-0.1.1.tar.gz.

File metadata

  • Download URL: vizdoom_turbo-0.1.1.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for vizdoom_turbo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 20304c941e46936fd99f4975af78350a1099975489cc1d84a013d4b50a0b4495
MD5 84cd20bc6af3f4a5d175e5ec8c7e866e
BLAKE2b-256 40f65097f3997e887007ec1216b7791bfaf3371ac6d7076abc073a594b59e2e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for vizdoom_turbo-0.1.1.tar.gz:

Publisher: release.yml on tsilva/ViZDoom-turbo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vizdoom_turbo-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vizdoom_turbo-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d43b7f7d282618d6f494fe0004dfd4867cea7ca1151710d39a114b20a87e79c3
MD5 fd699ebc5096586dafcd95417af90fc4
BLAKE2b-256 5d0b991984fe03abe8e77eec7cd59f002e01472dd2f7f7e891d3ca79908517fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for vizdoom_turbo-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on tsilva/ViZDoom-turbo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vizdoom_turbo-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for vizdoom_turbo-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a1b47c8e3df9b1a5bfd9367ff742eee8cc2df58faccae73e61a90d18c4c4a109
MD5 911d62aa284d628c89c3da635e553958
BLAKE2b-256 925cf2495807206a68a859c0fb5d0ee957da742042a1275402116b7d0097cad9

See more details on using hashes here.

Provenance

The following attestation bundles were made for vizdoom_turbo-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl:

Publisher: release.yml on tsilva/ViZDoom-turbo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vizdoom_turbo-0.1.1-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vizdoom_turbo-0.1.1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 307ea2b8af99012b76e2e4538b2b6b805f98bc66bd95dd699bda389fba4adde5
MD5 990b9205e19834af2c23a8d55e88c139
BLAKE2b-256 6e4898581f7cf67fcac7b1698c3ebb0940142573e01e08e34442e239805119a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for vizdoom_turbo-0.1.1-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on tsilva/ViZDoom-turbo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vizdoom_turbo-0.1.1-cp311-abi3-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for vizdoom_turbo-0.1.1-cp311-abi3-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3085469a171767161e3045ff81238ddd936a04ff9d9adb22482ff7f6311f855e
MD5 d87378d01c94102609575b6298897b4c
BLAKE2b-256 15990bf94b0ed027bd36cdc9cfbf95c87673ba9351eba06359e75b95c4caca10

See more details on using hashes here.

Provenance

The following attestation bundles were made for vizdoom_turbo-0.1.1-cp311-abi3-macosx_10_15_x86_64.whl:

Publisher: release.yml on tsilva/ViZDoom-turbo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page