From ea2276e05881e14dfec00f03d79d5d996d528604 Mon Sep 17 00:00:00 2001 From: mwydmuch Date: Wed, 14 Nov 2018 04:37:11 +0100 Subject: [PATCH] Updated docs --- doc/Changelog.md | 37 ++++++++++++++---- doc/DoomGame.md | 50 ++++++++++++++++++++++++- doc/Types.md | 17 ++++++++- examples/python/README.md | 2 +- examples/python/cig_multiplayer_host.py | 1 - 5 files changed, 96 insertions(+), 11 deletions(-) diff --git a/doc/Changelog.md b/doc/Changelog.md index 3b3af5507..6f3761bcb 100644 --- a/doc/Changelog.md +++ b/doc/Changelog.md @@ -1,10 +1,35 @@ # Changelog +## Changes in 1.1.7 + +#### Python & Julia +- Added missing `is_multiplayer_game` method to Python and Julia binding. + +#### CVARS +- Added `VIEW_HEIGHT`, `CAMERA_POSITION_X`/`Y`/`Z`, `CAMERA_ANGLE`, `CAMERA_PITCH`, `CAMERA_ROLL` and `CAMERA_FOV` GameVariables. + + +## Changes in 1.1.6 + +#### Julia specific +- Julia binding added. + +#### Server state +- Added `getServerState` method that returns `ServerState` object. + +#### Mutliplayer +- Added timeout for network game synchronization controlled by `viz_connect_timeout` CVAR. +- Fixed `viz_spectator` CVAR. + +#### Python specific +- Added Python interpreter version check. + + ## Changes in 1.1.5 #### Automap -- Added `viz_am_scale` CVAR (CVAR version of `am_scale` CCMD) -- Added `viz_am_center` CVAR (and `am_center` CCMD) +- Added `viz_am_scale` CVAR (CVAR version of `am_scale` CCMD). +- Added `viz_am_center` CVAR (and `am_center` CCMD). #### Buttons and actions - **Added `getButton` method.** @@ -29,8 +54,6 @@ - Fixed minor rendering issue in depth and labels buffer. - Fixed order of color values in `RGB/BGR` modes of `ScreenFormat`. -#### Other -- Added `getServerState` method. ## Changes in 1.1.4 @@ -52,15 +75,15 @@ - Added `viz_ignore_render_mode` CVAR which disables overriding rendering settings. #### GameVariables -- **Added `ANGLE`, `PITCH`, `ROLL`, `VELOCITY_X/Y/Z` GameVariables.** +- **Added `ANGLE`, `PITCH`, `ROLL`, `VELOCITY_X`/`Y`/`Z` GameVariables.** #### Missing config keys -- Added support for `DEATHCOUNT`, `USER31` - `USER60`, `PLAYER_NUMBER`, `PLAYER_COUNT`, `PLAYER1_FRAGCOUNT` - `PLAYER16_FRAGCOUNT`, `POSITION_X/Y/Z` GameVariables in the config file. +- Added support for `DEATHCOUNT`, `USER31` - `USER60`, `PLAYER_NUMBER`, `PLAYER_COUNT`, `PLAYER1_FRAGCOUNT` - `PLAYER16_FRAGCOUNT`, `POSITION_X`/`Y`/`Z` GameVariables in the config file. - Added support for `ALTATTACK` Button in the config file. #### Java specific - Fixed `makeAction`. -- Added missing `POSITION_X/Y/Z` Game Variables. +- Added missing `POSITION_X`/`Y`/`Z` Game Variables. #### Python specific - Added manual GIL management for better performance when used with Python threads. diff --git a/doc/DoomGame.md b/doc/DoomGame.md index c2b828d6b..976a92429 100644 --- a/doc/DoomGame.md +++ b/doc/DoomGame.md @@ -7,6 +7,8 @@ * [replayEpisode](#replayEpisode) * [isRunning](#isRunning) * [isMultiplayerGame](#isMultiplayerGame) +* [isRecordingEpisode](#isRecordingEpisode) +* [isReplayingEpisode](#isReplayingEpisode) * [setAction](#setAction) * [advanceAction](#advanceAction) * [makeAction](#makeAction) @@ -16,6 +18,7 @@ * [respawnPlayer](#respawnPlayer) * [sendGameCommand](#sendGameCommand) * [getState](#getState) +* [getServerState](#getServerState) * [getLastAction](#getLastAction) * [getEpisodeTime](#getEpisodeTime) @@ -200,6 +203,34 @@ Added in 1.1.2 Checks if the game is in multiplayer mode. +--- +### `isRecordingEpisode` + +| C++ | `bool isRecordingEpisode()` | +| :-- | :-- | +| Lua | `boolean isRecordingEpisode()` | +| Java | `boolean isRecordingEpisode()` | +| Python | `bool is_recording_episode()` | + +Added in 1.1.5 + +Checks if the game is in recording mode. + + +--- +### `isReplayingEpisode` + +| C++ | `bool isReplayingEpisode()` | +| :-- | :-- | +| Lua | `boolean isReplayingEpisode()` | +| Java | `boolean isReplayingEpisode()` | +| Python | `bool is_replaying_episode()` | + +Added in 1.1.5 + +Checks if the game is in replaying mode. + + --- ### `setAction` @@ -324,12 +355,29 @@ See also: [ZDoom Wiki](http://zdoom.org/wiki/Console) Changed in 1.1.0 Returns [`GameState`](Types.md#gamestate) object with the current game state. -If the game is not running or the current episode is finished `nullptr/null/None` will be returned. +If the current episode is finished `nullptr/null/None` will be returned. See also: - [`Types: GameState`](Types.md#gamestate) +--- +### `getServerState` + +| C++ | `ServerStatePtr (std::shared_ptr) ServerState getServerState()` | +| :-- | :-- | +| Lua | `ServerState getServerState()` | +| Java | `ServerState getServerState()` | +| Python | `ServerState get_state_state()` | + +Added in 1.1.6 + +Returns [`ServerState`](Types.md#serverstate) object with the current server state. + +See also: +- [`Types: ServerState`](Types.md#serverstate) + + --- ### `getLastAction` diff --git a/doc/Types.md b/doc/Types.md index 0f5c7fd77..94b4f8d43 100644 --- a/doc/Types.md +++ b/doc/Types.md @@ -2,6 +2,7 @@ * [Label](#label) * [GameState](#gamestate) +* [ServerState](#serverstate) * [Enums](#enums) * [Mode](#mode) * [ScreenFormat](#screenformat) @@ -76,14 +77,20 @@ See also: --- -#### ServerInfo +#### `ServerState` (`C++ type / Lua type / Java type / Python type` **name**) +- `unsigned int / number / unsigned int / int` **tic** - `unsigned int / number / unsigned int / int` **playerCount / player_count** - `bool[] / table / boolean[] / list` **playersInGame / players_in_game** - `int[] / table / int[] / list` **playersFrags / players_frags** - `std::string[] / table / String[] / list` **playersNames / players_names** +- `bool[] / table / boolean[] / list` **playersAfk / players_afk** +- `unsigned int[] / table / unsigned int[] / list` **playersLastActionTic / players_last_action_tic ** +- `unsigned int[] / table / unsigned int[] / list` **playersLastKillTic / players_last_kill_tic ** +Right now `ServerInfo` is only available to C++ and Python. +Added in 1.1.6. ## Enums @@ -241,9 +248,17 @@ 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**. - **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. +- **CAMERA_POSITION_Y** +- **CAMERA_POSITION_Z** +- **CAMERA_ANGLE** - Orientation of the camera, not available if `viz_nocheat` is enabled. +- **CAMERA_PITCH** +- **CAMERA_ROLL** +- **CAMERA_FOV** - Field of view in degrees, not available if `viz_nocheat` is enabled. - **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 diff --git a/examples/python/README.md b/examples/python/README.md index e640f2f59..b71d8b9cb 100644 --- a/examples/python/README.md +++ b/examples/python/README.md @@ -1,4 +1,4 @@ -> For the examples to work properly you need to install ViZDoom [system-wide with pip](https://github.com/mwydmuch/ViZDoom/blob/master/doc/Building.md) or set doom_game_path and vizdoom_path manually or in config files. +> For the examples to work properly you need to install ViZDoom [system-wide with pip](https://github.com/mwydmuch/ViZDoom/blob/master/doc/Building.md) or create a link to dir with ViZDoom pip_package or set doom_game_path and vizdoom_path manually or in config files. # Troubleshooting * `SystemError: dynamic module not initialized properly` may mean that you are trying the run an example using python3 instead of python2. diff --git a/examples/python/cig_multiplayer_host.py b/examples/python/cig_multiplayer_host.py index 1862749e4..efd7035ed 100755 --- a/examples/python/cig_multiplayer_host.py +++ b/examples/python/cig_multiplayer_host.py @@ -64,5 +64,4 @@ # Use this to respawn immediately after death, new state will be available. game.respawn_player() -game.get_game game.close()