### Install all ViZDoom dependencies on apt-based Linux (Ubuntu, Debian, Linux Mint) Source: https://vizdoom.farama.org/dev/building_from_source Install all optional and essential dependencies for building ViZDoom on apt-based systems. The first command install additional sound/music backends, the second installs only essential dependencies, and the third installs Python 3 development files. These may require root access. ```bash # All possible ViZDoom dependencies, # most are optional and required only to support alternative sound and music backends in the engine # other can replace libraries that are included in the ViZDoom repository apt install build-essential cmake git libsdl2-dev libboost-all-dev libopenal-dev \ zlib1g-dev libjpeg-dev tar libbz2-dev libgtk2.0-dev libfluidsynth-dev libgme-dev \ timidity libwildmidi-dev unzip ``` ```bash # Only essential ViZDoom dependencies apt install build-essential cmake git libboost-all-dev libsdl2-dev libopenal-dev ``` ```bash # Python 3 dependencies (alternatively Anaconda 3 installed) apt install python3-dev python3-pip # or install Anaconda 3 and add it to PATH ``` -------------------------------- ### Install IWAD into ViZDoom package (Python + shell) Source: https://vizdoom.farama.org/faq One-line shell command that uses Python to get the ViZDoom install path and then copies the WAD file there. Replace /path/to/file.wad with your actual file path. The destination filename is lowercased. ```bash src=/path/to/file.wad; dst_dir="$(python -c 'import vizdoom; print(vizdoom.install_path)')"; cp "$src" "$dst_dir/$(basename "${src,,}")" ``` -------------------------------- ### Install ViZDoom in editable mode Source: https://vizdoom.farama.org/dev/dev_guide Run these commands in the project root to install ViZDoom in editable mode. Requires pip, setuptools, and wheel to be installed and up-to-date. Use --no-build-isolation to keep CMake stable. ```bash pip install -U pip setuptools wheel pip install -e . --no-build-isolation ``` -------------------------------- ### Install ViZDoom main branch version Source: https://vizdoom.farama.org/introduction/python_quickstart Installs the main branch version of ViZDoom from GitHub. Requires the above dependencies to be installed. ```bash pip install git+https://github.com/Farama-Foundation/ViZDoom ``` -------------------------------- ### Install ViZDoom from Git repository via pip Source: https://vizdoom.farama.org/dev/building_from_source Builds and installs the newest version of ViZDoom directly from the GitHub repository using pip. Dependencies must be installed separately. ```bash pip install git+https://github.com/mwydmuch/ViZDoom.git ``` -------------------------------- ### Clone and install ViZDoom from source via pip Source: https://vizdoom.farama.org/dev/building_from_source Clones the ViZDoom repository and installs it locally with pip. On Windows, set BOOST_ROOT, VIZDOOM_BUILD_GENERATOR_NAME, and VIZDOOM_WIN_DEPS_ROOT before building. ```bash git clone https://github.com/mwydmuch/ViZDoom.git cd ViZDoom pip install . ``` -------------------------------- ### Sample ViZDoom Configuration File Source: https://vizdoom.farama.org/api/configuration_files A comprehensive example showing various configuration keys, including path settings, rendering options, rewards, and list-based parameters like available_buttons. ```text doom_game_path = freedoom2.wad doom_scenario_path = ../../scenarios/basic.wad doom_map = map01 # Rewards living_reward = -1 # Rendering options screen_resolution = RES_320X240 screen_format = CRCGCB render_hud = true render_crosshair = false render_weapon = true render_decals = false render_particles = false window_visible = true # make episodes start after 14 tics (after unholstering the gun) episode_start_time = 14 # make episodes finish after 300 actions (tics) episode_timeout = 300 # Available buttons available_buttons = { MOVE_LEFT MOVE_RIGHT ATTACK } # Game variables that will be in the state available_game_variables = { AMMO2 } # Default mode - the game is controlled from the code mode = PLAYER # Difficulty of gameplay ranging from 1 (baby) to 5 (nightmare) doom_skill = 5 ``` -------------------------------- ### Install OpenAL on apt-based distros Source: https://vizdoom.farama.org/introduction/python_quickstart Installs the OpenAL library required for audio buffer on apt-based distros (Ubuntu, Debian, Linux Mint, etc.). ```bash apt install libopenal1 ``` -------------------------------- ### Install essential ZDoom dependencies on dnf/yum-based Linux (Fedora, RHEL, CentOS) Source: https://vizdoom.farama.org/dev/building_from_source Install essential dependencies for building ViZDoom on Fedora, RHEL, CentOS, or similar systems. The first command installs core build tools and libraries, the second installs Python 3 development files. May require root access. ```bash # Essential ZDoom dependencies dnf install cmake git boost-devel SDL2-devel openal-soft-devel ``` ```bash # Python 3 dependencies (alternatively Anaconda 3 installed) dnf install python3-devel python3-pip ``` -------------------------------- ### Install IWAD into ViZDoom package (Python only) Source: https://vizdoom.farama.org/faq One-line Python command that copies a WAD file into the ViZDoom install path. Replace /path/to/file.wad with your actual file path. The destination filename is lowercased. ```python python -c 'import os,shutil,sys,vizdoom; src=sys.argv[1]; dst=os.path.join(vizdoom.install_path, os.path.basename(src).lower()); shutil.copy2(src,dst);' /path/to/file.wad ``` -------------------------------- ### init Source: https://vizdoom.farama.org/api/python/doom_game Initializes the ViZDoom game instance and starts a new episode. After calling this method, the first state from a new episode will be available. ```APIDOC ## init ### Description Initializes ViZDoom game instance and starts a new episode. After calling this method, the first state from a new episode will be available. Some configuration options cannot be changed after calling this method. Init returns `True` when the game was started properly and `False` otherwise. ### Method N/A (Python method) ### Endpoint N/A ### Parameters None ### Request Example N/A ### Response #### Success Response - **None** - No return value. #### Response Example N/A ``` -------------------------------- ### Build and install ViZDoom from source in conda environment Source: https://vizdoom.farama.org/dev/building_from_source Clone, build, and install ViZDoom manually within a conda environment. This is required after installing dependencies via conda. ```bash git clone https://github.com/Farama-Foundation/ViZDoom.git cd ViZDoom python setup.py build && python setup.py install ``` -------------------------------- ### Install pre-commit hooks Source: https://vizdoom.farama.org/dev/dev_guide Install pre-commit hooks to enforce code formatting and linting for Python code. ```bash pre-commit install ``` -------------------------------- ### Install ViZDoom on Linux with pip Source: https://vizdoom.farama.org/introduction/python_quickstart Installs the latest release of ViZDoom on Linux. Supports x86-64 and AArch64 architectures, with wheels for Python 3.10+. ```bash pip install vizdoom ``` -------------------------------- ### Install ViZDoom dependencies on macOS with homebrew Source: https://vizdoom.farama.org/dev/building_from_source Install dependencies for building ViZDoom on macOS using Homebrew. On Apple Silicon, ensure Homebrew is installed for arm64. ```bash brew install cmake boost sdl2 openal-soft ``` -------------------------------- ### Install Python type stub build dependencies Source: https://vizdoom.farama.org/dev/building_from_source Installs pybind11-stubgen, black, and isort, which are required to generate the vizdoom.pyi type stub during the build. ```bash pip install pybind11-stubgen black isort ``` -------------------------------- ### Install Doom assets with Python only Source: https://vizdoom.farama.org/introduction/python_quickstart Copies a Doom IWAD file into the ViZDoom package directory using a one-line Python command. Replace /path/to/file.wad with the actual path. ```python python -c 'import os,shutil,sys,vizdoom; src=sys.argv[1]; dst=os.path.join(vizdoom.install_path, os.path.basename(src).lower()); shutil.copy2(src,dst);' /path/to/file.wad ``` -------------------------------- ### Example config file for a custom ViZDoom scenario Source: https://vizdoom.farama.org/environments/creating_custom Defines the scenario path, map, rewards, episode timing, available buttons, game variables, and depth buffer for a custom ViZDoom map. Use this with the map created in the previous step. ```ini doom_scenario_path = mywad.wad doom_map = map01 # map in the wad file that will be used (wad can contain more than one map) living_reward = -1 # add -1 reward for each tic (action) episode_start_time = 14 # make episodes start after 14 tics (after unholstering the gun) episode_timeout = 300 # make episodes finish after 300 actions (tics) available_buttons = { # limit action space to only three buttons MOVE_LEFT MOVE_RIGHT ATTACK } available_game_variables = { # make information about ammo available in the state AMMO2 AMMO3 } depth_buffer_enabled = true # add depth buffer to the state ``` -------------------------------- ### Set up Homebrew environment for Apple Silicon Source: https://vizdoom.farama.org/dev/building_from_source Set up environment variables for Homebrew on Apple Silicon when both arm64 and x86 versions are installed. Use this command to point to the ARM Homebrew installation. ```bash eval "$(/opt/homebrew/bin/brew shellenv)" ``` -------------------------------- ### Install Doom assets with Python and shell Source: https://vizdoom.farama.org/introduction/python_quickstart Copies a Doom IWAD file into the ViZDoom package directory using a combination of Python and shell commands. Replace /path/to/file.wad with the actual path. ```bash src=/path/to/file.wad; dst_dir="$(python -c 'import vizdoom; print(vizdoom.install_path)')"; cp "$src" "$dst_dir/$(basename "${src,,}")" ``` -------------------------------- ### Build ViZDoom from source on apt-based distros Source: https://vizdoom.farama.org/introduction/python_quickstart Installs dependencies and builds ViZDoom from source on apt-based distros. Requires C++11 compiler, CMake 3.12+, Boost 1.54+, SDL2, OpenAL (optional), and Python 3.10+. May take a few minutes. ```bash apt install cmake git libboost-all-dev libsdl2-dev libopenal-dev pip install vizdoom ``` -------------------------------- ### Build ViZDoom from source on dnf/yum-based distros Source: https://vizdoom.farama.org/introduction/python_quickstart Installs dependencies and builds ViZDoom from source on dnf/yum-based distros. Requires C++11 compiler, CMake 3.12+, Boost 1.54+, SDL2, OpenAL (optional), and Python 3.10+. May take a few minutes. ```bash dnf install cmake git boost-devel SDL2-devel openal-soft-devel pip install vizdoom ``` -------------------------------- ### Build manylinux wheels with cibuildwheel Source: https://vizdoom.farama.org/dev/building_from_source Builds binary manylinux wheels for ViZDoom using cibuildwheel on Linux and macOS. Dependencies are installed automatically inside the Docker container. ```bash cibuildwheel --platform linux ``` -------------------------------- ### Install ViZDoom dependencies in conda environment Source: https://vizdoom.farama.org/dev/building_from_source Install dependencies using conda (e.g., miniconda) without root access. After installing dependencies, you must manually clone, build, and install ViZDoom from source. ```bash conda install -c conda-forge boost cmake gtk2 sdl2 openal-soft ``` -------------------------------- ### VizdoomEnv.__init__ Source: https://vizdoom.farama.org/api/python/gymnasium_wrapper Initializes the ViZDoom Gymnasium environment with configuration file, frame skip, action space settings, and render mode. ```APIDOC ## VizdoomEnv.__init__ ### Description Initializes the ViZDoom Gymnasium environment. Child classes are defined in gymnasium_env_defns.py. ### Method Constructor ### Signature ```python VizdoomEnv(config_file: str | None = None, frame_skip: int = 1, max_buttons_pressed: int = 0, render_mode: str | None = None, treat_episode_timeout_as_truncation: bool = True, use_multi_binary_action_space: bool = True, **kwargs: Any) ``` ### Parameters - **config_file** (Optional[str]) - Optional - The path to the config file to load. Most settings should be set by this config file. If None, all the necessary config must be provided in **kwargs. - **frame_skip** (int) - Optional - The number of frames the will be advanced per action. 1 = take action on every frame. Default: 1. - **max_buttons_pressed** (int) - Optional - Defines the number of binary buttons that can be selected at once. Default: 1. Should be >= 0. If < 0 a RuntimeError is raised. If == 0, the binary action space becomes `MultiBinary(len(num_binary_buttons))` or `MultiDiscrete([2] * num_binary_buttons)` (depending on `use_multi_binary_action_space` flag) and [0, `num_binary_buttons`] number of binary buttons can be selected. If > 0, the binary action space becomes `Discrete(n)` and `n` actions can be selected. `n` is equal to number of possible buttons combinations with the number of buttons pressed < `max_buttons_pressed`. - **render_mode** (Optional[str]) - Optional - The render mode to use could be either "human" or "rgb_array". - **skill_level** (Optional[int]) - Optional - If specified, sets the skill level (difficulty) of the game (overrides config file). Valid values are 1 to 5, where 1 is the easiest and 5 is the hardest. - **map** (Optional[str]) - Optional - If specified, sets the map to start. Should be a valid map ID defined in the WAD file (overrides config file). - **treat_episode_timeout_as_truncation** (bool) - Optional - If True, the episode will be treated as truncated when the internal episode timeout is reached. This is compatibility option, ViZDoom versions <1.3.0 behave as if this was set to False. Default: True. - **use_multi_binary_action_space** (bool) - Optional - If True, the `MultiBinary(len(num_binary_buttons))` action space will be used for buttons binary buttons instead of `MultiDiscrete([2] * len(num_binary_buttons))`. This is compatibility option, ViZDoom versions <1.3.0 behave as if this was set to False. Default: True. - ****kwargs** (Any) - Optional - Additional config options to set in the DoomGame after loading the config file. ### Notes - This environment forces the game window to be hidden. Use `render()` function to see the game. - Observations are dictionaries with different number of entries, depending on if depth/label buffers were enabled in the config file (CHANNELS == 1 if GRAY8, else 3): - "screen": The screen image buffer (always available) as np.ndarray in shape `(HEIGHT, WIDTH, CHANNELS)`. - "depth": The depth image as `np.ndarray` in shape `(HEIGHT, WIDTH, 1)`, if enabled by the config file. - "labels": The label image buffer as np.ndarray in shape `(HEIGHT, WIDTH, 1)`, if enabled by the config file. For info on labels, access env.state.labels variable. - "automap": The automap image buffer as `np.ndarray` in shape `(HEIGHT, WIDTH, CHANNELS)`, if enabled by the config file. - "gamevariables": All game variables, in the order specified by the config file. - Action space can be a single one of binary/continuous action space, or a `Dict` containing both: - "binary": Is `Discrete(num_binary_buttons + 1)` if `max_buttons_pressed` >= 1 or `MultiBinary(len(num_binary_buttons))` if `max_buttons_pressed` == 0 and `use_multi_binary_action_space` is True, or `MultiDiscrete([2] * num_binary_buttons)` if `max_buttons_pressed` == 0 and `use_multi_binary_action_space` is False, - "continuous": Is `Box(float32.min, float32.max, (num_delta_buttons,), float32)`. ``` -------------------------------- ### Python example: Load original Doom level with ViZDoom API Source: https://vizdoom.farama.org/environments/original_doom_levels Loads a Doom configuration file and sets the map and skill level. Use with doom.cfg, doom2.cfg, freedoom1.cfg, or freedoom2.cfg. Map IDs are like "E1M1" and skill levels range from 1 to 5. ```python import os import vizdoom as vzd game = vzd.DoomGame() game.load_config(os.path.join(vzd.scenarios_path, "doom.cfg")) # or doom2.cfg, freedoom1.cfg, freedoom2.cfg game.set_doom_map("E1M1") # see list of map IDs below game.set_doom_level(1) # or 2, 3, 4, 5 ``` -------------------------------- ### General game setting methods Source: https://vizdoom.farama.org/api/python/doom_game This section documents methods for configuring the automap buffer and various rendering options in the ViZDoom game environment. Each method is a direct callable on the DoomGame object. ```APIDOC ## is_automap_buffer_enabled ### Description Returns `True` if the automap buffer is enabled. ### Method `is_automap_buffer_enabled(self: vizdoom.DoomGame) -> bool` ### Parameters None. ### Returns - **bool** - `True` if the automap buffer is enabled, `False` otherwise. ### Notes - Added in 1.1.0. ``` ```APIDOC ## set_automap_buffer_enabled ### Description Enables rendering of the automap buffer, it will be available in the state. The buffer always has the same resolution as the screen buffer. ### Method `set_automap_buffer_enabled(self: vizdoom.DoomGame, automap_buffer: bool) -> None` ### Parameters - **automap_buffer** (bool) - Required - Whether to enable the automap buffer. ### Returns None. ### Notes - Default value: `False` - Has no effect when the game is running. - Config key: `automapBufferEnabled`/`automap_buffer_enabled` - See also: `GameState`, examples/python/automap_buffer.py, examples/python/buffers.py - Added in 1.1.0. ``` ```APIDOC ## set_automap_mode ### Description Sets the `AutomapMode` (`NORMAL`, `WHOLE`, `OBJECTS`, `OBJECTS_WITH_SIZE`), which determines what will be visible on it. ### Method `set_automap_mode(self: vizdoom.DoomGame, mode: vizdoom.AutomapMode) -> None` ### Parameters - **mode** (vizdoom.AutomapMode) - Required - The automap mode to set. ### Returns None. ### Notes - Default value: `NORMAL` - Config key: `automapMode`/`automap_mode` - Added in 1.1.0. ``` ```APIDOC ## set_automap_rotate ### Description Determine if the automap will be rotating with the player. If `False`, north always will be at the top of the buffer. ### Method `set_automap_rotate(self: vizdoom.DoomGame, rotate: bool) -> None` ### Parameters - **rotate** (bool) - Required - Whether the automap should rotate with the player. ### Returns None. ### Notes - Default value: `False` - Config key: `automapRotate`/`automap_rotate` - Added in 1.1.0. ``` ```APIDOC ## set_automap_render_textures ### Description Determine if the automap will be textured, showing the floor textures. ### Method `set_automap_render_textures(self: vizdoom.DoomGame, textures: bool) -> None` ### Parameters - **textures** (bool) - Required - Whether to render textures on the automap. ### Returns None. ### Notes - Default value: `True` - Config key: `automapRenderTextures`/`automap_render_textures` - Added in 1.1.0. ``` ```APIDOC ## set_automap_render_objects_as_sprites ### Description Controls whether things (objects, monsters, items, etc.) are rendered as sprites or as simple triangles on the automap. When enabled (`True`), things are displayed as rotated sprites with their actual appearance. When disabled (`False`), things are shown as simple triangular markers. Works only with `OBJECTS` and `OBJECTS_WITH_SIZE` automap modes. ### Method `set_automap_render_objects_as_sprites(self: vizdoom.DoomGame, sprites: bool) -> None` ### Parameters - **sprites** (bool) - Required - Whether to render objects as sprites. ### Returns None. ### Notes - Default value: `False` - Config key: `automapRenderObjectsAsSprites`/`automap_render_objects_as_sprites` - See also: `set_automap_mode()` - Added in 1.3.0. ``` ```APIDOC ## set_render_hud ### Description Determine if the hud will be rendered in the game. ### Method `set_render_hud(self: vizdoom.DoomGame, hud: bool) -> None` ### Parameters - **hud** (bool) - Required - Whether to render the HUD. ### Returns None. ### Notes - Default value: `False` - Config key: `renderHud`/`render_hud` ``` ```APIDOC ## set_render_minimal_hud ### Description Determine if the minimalistic version of the hud will be rendered instead of the full hud. ### Method `set_render_minimal_hud(self: vizdoom.DoomGame, min_hud: bool) -> None` ### Parameters - **min_hud** (bool) - Required - Whether to render the minimal HUD. ### Returns None. ### Notes - Default value: `False` - Config key: `renderMinimalHud`/`render_minimal_hud` - Added in 1.1.0. ``` ```APIDOC ## set_render_weapon ### Description Determine if the weapon held by the player will be rendered in the game. ### Method `set_render_weapon(self: vizdoom.DoomGame, weapon: bool) -> None` ### Parameters - **weapon** (bool) - Required - Whether to render the weapon. ### Returns None. ### Notes - Default value: `True` - Config key: `renderWeapon`/`render_weapon` ``` ```APIDOC ## set_render_crosshair ### Description Determine if the crosshair will be rendered in the game. ### Method `set_render_crosshair(self: vizdoom.DoomGame, crosshair: bool) -> None` ### Parameters - **crosshair** (bool) - Required - Whether to render the crosshair. ### Returns None. ### Notes - Default value: `False` - Config key: `renderCrosshair`/`render_crosshair` ``` ```APIDOC ## set_render_decals ### Description Determine if the decals (marks on the walls) will be rendered in the game. ### Method `set_render_decals(self: vizdoom.DoomGame, decals: bool) -> None` ### Parameters - **decals** (bool) - Required - Whether to render decals. ### Returns None. ### Notes - Default value: `True` - Config key: `renderDecals`/`render_decals` ``` ```APIDOC ## set_render_particles ### Description Determine if the particles will be rendered in the game. ### Method `set_render_particles(self: vizdoom.DoomGame, particles: bool) -> None` ### Parameters - **particles** (bool) - Required - Whether to render particles. ### Returns None. ### Notes - Default value: `True` - Config key: `renderParticles`/`render_particles` ``` ```APIDOC ## set_render_effects_sprites ### Description Determine if some effects sprites (gun puffs, blood splats etc.) will be rendered in the game. ### Method `set_render_effects_sprites(self: vizdoom.DoomGame, sprites: bool) -> None` ### Parameters - **sprites** (bool) - Required - Whether to render effect sprites. ### Returns None. ### Notes - Default value: `True` - Config key: `renderEffectsSprites`/`render_effects_sprites` - Added in 1.1.0. ``` ```APIDOC ## set_render_messages ### Description Determine if in-game messages (information about pickups, kills, etc.) will be rendered in the game. ### Method `set_render_messages(self: vizdoom.DoomGame, messages: bool) -> None` ### Parameters - **messages** (bool) - Required - Whether to render in-game messages. ### Returns None. ### Notes - Default value: `False` - Config key: `renderMessages`/`render_messages` - Added in 1.1.0. ``` ```APIDOC ## set_render_corpses ### Description Determine if actors’ corpses will be rendered in the game. ### Method `set_render_corpses(self: vizdoom.DoomGame, bodies: bool) -> None` ### Parameters - **bodies** (bool) - Required - Whether to render corpses. ### Returns None. ### Notes - Default value: `True` - Config key: `renderCorpses`/`render_corpses` - Added in 1.1.0. ``` ```APIDOC ## set_render_screen_flashes ### Description Determine if the screen flash effect upon taking damage or picking up items will be rendered in the game. ### Method `set_render_screen_flashes(self: vizdoom.DoomGame, flashes: bool) -> None` ### Parameters - **flashes** (bool) - Required - Whether to render screen flashes. ### Returns None. ### Notes - Default value: `True` - Config key: `renderScreenFlashes`/`render_screen_flashes` - Added in 1.1.0. ``` ```APIDOC ## set_render_all_frames ### Description Determine if all frames between states will be rendered (when skip greater than 1 is used). Allows smooth preview but can reduce performance. It only makes sense to use it if the window is visible. ### Method `set_render_all_frames(self: vizdoom.DoomGame, all_frames: bool) -> None` ### Parameters - **all_frames** (bool) - Required - Whether to render all frames between states. ### Returns None. ### Notes - Default value: `False` - Config key: `renderAllFrames`/`render_all_frames` - See also: `set_window_visible()` - Added in 1.1.3. ``` -------------------------------- ### Install OpenAL on dnf/yum-based distros Source: https://vizdoom.farama.org/introduction/python_quickstart Installs the OpenAL library required for audio buffer on dnf/yum-based distros (Fedora, RHEL, CentOS, Alma/Rocky Linux, etc.). On RHEL/CentOS/Alma/Rocky Linux 9, you may need to enable the crb repository first. ```bash dnf install openal-soft ``` -------------------------------- ### setEpisodeStartTime Source: https://vizdoom.farama.org/api/cpp/doom_game Sets the start time (delay) of every episode in tics. ```APIDOC ## setEpisodeStartTime ### Description Sets the start time (delay) of every episode in tics. Every episode will effectively start (from the user's perspective) after the provided number of tics. ### Method C++: `void setEpisodeStartTime(unsigned int tics)` Python: `set_episode_start_time(tics: int) -> None` ### Parameters - **tics** (unsigned int) - Required - The start time in tics. ### Default Value 1 ### Config Key `episodeStartTime`/`episode_start_time` ``` -------------------------------- ### Create environment with Gymnasium API Source: https://vizdoom.farama.org/environments/default Create a ViZDoom environment using the Gymnasium API. The import of gymnasium_wrapper registers all environments, and additional keyword arguments like frame_skip can be passed to make. ```python import gymnasium from vizdoom import gymnasium_wrapper # This import will register all the environments env = gymnasium.make("VizdoomBasic-v1", frame_skip=1) # or any other environment id ``` -------------------------------- ### getEpisodeStartTime Source: https://vizdoom.farama.org/api/cpp/doom_game Returns the start time (delay) of every episode in tics. ```APIDOC ## getEpisodeStartTime ### Description Returns the start time (delay) of every episode in tics. ### Method C++: `unsigned int getEpisodeStartTime()` Python: `get_episode_start_time() -> int` ### Returns - **unsigned int** - The start time in tics. ``` -------------------------------- ### set_episode_start_time Source: https://vizdoom.farama.org/api/python/doom_game Sets the start time (delay) of every episode in tics. ```APIDOC ## set_episode_start_time ### Description Sets the start time (delay) of every episode in tics. Every episode will effectively start (from the user's perspective) after the provided number of tics. ### Method set_episode_start_time ### Signature set_episode_start_time(_self : vizdoom.DoomGame_, _start_time : SupportsInt_) → None ### Parameters - **_self** (vizdoom.DoomGame) - Required - The DoomGame instance. - **_start_time** (SupportsInt) - Required - The start time in tics. ### Notes - Default value: 1 - Config key: `episodeStartTime`/`episode_start_time` ``` -------------------------------- ### new_episode Source: https://vizdoom.farama.org/api/python/doom_game Initializes a new episode. The state of the environment is completely restarted. If a recording file path is provided, the episode will be recorded to that file. ```APIDOC ## new_episode ### Description Initializes a new episode. The state of an environment is completely restarted (all variables and rewards are reset to their initial values). After calling this method, the first state from the new episode will be available. If the `recording_file_path` argument is not empty, the new episode will be recorded to this file (as a Doom lump). In a multiplayer game, the host can call this method to finish the game. Then the rest of the players must also call this method to start a new episode. ### Method N/A (Python method) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **recording_file_path** (str) - Optional - Path to the file where the episode will be recorded. Default is ''. ### Request Example N/A ### Response #### Success Response - **None** - No return value. #### Response Example N/A ``` -------------------------------- ### Load a custom config file with the original ViZDoom API Source: https://vizdoom.farama.org/environments/creating_custom Creates a DoomGame instance and loads a custom config file using load_config. Replace the placeholder with the actual path to your .cfg file. ```python game = vzd.DoomGame() game.load_config("") ``` -------------------------------- ### get_episode_start_time Source: https://vizdoom.farama.org/api/python/doom_game Returns the start time (delay) of every episode in tics. ```APIDOC ## get_episode_start_time ### Description Returns the start time (delay) of every episode in tics. ### Method get_episode_start_time ### Signature get_episode_start_time(_self : vizdoom.DoomGame_) → int ### Parameters - **_self** (vizdoom.DoomGame) - Required - The DoomGame instance. ### Returns - **int** - The start time in tics. ``` -------------------------------- ### Build ViZDoom on Linux and macOS Source: https://vizdoom.farama.org/dev/building_from_source Run these commands in the ViZDoom root directory to configure and compile the project using CMake. ```bash mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_ENGINE=ON -DBUILD_PYTHON=ON -DCREATE_PYTHON_STUBS=OFF make ``` -------------------------------- ### setArmorReward Source: https://vizdoom.farama.org/api/cpp/doom_game Sets the reward granted to the player for getting armor points. ```APIDOC ## setArmorReward ### Description Sets the reward granted to the player for getting armor points. A negative value is also allowed. ### Method C++: `void setArmorReward(double armorReward)` Python: `set_armor_reward(armor_reward: float) -> None` ### Parameters - **armorReward** (double/float) - Required - The reward value to set. ### Default Value 0 ### Config Key `armorReward` / `armor_reward` ### Notes Added in version 1.3.0. ``` -------------------------------- ### getArmorReward Source: https://vizdoom.farama.org/api/cpp/doom_game Returns the reward granted to the player for getting armor points. ```APIDOC ## getArmorReward ### Description Returns the reward granted to the player for getting armor points. ### Method C++: `double getArmorReward()` Python: `get_armor_reward() -> float` ### Returns - **double/float** - The reward value. ### Notes - Added in version 1.3.0 ``` -------------------------------- ### setHealthReward Source: https://vizdoom.farama.org/api/cpp/doom_game Sets the reward granted to the player for getting health points. ```APIDOC ## setHealthReward ### Description Sets the reward granted to the player for getting health points. A negative value is also allowed. ### Method C++: `void setHealthReward(double healthReward)` Python: `set_health_reward(health_reward: float) -> None` ### Parameters - **healthReward** (double/float) - Required - The reward value to set. ### Default Value 0 ### Config Key `healthReward` / `health_reward` ### Notes - Added in version 1.3.0 ```