From 96d3f6f5448d610aa4122892f270bf5834f3e357 Mon Sep 17 00:00:00 2001 From: Marek Wydmuch Date: Fri, 15 Dec 2023 22:32:05 +0100 Subject: [PATCH 1/4] Update a lot of docstrings --- README.md | 2 +- docs/api/configurationFiles.md | 15 +- docs/api/cpp/doomGame.md | 458 +++++++-------- docs/api/cpp/enums.md | 27 +- docs/api/cpp/gameState.md | 20 +- docs/api/cpp/utils.md | 37 +- docs/api/python/enums.md | 39 +- docs/api/python/gameState.md | 22 +- docs/api/python/gym.md | 4 +- docs/api/python/utils.md | 2 +- docs/index.md | 2 +- scripts/create_python_docs_from_cpp_docs.py | 15 +- .../create_python_docstrings_from_cpp_docs.py | 36 +- src/lib_python/ViZDoomMethodsDocstrings.h | 548 ++++++++++++------ src/lib_python/ViZDoomPythonModule.cpp | 8 +- 15 files changed, 699 insertions(+), 536 deletions(-) diff --git a/README.md b/README.md index e41f5be2f..2176aacfd 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ViZDoom allows developing AI **bots that play Doom using only visual information** (the screen buffer). It is primarily intended for research in machine visual learning, and deep reinforcement learning, in particular. -ViZDoom is based on [ZDoom](https://github.com/rheit/zdoom) to provide the game mechanics. +ViZDoom is based on [ZDoom](https://zdoom.org) engine to provide the game mechanics. ![ViZDoom Demo](https://raw.githubusercontent.com/Farama-Foundation/ViZDoom/master/docs/_static/img/vizdoom-demo.gif) diff --git a/docs/api/configurationFiles.md b/docs/api/configurationFiles.md index 27f3d3ea7..ff7a25910 100644 --- a/docs/api/configurationFiles.md +++ b/docs/api/configurationFiles.md @@ -3,7 +3,7 @@ Instead of configuring the ViZDoom in code, you can load it from the configuration file(s). Each file is read sequentially, so multiple entries with the same key will overwrite previous entries. ## Format -Each entry in a configraution file is a pair of **key** and **value** separated by an equal sign (**"="**). The file format should also abide the following rules: +Each entry in a configraution file is a pair of **key** and **value** separated by an equal sign (**`=`**). The file format should also abide the following rules: * one entry per line (except for list parameters), * case insensitive @@ -14,10 +14,10 @@ Each entry in a configraution file is a pair of **key** and **value** separated A violation of any of these rules will result in ignoring **only** the line with the error and sending a warning message to stderr ("WARNING! Loading config from: ..."). ### List of values -**available_buttons** and **available_game_variables** are special parameters, which use multiple values and instead of a single value they expect a list of values separated by whitespaces and enclosed within braces ("{" and "}"). The list can stretch throughout multiple lines as long as all values are separated from each other by whitespaces. +**available_buttons** and **available_game_variables** are special parameters, which use multiple values and instead of a single value they expect a list of values separated by whitespaces and enclosed within braces (`{` and `}`). The list can stretch throughout multiple lines as long as all values are separated from each other by whitespaces. ### Appending values -Each list assignment (**KEY = { VALUES }**)clears values specified for this key before (in other configuration files or in the code). That is why the **append operator(*KEY += { VALUES })** is available. This way you can more easily combine multiple configuration files and tinker in code. +Each list assignment (**`KEY = { VALUES }`**)clears values specified for this key before (in other configuration files or in the code). That is why the **append operator (`KEY += { VALUES }`)** is available. This way you can more easily combine multiple configuration files and tinker in code. ### Supported configuration keys: * `audioBufferEnabled/audio_buffer_enabled` @@ -27,8 +27,8 @@ Each list assignment (**KEY = { VALUES }**)clears values specified for this key * `automapMode/automap_mode` * `automapRenderTextures/automap_render_textures` * `automapRotate/automap_rotate` -* `availableButtons/available_buttons` (list) -* `availableGameVariables/available_game_variables` (list) +* `availableButtons/available_buttons` (list of values) +* `availableGameVariables/available_game_variables` (list of values) * `consoleEnabled/console_enabled` * `deathPenalty/death_penalty` * `depthBufferEnabled/depth_buffer_enabled` @@ -64,8 +64,7 @@ Each list assignment (**KEY = { VALUES }**)clears values specified for this key * `ViZDoomPath/vizdoom_path` * `windowVisible/window_visible` - -See also: [`DoomGame`](DoomGame.md) for config keys and functions related to them. +Config keys are also mentioned for related methods in the documentation for `DoomGame` class. ### Sample configuration file content: @@ -114,4 +113,4 @@ mode = PLAYER doom_skill = 5 ``` -Other examples of configuration files can be found in [https://github.com/Farama-Foundation/ViZDoom/tree/master/scenarios](https://github.com/Farama-Foundation/ViZDoom/tree/master/scenarios) +Other examples of configuration files can be found in [scenarios](https://github.com/Farama-Foundation/ViZDoom/tree/master/scenarios) directory. diff --git a/docs/api/cpp/doomGame.md b/docs/api/cpp/doomGame.md index 86ae7c929..5306e3694 100644 --- a/docs/api/cpp/doomGame.md +++ b/docs/api/cpp/doomGame.md @@ -36,29 +36,27 @@ The game can be initialized again after being closed. | C++ | `void newEpisode(std::string recordingFilePath = "")` | | :-- | :-- | -| Python | `new_episode(recordingFilePath: str = "") -> None` | - -Changed in 1.1.0 +| Python | `new_episode(recording_file_path: str = "") -> None` | 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 `recordingFilePath` is not empty, the new episode will be recorded to this file (as a Doom lump). +If the `recordingFilePath` 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. +Note: Changed in 1.1.0 --- ### `replayEpisode` | C++ | `void replayEpisode(std::string filePath, unsigned int player = 0)` | | :-- | :-- | -| Python | `replay_episode(filePath: str, player: int = 0) -> None` | - -Added in 1.1.0 +| Python | `replay_episode(file_path: str, player: int = 0) -> None` | Replays the recorded episode from the given file using the perspective of the specified player. -Players are numbered from 1, If `player` is equal to 0, the episode will be replayed using the perspective of the default player in the recording file. +Players are numbered from 1, If `player` argument is equal to 0, +the episode will be replayed using the perspective of the default player in the recording file. After calling this method, the first state from the replay will be available. All rewards, variables, and states are available when replaying the episode. @@ -66,6 +64,8 @@ See also: - [examples/python/record_episodes.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/record_episodes.py) - [examples/python/record_multiplayer.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/record_multiplayer.py) +Note: added in 1.1.0. + --- ### `isRunning` @@ -74,7 +74,7 @@ See also: | :-- | :-- | | Python | `is_running() -> bool` | -Checks if the controlled game instance is running. +Returns true if the controlled game instance is running. --- @@ -84,9 +84,14 @@ Checks if the controlled game instance is running. | :-- | :-- | | Python | `is_multiplayer_game() -> bool` | -Added in 1.1.2 +Returns true if the game is in multiplayer mode. -Checks if the game is in multiplayer mode. +See also: +- [examples/python/multiple_instances.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/multiple_instances.py) +- [examples/python/cig_multiplayer.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/cig_multiplayer.py)) +- [examples/python/cig_multiplayer_host.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/cig_multiplayer_host.py)) + +Note: added in 1.1.2. --- @@ -96,9 +101,9 @@ Checks if the game is in multiplayer mode. | :-- | :-- | | Python | `is_recording_episode() -> bool` | -Added in 1.1.5 +Returns true if the game is in recording mode. -Checks if the game is in recording mode. +Note: added in 1.1.5. --- @@ -108,10 +113,9 @@ Checks if the game is in recording mode. | :-- | :-- | | Python | `is_replaying_episode() -> bool` | -Added in 1.1.5 - -Checks if the game is in replay mode. +Returns true if the game is in replay mode. +Note: added in 1.1.5. --- ### `setAction` @@ -131,12 +135,11 @@ or in the configuration file (in order of appearance). | C++ | `void advanceAction(unsigned int tics = 1, bool updateState = true)` | | :-- | :-- | -| Python | `advance_action(tics: int = 1, updateState: bool = True) -> None` | +| Python | `advance_action(tics: int = 1, update_state: bool = True) -> None` | -Processes the specified number of tics. If `updateState` is set, +Processes the specified number of tics. If `updateState` argument is set, the state will be updated after the last processed tic and a new reward will be calculated. -To get the new state, use `getState` and to get the new reward use `getLastReward`. -If `updateState` is not set, the state will not be updated. +To get the new state, use [`getState`](#getstate) and to get the new reward use [`getLastReward`](#getlastreward). --- @@ -169,7 +172,8 @@ Returns true if the current episode is in the initial state - the first state, n | Python | `is_episode_finished() -> bool` | Returns true if the current episode is in the terminal state (is finished). -[`makeAction`](#makeaction) and [`advanceAction`](#advanceaction) methods will take no effect after this point (unless [`newEpisode`](#newepisode) method is called). +[`makeAction`](#makeaction) and [`advanceAction`](#advanceaction) methods +will take no effect after this point (unless [`newEpisode`](#newepisode) method is called). --- @@ -221,13 +225,10 @@ See also: | :-- | :-- | | Python | `get_state() -> GameState` | -Changed in 1.1.0 - Returns [`GameState`](./gameState.md#gamestate) object with the current game state. If the current episode is finished, `nullptr/null/None` will be returned. -See also: -- [`GameState`](./gameState.md#gamestate) +Note: Changed in 1.1.0 --- @@ -237,12 +238,9 @@ See also: | :-- | :-- | | Python | `get_state_state() -> ServerState` | -Added in 1.1.6 - Returns [`ServerState`](./gameState.md#serverstate) object with the current server state. -See also: -- [`ServerState`](./gameState.md#serverstate) +Note: added in 1.1.6. --- @@ -253,7 +251,8 @@ See also: | Python | `get_last_action() -> list` | Returns the last action performed. -Each value corresponds to a button added with `[addAvailableButton](#addAvailableButton)` (in order of appearance). +Each value corresponds to a button added with [`setAvailableButtons`](#setAvailableButtons) +or/and [`addAvailableButton`](#addAvailableButton) (in order of appearance). Most useful in `SPECTATOR` mode. @@ -272,11 +271,11 @@ Returns number of current episode tic. | C++ | `void save(std::string filePath)` | | :-- | :-- | -| Python | `save(filePath: str) -> None` | +| Python | `save(file_path: str) -> None` | -Added in 1.1.9 +Saves a game's internal state to the file using ZDoom save game functionality. -Saves a game's internal state to the file using ZDoom's save game functionality. +Note: added in 1.1.9. --- @@ -284,15 +283,15 @@ Saves a game's internal state to the file using ZDoom's save game functionality. | C++ | `void load(std::string filePath)` | | :-- | :-- | -| Python | `load(filePath: str) -> None` | - -Added in 1.1.9 +| Python | `load(file_path: str) -> None` | -Loads a game's internal state from the file using ZDoom's load game functionality. +Loads a game's internal state from the file using ZDoom load game functionality. A new state is available after loading. Loading the game state does not reset the current episode state, tic counter/time and total reward state keep their values. +Note: added in 1.1.9. + ## Buttons settings methods @@ -302,12 +301,8 @@ tic counter/time and total reward state keep their values. | :-- | :-- | | Python | `get_available_buttons() -> list[Button]` | -Returns the list of available `Buttons`. - -See also: -- [`Enums: Button`](./enums.md#button) -- [`addAvailableButton`](#addavailablebutton) -- [`setAvailableButtons`](#addavailablebuttons) +Returns the list of available [`Button`](./enums.md#button) s, +that were added with [`setAvailableButtons`](#setavailablebuttons) or/and [`addAvailableButton`](#addavailablebutton) methods. --- @@ -317,16 +312,14 @@ See also: | :-- | :-- | | Python | `add_available_buttons(buttons: list | tuple[Button]) -> None` | -Sets given list of `Button`s (e.g. `TURN_LEFT`, `MOVE_FORWARD`) as available `Buttons`. +Sets given list of [`Button`](./enums.md#button) s (e.g. `TURN_LEFT`, `MOVE_FORWARD`) as available buttons. Has no effect when the game is running. -Config key: `availableButtons/available_buttons` (list) +Config key: `availableButtons`/`available_buttons` (list of values) See also: -- [`Enums: Button`](./enums.md#button) -- [`ConfigFile: List`](./configurationFiles.md#list) -- [`addAvailableButton`](#addavailablebutton) +- [Configuration files: List of values](../configurationFiles.md#list-of-values) --- @@ -336,18 +329,15 @@ See also: | :-- | :-- | | Python | `add_available_button(button: Button, maxValue: float = 0) -> None` | -Adds [`Button`](./enums.md#button) type (e.g. `TURN_LEFT`, `MOVE_FORWARD`) to available `Buttons` and sets the maximum allowed, absolute value for the specified button. -If the given button has already been added, it will not be added again, but the maximum value is overridden. +Adds [`Button`](./enums.md#button) type (e.g. `TURN_LEFT`, `MOVE_FORWARD`) to available buttons and sets the maximum allowed, absolute value for the specified button. +If the given button has already been added, it will not be added again, but the maximum value will be overridden. Has no effect when the game is running. -Config key: `availableButtons/available_buttons` (list) +Config key: `availableButtons`/`available_buttons` (list of values) See also: -- [`Enums: Button`](./enums.md#button) -- [`ConfigFile: List`](./configurationFiles.md#list) -- [`setAvailableButtons`](#addavailablebuttons) -- [`setButtonMaxValue`](#setbuttonmaxvalue) +- [Configuration files: List of values](../configurationFiles.md#list-of-values) --- @@ -357,13 +347,10 @@ See also: | :-- | :-- | | Python | `clear_available_buttons() -> None` | -Clears all available `Buttons` added so far. +Clears all available [`Button`](./enums.md#button)s added so far. Has no effect when the game is running. -See also: -- [`Enums: Button`](./enums.md#button) - --- ### `getAvailableButtonsSize` @@ -372,10 +359,7 @@ See also: | :-- | :-- | | Python | `get_available_buttons_size() -> int` | -Returns the number of available `Buttons`. - -See also: -- [`Enums: Button`](./enums.md#button) +Returns the number of available [`Button`](./enums.md#button) s. --- @@ -385,16 +369,13 @@ See also: | :-- | :-- | | Python | `set_button_max_value(button: Button, maxValue: float = 0) -> None` | -Sets the maximum allowed absolute value for the specified button. +Sets the maximum allowed absolute value for the specified [`Button`](./enums.md#button). Setting the maximum value to 0 results in no constraint at all (infinity). This method makes sense only for delta buttons. The constraints limit applies in all Modes. Has no effect when the game is running. -See also: -- [`Enums: Button`](./enums.md#button) - --- ### `getButtonMaxValue` @@ -403,10 +384,7 @@ See also: | :-- | :-- | | Python | `set_button_max_value(button: Button) -> int` | -Returns the maximum allowed absolute value for the specified button. - -See also: -- [`Enums: Button`](./enums.md#button) +Returns the maximum allowed absolute value for the specified [`Button`](./enums.md#button). --- @@ -416,10 +394,7 @@ See also: | :-- | :-- | | Python | `set_button(button: Button) -> float` | -Returns the current state of the specified button (`ATTACK`, `USE` etc.). - -See also: -- [`Enums: Button`](./enums.md#button) +Returns the current state of the specified [`Button`](./enums.md#button) (`ATTACK`, `USE` etc.). ## GameVariables methods @@ -431,12 +406,8 @@ See also: | :-- | :-- | | Python | `get_available_game_variables() -> list[GameVariables]` | -Returns the list of available `GameVariables`. - -See also: -- [`Enums: GameVariable`](./enums.md#gamevariable) -- [`addAvailableGameVariable`](#addavailablegamevariable) -- [`setAvailableGameVariables`](#setavailablegamevariables) +Returns the list of available [`GameVariable`](./enums.md#gamevariable) s, +that were added with [`setAvailableGameVariables`](#setavailablegamevariables) or/and [`addAvailableGameVariable`](#addavailablegamevariable) methods. --- @@ -446,16 +417,14 @@ See also: | :-- | :-- | | Python | `set_available_game_variables(variables: list | tuple[GameVariables]) -> None` | -Sets list of [`GameVariable`](./enums.md#gamevariable) as available `GameVariables` in the [`GameState`](./gameState.md#gamestate) returned by [`getState`](#getstate) method. +Sets list of [`GameVariable`](./enums.md#gamevariable) s as available game variables in the [`GameState`](./gameState.md#gamestate) returned by [`getState`](#getstate) method. Has no effect when the game is running. -Config key: `availableGameVariables/available_game_variables` (list) +Config key: `availableGameVariables`/`available_game_variables` (list of values) See also: -- [`Enums: GameVariable`](./enums.md#gamevariable) -- [`ConfigFile: List`](./configurationFiles.md#list) -- [`addAvailableGameVariable`](#addavailablegamevariable) +- [Configuration files: List of values](../configurationFiles.md#list-of-values) --- @@ -469,12 +438,10 @@ Adds the specified [`GameVariable`](./enums.md#gamevariable) to the list of avai Has no effect when the game is running. -Config key: `availableGameVariables/available_game_variables` (list) +Config key: `availableGameVariables`/`available_game_variables` (list of values) See also: -- [`Enums: GameVariable`](./enums.md#gamevariable) -- [`ConfigFile: List`](./configurationFiles.md#list) -- [`setAvailableGameVariables`](#setavailablegamevariables) +- [Configuration files: List of values](../configurationFiles.md#list-of-values) --- @@ -484,13 +451,12 @@ See also: | :-- | :-- | | Python | `clear_available_game_variables() -> None` | -Clears the list of available `GameVariables` that are included in the [`GameState`](./gameState.md#gamestate) returned by [`getState`](#getstate) method. +Clears the list of available [`GameVariable`](./enums.md#gamevariable) s that are included in the [`GameState`](./gameState.md#gamestate) returned by [`getState`](#getstate) method. Has no effect when the game is running. See also: -- [`Enums: GameVariable`](./enums.md#gamevariable) -- [`ConfigFile: List`](./configurationFiles.md#list) +- [Configuration files: List of values](../configurationFiles.md#list-of-values) --- @@ -500,11 +466,11 @@ See also: | :-- | :-- | | Python | `get_available_game_variables_size() -> int` | -Returns the number of available `GameVariables`. +Returns the number of available [`GameVariable`](./enums.md#gamevariable). +It corresponds to taking the size of the list returned by [`getAvailableGameVariables`](#getavailablegamevariables). See also: -- [`Enums: GameVariable`](./enums.md#gamevariable) -- [`ConfigFile: List`](./configurationFiles.md#list) +- [Configuration files: List of values](../configurationFiles.md#list-of-values) --- @@ -514,12 +480,9 @@ See also: | :-- | :-- | | Python | `get_game_variable(variable: GameVariable) -> float` | -Returns the current value of the specified game variable (`HEALTH`, `AMMO1` etc.). +Returns the current value of the specified [`GameVariable`](./enums.md#gamevariable) (`HEALTH`, `AMMO1` etc.). The specified game variable does not need to be among available game variables (included in the state). -It could be used for e.g. shaping. Returns 0 in case of not finding given `GameVariable`. - -See also: -- [`Enums: GameVariable`](./enums.md#gamevariable) +It could be used for e.g. shaping. Returns 0 in case of not finding given [`GameVariable`](./enums.md#gamevariable). ## Game arguments methods @@ -531,19 +494,19 @@ See also: | :-- | :-- | | Python | `set_game_args(args: str) -> None` | -Added in 1.3.0 - Sets custom arguments that will be passed to ViZDoom process during initialization. It is useful for changing additional game settings. Use with caution, as in rare cases it may prevent the library from working properly. Using this method is equivalent to first calling [`clearGameArgs`](#cleargameargs) and then [`addGameArgs`](#addgameargs). -Config key: `gameArgs/game_args` +Config key: `gameArgs`/`game_args` See also: - [ZDoom Wiki: Command line parameters](http://zdoom.org/wiki/Command_line_parameters) - [ZDoom Wiki: CVARs (Console Variables)](http://zdoom.org/wiki/CVARS) +Note: added in 1.2.3. + --- ### `addGameArgs` @@ -556,7 +519,7 @@ Adds custom arguments that will be passed to ViZDoom process during initializati It is useful for changing additional game settings. Use with caution, as in rare cases it may prevent the library from working properly. -Config key: `gameArgs/game_args` +Config key: `gameArgs`/`game_args` See also: - [ZDoom Wiki: Command line parameters](http://zdoom.org/wiki/Command_line_parameters) @@ -581,6 +544,8 @@ Clears all arguments previously added with [`setGameArgs`](#setgameargs) or/and Returns the additional arguments for ViZDoom process set with [`setGameArgs`](#setgameargs) or/and [`addGameArgs`](#addgameargs) methods. +Note: added in 1.2.3. + ## Reward methods @@ -599,13 +564,13 @@ Returns the reward granted to the player after every tic. | C++ | `void setLivingReward(double livingReward)` | | :-- | :-- | -| Python | `set_living_reward(livingReward: float) -> None` | +| Python | `set_living_reward(living_reward: float) -> None` | Sets the reward granted to the player after every tic. A negative value is also allowed. Default value: 0 -Config key: `livingReward/living_reward` +Config key: `livingReward`/`living_reward` --- @@ -623,13 +588,13 @@ Returns the penalty for the player's death. | C++ | `void setDeathPenalty(double deathPenalty)` | | :-- | :-- | -| Python | `set_death_penalty(deathPenalty: float) -> None` | +| Python | `set_death_penalty(death_penalty: float) -> None` | Sets a penalty for the player's death. Note that in case of a negative value, the player will be rewarded upon dying. Default value: 0 -Config key: `deathPenalty/death_penalty` +Config key: `deathPenalty`/`death_penalty` --- @@ -659,7 +624,7 @@ Returns the sum of all rewards gathered in the current episode. | C++ | `bool loadConfig(std::string filePath)` | | :-- | :-- | -| Python | `load_config(filePath: str) -> bool` | +| Python | `load_config(file_path: str) -> bool` | Loads configuration (resolution, available buttons, game variables etc.) from a configuration file. In case of multiple invocations, older configurations will be overwritten by the recent ones. @@ -667,10 +632,10 @@ Overwriting does not involve resetting to default values. Thus only overlapping The method returns true if the whole configuration file was correctly read and applied, false if the file contained errors. -If the file relative path is given, it will be searched for in the following order: current directory, current directory + `/scenarios/`, ViZDoom's installation directory + `/scenarios/`. +If the file relative path is given, it will be searched for in the following order: ``, `/scenarios/`, `/scenarios/`. See also: -- [ConfigFile](./configurationFiles.md) +- [Configuration files](../configurationFiles.md) --- @@ -680,10 +645,7 @@ See also: | :-- | :-- | | Python | `get_mode() -> Mode` | -Returns the current mode (`PLAYER`, `SPECTATOR`, `ASYNC_PLAYER`, `ASYNC_SPECTATOR`). - -See also: -- [`Enums: Mode`](./enums.md#mode) +Returns the current [`Mode`](./enums.md#mode) (`PLAYER`, `SPECTATOR`, `ASYNC_PLAYER`, `ASYNC_SPECTATOR`). --- @@ -693,7 +655,7 @@ See also: | :-- | :-- | | Python | `set_mode(mode: Mode) -> None` | -Sets the mode (`PLAYER`, `SPECTATOR`, `ASYNC_PLAYER`, `ASYNC_SPECTATOR`) in which the game will be running. +Sets the [`Mode`](./enums.md#mode) (`PLAYER`, `SPECTATOR`, `ASYNC_PLAYER`, `ASYNC_SPECTATOR`) in which the game will be running. Default value: `PLAYER`. @@ -701,9 +663,6 @@ Has no effect when the game is running. Config key: `mode` -See also: -- [`Enums: Mode`](./enums.md#mode) - --- ### `getTicrate` @@ -712,10 +671,10 @@ See also: | :-- | :-- | | Python | `get_ticrate() -> int` | -Added in 1.1.0 - Returns current ticrate. +Note: added in 1.1.0. + --- ### `setTicrate` @@ -724,8 +683,6 @@ Returns current ticrate. | :-- | :-- | | Python | `set_ticrate(ticrate: int) -> None` | -Added in 1.1.0 - Sets the ticrate for ASNYC Modes - number of logic tics executed per second. The default Doom ticrate is 35. This value will play a game at normal speed. @@ -738,19 +695,21 @@ Config key: `ticrate` See also: - [examples/python/ticrate.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/ticrate.py) +Note: added in 1.1.0. + --- ### `setViZDoomPath` | C++ | `void setViZDoomPath(std::string filePath)` | | :-- | :-- | -| Python | `set_vizdoom_path(filePath: str) -> None` | +| Python | `set_vizdoom_path(file_path: str) -> None` | Sets the path to the ViZDoom engine executable vizdoom. -Default value: "{vizdoom.so location}/{vizdoom or vizdoom.exe (on Windows)}". +Default value: `/`. -Config key: `ViZDoomPath/vizdoom_path +Config key: `ViZDoomPath`/`vizdoom_path` --- @@ -758,14 +717,14 @@ Config key: `ViZDoomPath/vizdoom_path | C++ | `void setDoomGamePath(std::string filePath)` | | :-- | :-- | -| Python | `set_doom_game_path(filePath: str) -> None` | +| Python | `set_doom_game_path(file_path: str) -> None` | Sets the path to the Doom engine based game file (wad format). -If not used DoomGame will look for doom2.wad and freedoom2.wad (in that order) in the directory of ViZDoom's installation (where vizdoom.so/pyd is). +If not used DoomGame will look for doom2.wad and freedoom2.wad (in that order) in the directory of ViZDoom's installation (where vizdoom library/pyd is). -Default value: "{vizdoom.so location}/{doom2.wad, doom.wad, freedoom2.wad or freedoom.wad}" +Default value: `/` -Config key: `DoomGamePath/doom_game_path` +Config key: `DoomGamePath`/`doom_game_path` --- @@ -773,14 +732,14 @@ Config key: `DoomGamePath/doom_game_path` | C++ | `void setDoomScenarioPath(std::string filePath)` | | :-- | :-- | -| Python | `set_doom_scenario_path(filePath: str) -> None` | +| Python | `set_doom_scenario_path(file_path: str) -> None` | Sets the path to an additional scenario file (wad format). If not provided, the default Doom single-player maps will be loaded. -Default value: "" +Default value: `""` -Config key: `DoomScenarioPath/set_doom_scenario_path` +Config key: `DoomScenarioPath`/`set_doom_scenario_path` --- @@ -792,9 +751,9 @@ Config key: `DoomScenarioPath/set_doom_scenario_path` Sets the map name to be used. -Default value: "map01", if set to empty "map01" will be used. +Default value: `"map01"`, if set to empty `"map01"` will be used. -Config key: `DoomMap/doom_map` +Config key: `DoomMap`/`doom_map` --- @@ -817,7 +776,7 @@ Takes effect from the next episode. Default value: 3 -Config key: `DoomSkill/doom_skill` +Config key: `DoomSkill`/`doom_skill` --- @@ -825,16 +784,16 @@ Config key: `DoomSkill/doom_skill` | C++ | `void setDoomConfigPath(std::string filePath)` | | :-- | :-- | -| Python | `set_doom_config_path(filePath: str) -> None` | +| Python | `set_doom_config_path(file_path: str) -> None` | Sets the path for ZDoom's configuration file. The file is responsible for the configuration of the ZDoom engine itself. If it does not exist, it will be created after the `vizdoom` executable is run. This method is not needed for most of the tasks and is added for the convenience of users with hacking tendencies. -Default value: "", if left empty "_vizdoom.ini" will be used. +Default value: `""`, if left empty `"_vizdoom.ini"` will be used. -Config key: `DoomConfigPath/doom_config_path` +Config key: `DoomConfigPath`/`doom_config_path` --- @@ -887,7 +846,7 @@ Every episode will effectively start (from the user's perspective) after the pro Default value: 1 -Config key: `episodeStartTime/episode_start_time` +Config key: `episodeStartTime`/`episode_start_time` --- @@ -911,7 +870,7 @@ Sets the number of tics after which the episode will be finished. 0 will result Default value: 0 -Config key: `episodeTimeout/episode_timeout` +Config key: `episodeTimeout`/`episode_timeout` ## Output/rendering setting methods @@ -923,19 +882,15 @@ Config key: `episodeTimeout/episode_timeout` | :-- | :-- | | Python | `set_screen_resolution(resolution: ScreenResolution) -> None` | -Sets the screen resolution. ZDoom engine supports only specific resolutions. -Supported resolutions are part of ScreenResolution enumeration (e.g., `RES_320X240`, `RES_640X480`, `RES_1920X1080`). +Sets the screen resolution and additional buffers (depth, labels, and automap). ZDoom engine supports only specific resolutions. +Supported resolutions are part of [`ScreenResolution`](./enums.md#screenresolution) enumeration (e.g., `RES_320X240`, `RES_640X480`, `RES_1920X1080`). The buffers, as well as the content of ViZDoom's display window, will be affected. Default value: `RES_320X240` Has no effect when the game is running. -Config key: `screenResolution/screen_resolution` - - -See also: -- [`Enums: ScreenResolution`](./enums.md#screenresolution) +Config key: `screenResolution`/`screen_resolution` --- @@ -956,17 +911,14 @@ Returns the format of the screen buffer and the automap buffer. | Python | `set_screen_format(format: ScreenFormat) -> None` | Sets the format of the screen buffer and the automap buffer. -Supported formats are defined in `ScreenFormat` enumeration type (e.g. `CRCGCB`, `RGB24`, `GRAY8`). +Supported formats are defined in [`ScreenFormat`](./enums.md#screenformat) enumeration type (e.g. `CRCGCB`, `RGB24`, `GRAY8`). The format change affects only the buffers, so it will not have any effect on the content of ViZDoom's display window. Default value: `CRCGCB` Has no effect when the game is running. -Config key: `screenFormat/screen_format` - -See also: -- [`Enums: ScreenFormat`](./enums.md#screenformat) +Config key: `screenFormat`/`screen_format` --- @@ -976,8 +928,6 @@ See also: | :-- | :-- | | Python | `is_depth_buffer_enabled() -> None` | -Added in 1.1.0 - Returns true if the depth buffer is enabled. @@ -986,23 +936,24 @@ Returns true if the depth buffer is enabled. | C++ | `void setDepthBufferEnabled(bool depthBuffer)` | | :-- | :-- | -| Python | `set_depth_buffer_enabled(depthBuffer: bool) -> None` | - -Added in 1.1.0 +| Python | `set_depth_buffer_enabled(depth_buffer: bool) -> None` | Enables rendering of the depth buffer, it will be available in the state. -Depth buffer will contain noise if `viz_nocheat` is enabled. +The buffer always has the same resolution as the screen buffer. +Depth buffer will contain noise if `viz_nocheat` flag is enabled. Default value: false Has no effect when the game is running. -Config key: `depthBufferEnabled/depth_buffer_enabled` +Config key: `depthBufferEnabled`/`depth_buffer_enabled` See also: - [`GameState`](./gameState.md#gamestate) - [examples/python/buffers.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/buffers.py) +Note: added in 1.1.0. + --- ### `isLabelsBufferEnabled` @@ -1011,35 +962,35 @@ See also: | :-- | :-- | | Python | `is_labels_buffer_enabled() -> None` | -Added in 1.1.0 - Returns true if the labels buffer is enabled. +Note: added in 1.1.0. + --- ### `setLabelsBufferEnabled` | C++ | `void setLabelsBufferEnabled(bool labelsBuffer)` | | :-- | :-- | -| Python | `set_labels_buffer_enabled(bool labelsBuffer) -> None` | - -Added in 1.1.0 +| Python | `set_labels_buffer_enabled(labels_buffer: bool) -> None` | -Enables rendering of the labels buffer, it will be available in the state with the vector of `Label`s. +Enables rendering of the labels buffer, it will be available in the state with the vector of [`Label`](./gameState.md#label) s. +The buffer always has the same resolution as the screen buffer. LabelsBuffer will contain noise if `viz_nocheat` is enabled. Default value: false Has no effect when the game is running. -Config key: `labelsBufferEnabled/labels_buffer_enabled` +Config key: `labelsBufferEnabled`/`labels_buffer_enabled` See also: -- [`GameState: Label`](./gameState.md#label) - [`GameState`](./gameState.md#gamestate) - [examples/python/labels.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/labels.py) - [examples/python/buffers.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/buffers.py) +Note: added in 1.1.0. + --- ### `isAutomapBufferEnabled` @@ -1048,32 +999,33 @@ See also: | :-- | :-- | | Python | `is_automap_buffer_enabled() -> bool` | -Added in 1.1.0 - Returns true if the automap buffer is enabled. +Note: added in 1.1.0. + --- ### `setAutomapBufferEnabled` | C++ | `void setAutomapBufferEnabled(bool automapBuffer)` | | :-- | :-- | -| Python | `set_automap_buffer_enabled(automapBuffer: bool) -> None` | - -Added in 1.1.0 +| Python | `set_automap_buffer_enabled(automap_buffer: bool) -> None` | Enables rendering of the automap buffer, it will be available in the state. +The buffer always has the same resolution as the screen buffer. Default value: false Has no effect when the game is running. -Config key: `automapBufferEnabled/automap_buffer_enabled` +Config key: `automapBufferEnabled`/`automap_buffer_enabled` See also: - [`GameState`](./gameState.md#gamestate) - [examples/python/buffers.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/buffers.py), +Note: added in 1.1.0. + --- ### `setAutomapMode` @@ -1082,17 +1034,14 @@ See also: | :-- | :-- | | Python | `set_automap_mode(mode: AutomapMode) -> None` | -Added in 1.1.0 - -Sets the automap mode (`NORMAL`, `WHOLE`, `OBJECTS`, `OBJECTS_WITH_SIZE`), +Sets the [`AutomapMode`](./enums.md#automapmode) (`NORMAL`, `WHOLE`, `OBJECTS`, `OBJECTS_WITH_SIZE`), which determines what will be visible on it. Default value: `NORMAL` -Config key: `automapMode/set_automap_mode` +Config key: `automapMode`/`set_automap_mode` -See also: -- [`Enums: AutomapMode`](./enums.md#automapmode) +Note: added in 1.1.0. --- @@ -1102,14 +1051,14 @@ See also: | :-- | :-- | | Python | `set_automap_rotate(rotate: bool) -> None` | -Added in 1.1.0 - Determine if the automap will be rotating with the player. If false, north always will be at the top of the buffer. Default value: false -Config key: `automapRotate/automap_rotate` +Config key: `automapRotate`/`automap_rotate` + +Note: added in 1.1.0. --- @@ -1119,13 +1068,13 @@ Config key: `automapRotate/automap_rotate` | :-- | :-- | | Python | `set_automap_render_textures(textures: bool) -> None` | -Added in 1.1.0 - Determine if the automap will be textured, showing the floor textures. Default value: true -Config key: `automapRenderTextures/automap_render_textures` +Config key: `automapRenderTextures`/`automap_render_textures` + +Note: added in 1.1.0. --- @@ -1139,7 +1088,7 @@ Determine if the hud will be rendered in the game. Default value: false -Config key: `renderHud/render_hud` +Config key: `renderHud`/`render_hud` --- @@ -1147,15 +1096,15 @@ Config key: `renderHud/render_hud` | C++ | `void setRenderMinimalHud(bool minHud)` | | :-- | :-- | -| Python | `set_render_minimal_hud(minHud: bool) -> None` | - -Added in 1.1.0 +| Python | `set_render_minimal_hud(min_hud: bool) -> None` | Determine if the minimalistic version of the hud will be rendered instead of the full hud. Default value: false -Config key: `renderMinimalHud/render_minimal_hud` +Config key: `renderMinimalHud`/`render_minimal_hud` + +Note: added in 1.1.0. --- @@ -1169,7 +1118,7 @@ Determine if the weapon held by the player will be rendered in the game. Default value: true -Config key: `renderWeapon/render_weapon` +Config key: `renderWeapon`/`render_weapon` --- @@ -1183,7 +1132,7 @@ Determine if the crosshair will be rendered in the game. Default value: false -Config key: `renderCrosshair/render_crosshair` +Config key: `renderCrosshair`/`render_crosshair` --- @@ -1197,7 +1146,7 @@ Determine if the decals (marks on the walls) will be rendered in the game. Default value: true -Config key: `renderDecals/render_decals` +Config key: `renderDecals`/`render_decals` --- @@ -1211,7 +1160,7 @@ Determine if the particles will be rendered in the game. Default value: true -Config key: `renderParticles/render_particles` +Config key: `renderParticles`/`render_particles` --- @@ -1221,13 +1170,13 @@ Config key: `renderParticles/render_particles` | :-- | :-- | | Python | `set_render_effects_sprites(sprites: bool) -> None` | -Added in 1.1.0 - Determine if some effects sprites (gun puffs, blood splats etc.) will be rendered in the game. Default value: true -Config key: `renderEffectsSprites/render_effects_sprites` +Config key: `renderEffectsSprites`/`render_effects_sprites` + +Note: added in 1.1.0. --- @@ -1237,13 +1186,13 @@ Config key: `renderEffectsSprites/render_effects_sprites` | :-- | :-- | | Python | `set_render_messages(messages: bool) -> None` | -Added in 1.1.0 - Determine if in-game messages (information about pickups, kills, etc.) will be rendered in the game. Default value: false -Config key: `renderMessages/render_messages` +Config key: `renderMessages`/`render_messages` + +Note: added in 1.1.0. --- @@ -1253,13 +1202,13 @@ Config key: `renderMessages/render_messages` | :-- | :-- | | Python | `set_render_corpsess(corpses: bool) -> None` | -Added in 1.1.0 - Determine if actors' corpses will be rendered in the game. Default value: true -Config key: `renderCorpses/render_corpses` +Config key: `renderCorpses`/`render_corpses` + +Note: added in 1.1.0. --- @@ -1269,13 +1218,13 @@ Config key: `renderCorpses/render_corpses` | :-- | :-- | | Python | `set_render_screen_flashes(flashes: bool) -> None` | -Added in 1.1.3 - Determine if the screen flash effect upon taking damage or picking up items will be rendered in the game. Default value: true -Config key: `renderScreenFlashes/render_screen_flashes` +Config key: `renderScreenFlashes`/`render_screen_flashes` + +Note: added in 1.1.0. --- @@ -1285,19 +1234,19 @@ Config key: `renderScreenFlashes/render_screen_flashes` | :-- | :-- | | Python | `set_render_all_frames(all_frames: bool) -> None` | -Added in 1.1.3 - 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. Default value: false -Config key: `renderAllFrames/render_all_frames` +Config key: `renderAllFrames`/`render_all_frames` See also: - [`setWindowVisible`](#setwindowvisible) +Note: added in 1.1.3. + --- ### `setWindowVisible` @@ -1313,7 +1262,7 @@ Default value: false Has no effect when the game is running. -Config key: `windowVisible/window_visible` +Config key: `windowVisible`/`window_visible` --- @@ -1327,7 +1276,7 @@ Determines if ViZDoom's console output will be enabled. Default value: false -Config key: `consoleEnabled/console_enabled` +Config key: `consoleEnabled`/`console_enabled` --- @@ -1341,7 +1290,7 @@ Determines if ViZDoom's sound will be played. Default value: false -Config key: `soundEnabled/sound_enabled` +Config key: `soundEnabled`/`sound_enabled` --- @@ -1351,7 +1300,7 @@ Config key: `soundEnabled/sound_enabled` | :-- | :-- | | Python | `get_screen_width() -> int` | -Returns game's screen width - width of all buffers. +Returns game's screen width - width of screen, depth, labels, and automap buffers. --- @@ -1361,7 +1310,7 @@ Returns game's screen width - width of all buffers. | :-- | :-- | | Python | `get_screen_height() -> int` | -Returns game's screen height - height of all buffers. +Returns game's screen height - height of screen, depth, labels, and automap buffers. --- @@ -1401,34 +1350,33 @@ Returns size in bytes of screen buffer and map buffer. | :-- | :-- | | Python | `is_object_info_enabled() -> bool` | -Added in 1.1.8 - Returns true if the objects information is enabled. +Note: added in 1.1.8. + --- ### `setObjectsInfoEnabled` | C++ | `void setObjectsInfoEnabled(bool objectsInfo)` | | :-- | :-- | -| Python | `set_objects_info_enabled(bool objectsInfo) -> None` | - -Added in 1.1.8 +| Python | `set_objects_info_enabled(objects_info: bool) -> None` | -Enables information about all objects present in the current episode/level. +Enables information about all [`Object`](./gameState.md#object) s present in the current episode/level. It will be available in the state. Default value: false Has no effect when the game is running. -Config key: `objectsInfoEnabled/objects_info_enabled` +Config key: `objectsInfoEnabled`/`objects_info_enabled` See also: - [`GameState`](./gameState.md#gamestate) -- [`GameState: Object`](./gameState.md#object) - [examples/python/objects_and_sectors.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/objects_and_sectors.py), +Note: added in 1.1.8. + --- ### `isSectorsInfoEnabled` @@ -1437,34 +1385,33 @@ See also: | :-- | :-- | | Python | `is_sectors_info_enabled() -> bool` | -Added in 1.1.8 - Returns true if the information about sectors is enabled. +Note: added in 1.1.8. + --- ### `setSectorsInfoEnabled` | C++ | `void setSectorsInfoEnabled(bool sectorsInfo)` | | :-- | :-- | -| Python | `set_sectors_info_enabled(bool sectorsInfo) -> None` | - -Added in 1.1.8 +| Python | `set_sectors_info_enabled(sectors_info: bool) -> None` | -Enables information about all sectors (map layout) present in the current episode/level. +Enables information about all [`Sector`](./gameState.md#sector) s (map layout) present in the current episode/level. It will be available in the state. Default value: false Has no effect when the game is running. -Config key: `sectorsInfoEnabled/sectors_info_enabled` +Config key: `sectorsInfoEnabled`/`sectors_info_enabled` See also: - [`GameState`](./gameState.md#gamestate) -- [`GameState: Sector`](./gameState.md#sector) - [examples/python/objects_and_sectors.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/objects_and_sectors.py) +Note: added in 1.1.8. + --- ### `isAudioBufferEnabled` @@ -1473,33 +1420,35 @@ See also: | :-- | :-- | | Python | `is_audio_buffer_enabled() -> bool` | -Added in 1.1.9 - Returns true if the audio buffer is enabled. +Note: added in 1.1.9. + --- ### `setAudioBufferEnabled` | C++ | `void setAudioBufferEnabled(bool audioBuffer)` | | :-- | :-- | -| Python | `set_audio_buffer_enabled(bool audioBuffer) -> None` | +| Python | `set_audio_buffer_enabled(audio_buffer: bool) -> None` | -Added in 1.1.9 - -Returns true if the audio buffer is enabled. +Enables rendering of the audio buffer, it will be available in the state. +The audio buffer will contain audio from the number of the last tics specified by [`setAudioBufferSize`](#setaudiobuffersize) method. +Sampling rate can be set with [`setAudioSamplingRate`](#setaudiosamplingrate) method. Default value: false Has no effect when the game is running. -Config key: `audioBufferEnabled/audio_buffer_enabled` +Config key: `audioBufferEnabled`/`audio_buffer_enabled` See also: - [`GameState`](./gameState.md#gamestate) -- [`Enums: SamplingRate`](./enums.md#sampling-rate) +- [`SamplingRate`](./enums.md#sampling-rate) - [examples/python/audio_buffer.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/audio_buffer.py) +Note: added in 1.1.9. + --- ### `getAudioSamplingRate` @@ -1508,39 +1457,36 @@ See also: | :-- | :-- | | Python | `get_audio_sampling_rate() -> int` | -Added in 1.1.9 - -Returns the sampling rate of the audio buffer. - +Returns the [`SamplingRate`](./enums.md#sampling-rate) of the audio buffer. See also: - [`GameState`](./gameState.md#gamestate) -- [`Enums: SamplingRate`](./enums.md#sampling-rate) - [examples/python/audio_buffer.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/audio_buffer.py) +Note: added in 1.1.9. + --- ### `setAudioSamplingRate` | C++ | `void setAudioSamplingRate(SamplingRate samplingRate)` | | :-- | :-- | -| Python | `set_audio_sampling_rate(SamplingRate samplingRate) -> None` | +| Python | `set_audio_sampling_rate(sampling_rate: SamplingRate) -> None` | -Added in 1.1.9 - -Sets the sampling rate of the audio buffer. +Sets the [`SamplingRate`](./enums.md#sampling-rate) of the audio buffer. Default value: false Has no effect when the game is running. -Config key: `audioSamplingRate/audio_samping_rate` +Config key: `audioSamplingRate`/`audio_samping_rate` See also: - [`GameState`](./gameState.md#gamestate) -- [`Enums: SamplingRate`](./enums.md#sampling-rate) - [examples/python/audio_buffer.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/audio_buffer.py) +Note: added in 1.1.9. + --- ### `getAudioBufferSize` @@ -1549,10 +1495,10 @@ See also: | :-- | :-- | | Python | `get_audio_buffer_size() -> int` | -Added in 1.1.9 - Returns the size of the audio buffer. +Note: added in 1.1.9. + See also: - [`GameState`](./gameState.md#gamestate) @@ -1566,8 +1512,6 @@ See also: | :-- | :-- | | Python | `set_audio_buffer_size(size: int) -> None` | -Added in 1.1.9 - Sets the size of the audio buffer. The size is defined by a number of logic tics. After each action audio buffer will contain audio from the specified number of the last processed tics. Doom uses 35 ticks per second. @@ -1576,8 +1520,10 @@ Default value: 4 Has no effect when the game is running. -Config key: `audioBufferSize/audio_buffer_size` +Config key: `audioBufferSize`/`audio_buffer_size` See also: - [`GameState`](./gameState.md#gamestate) - [examples/python/audio_buffer.py](https://github.com/Farama-Foundation/ViZDoom/tree/master/examples/python/audio_buffer.py) + +Note: added in 1.1.9. \ No newline at end of file diff --git a/docs/api/cpp/enums.md b/docs/api/cpp/enums.md index f4a606d33..a4e84b709 100644 --- a/docs/api/cpp/enums.md +++ b/docs/api/cpp/enums.md @@ -136,10 +136,10 @@ Enum type that defines all variables that can be obtained from the game. - **SECRETCOUNT** - Counts the number of secret location/objects discovered during the current episode. - **FRAGCOUNT** - Counts the number of players/bots killed, minus the number of committed suicides. Useful only in multiplayer mode. - **DEATHCOUNT** - Counts the number of players deaths during the current episode. Useful only in multiplayer mode. -- **HITCOUNT** - Counts number of hit monsters/players/bots during the current episode. Added in 1.1.5. -- **HITS_TAKEN** - Counts number of hits taken by the player during the current episode. Added in 1.1.5. -- **DAMAGECOUNT** - Counts number of damage dealt to monsters/players/bots during the current episode. Added in 1.1.5. -- **DAMAGE_TAKEN** - Counts number of damage taken by the player during the current episode. Added in 1.1.5. +- **HITCOUNT** - Counts number of hit monsters/players/bots during the current episode. Note: added in 1.1.5. +- **HITS_TAKEN** - Counts number of hits taken by the player during the current episode. Note: added in 1.1.5. +- **DAMAGECOUNT** - Counts number of damage dealt to monsters/players/bots during the current episode. Note: added in 1.1.5. +- **DAMAGE_TAKEN** - Counts number of damage taken by the player during the current episode. Note: added in 1.1.5. - **HEALTH** - Can be higher then 100! - **ARMOR** - Can be higher then 100! - **DEAD** - True if the player is dead. @@ -156,28 +156,30 @@ Enum type that defines all variables that can be obtained from the game. - **ANGLE** - Orientation of the player, not available if `viz_nocheat` is enabled. - **PITCH** - **ROLL** -- **VIEW_HEIGHT** - View high of the player, not available if `viz_nocheat` is enabled. Position of the camera in Z axis is equal to **POSITION_Z** + **VIEW_HEIGHT**. Added in 1.1.7. +- **VIEW_HEIGHT** - View high of the player, not available if `viz_nocheat` is enabled. Position of the camera in Z axis is equal to **POSITION_Z** + **VIEW_HEIGHT**. Note: added in 1.1.7. - **VELOCITY_X** - Velocity of the player, not available if `viz_nocheat` is enabled. - **VELOCITY_Y** - **VELOCITY_Z** -- **CAMERA_POSITION_X** - Position of the camera, not available if `viz_nocheat` is enabled. Added in 1.1.7. +- **CAMERA_POSITION_X** - Position of the camera, not available if `viz_nocheat` is enabled. Note: added in 1.1.7. - **CAMERA_POSITION_Y** - **CAMERA_POSITION_Z** -- **CAMERA_ANGLE** - Orientation of the camera, not available if `viz_nocheat` is enabled. Added in 1.1.7. +- **CAMERA_ANGLE** - Orientation of the camera, not available if `viz_nocheat` is enabled. Note: added in 1.1.7. - **CAMERA_PITCH** - **CAMERA_ROLL** -- **CAMERA_FOV** - Field of view in degrees, not available if `viz_nocheat` is enabled. Added in 1.1.7. +- **CAMERA_FOV** - Field of view in degrees, not available if `viz_nocheat` is enabled. Note: added in 1.1.7. - **PLAYER_NUMBER** - Player's number in multiplayer game. - **PLAYER_COUNT** - Number of players in multiplayer game. -- **PLAYER1_FRAGCOUNT** - **PLAYER16_FRAGCOUNT** - Number of N player's frags +- **PLAYER1_FRAGCOUNT** - **PLAYER16_FRAGCOUNT** - Number of player's frags (number of kills - suicides in multiplayer deathmatch). ### User (ACS) variables - **USER1** - **USER60** ACS global int variables can be accessed as USER GameVariables. -global int 0 is reserved for reward and is always threaded as Doom's fixed point numeral. +global int 0 is reserved for reward and is always treated as Doom's fixed point numeral. Other from 1 to 60 (global int 1-60) can be accessed as USER1 - USER60 GameVariables. +If you assign fixed point numeral to USER1 - USER60 GameVariables, +you can convert them to floating point by using [`doomFixedToDouble`](utils.md#doomfixedtodouble) function. See also: - [ZDoom Wiki: ACS](http://zdoom.org/wiki/ACS), @@ -269,11 +271,12 @@ See also: ## `SamplingRate` Enum type that defines all supported sampling rates for **audioBuffer** in **State**. -Added in 1.1.9. - **SR_11025** - **SR_22050** - **SR_44100** See also: -- [`DoomGame: setAudioSamplingRate`](./doomGame.md#setaudiosamplingrate), +- [`DoomGame: setAudioSamplingRate`](./doomGame.md#setaudiosamplingrate). + +Note: added in 1.1.9. diff --git a/docs/api/cpp/gameState.md b/docs/api/cpp/gameState.md index 20aa25c05..666ecdf63 100644 --- a/docs/api/cpp/gameState.md +++ b/docs/api/cpp/gameState.md @@ -18,7 +18,7 @@ The declarations of all the enums can be found in the `include/ViZDoomTypes.h` h - `std::vector