Skip to main content

Native-vector Gymnasium environments for high-throughput ViZDoom rollouts

Project description

⚡ High-throughput ViZDoom rollouts, native-vector by design. ⚡

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-fork.git
cd ViZDoom-turbo-fork/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.2.tar.gz (73.1 kB 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.2-cp311-abi3-manylinux_2_28_x86_64.whl (246.0 kB view details)

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

vizdoom_turbo-0.1.2-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.2-cp311-abi3-macosx_11_0_arm64.whl (221.0 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

vizdoom_turbo-0.1.2-cp311-abi3-macosx_10_15_x86_64.whl (231.4 kB view details)

Uploaded CPython 3.11+macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: vizdoom_turbo-0.1.2.tar.gz
  • Upload date:
  • Size: 73.1 kB
  • 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.2.tar.gz
Algorithm Hash digest
SHA256 44e148044bab062e1989973a7eb813dc3f7bedc46e2e24eeee028f2831de64c2
MD5 5e4b18010d0a9348a29371ffa38b216b
BLAKE2b-256 8bc5cbf791c7fd07de31405416507fb56743155281804b613273ce584bf35a59

See more details on using hashes here.

Provenance

The following attestation bundles were made for vizdoom_turbo-0.1.2.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.2-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vizdoom_turbo-0.1.2-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 74342b816b06613748c5fc85c979de50b7c82a3673271a1ba1c516a3227a7f6d
MD5 5d87181a9d257f784902b843facf8b1e
BLAKE2b-256 e769a55c928ea5ede9de1e76b012ba1dae5710ac3a95bd6c1904e10f4b0b6241

See more details on using hashes here.

Provenance

The following attestation bundles were made for vizdoom_turbo-0.1.2-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.2-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for vizdoom_turbo-0.1.2-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ce860dc605b1ff0a891d612bebfd0e2e36977079053eab1274058eca9bbfc1ca
MD5 c6b0c810df56b289651712279b9f6701
BLAKE2b-256 26a7e1189c29ef82a9735740d9360cbe83197c8e8c12b772ce8c7277c67eab1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for vizdoom_turbo-0.1.2-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.2-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vizdoom_turbo-0.1.2-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34f80c5de56b638e2d0a11cd4499f561ea6e4df27dc95b65c3c9875c849dcd8f
MD5 da34ab879790ad5bba6224b4b3e255ae
BLAKE2b-256 313c815baae505f823d933180ede224e82dc03abb7a884019e62becdd025046c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vizdoom_turbo-0.1.2-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.2-cp311-abi3-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for vizdoom_turbo-0.1.2-cp311-abi3-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 cd0eeecb630b57b5b8fccb0c43449f8aa8b6e482403d21eb34eec9fa8fb17a6d
MD5 f1d98ece7c1f35ac0c6adee6aeb26653
BLAKE2b-256 69e553a8a4cfb0da7ecb7b7a0b9cd4961463b4e17c904a017e4abb7ce702bbbb

See more details on using hashes here.

Provenance

The following attestation bundles were made for vizdoom_turbo-0.1.2-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