From 0aacdda8fa4821bc2d9462951ed78ae1bec43804 Mon Sep 17 00:00:00 2001 From: mwydmuch Date: Fri, 13 Apr 2018 01:43:29 +0200 Subject: [PATCH] Updated README.md and different parts of the documentation, added FAQ.md Former-commit-id: b3ab99fdd34444ba3ed1f9e509c3f9fe6d1f1fda --- README.md | 31 +++- cmake_modules/FindPythonLibsNew.cmake | 195 +++++++++++++++++++++ doc/Building.md | 13 +- doc/ConfigFile.md | 18 +- doc/DoomGame.md | 16 ++ doc/FAQ.md | 93 ++++++++++ doc/Quickstart.md | 2 + docker/README.md | 6 +- examples/python/basic.py | 3 + examples/python/{oblige.py => pyoblige.py} | 0 10 files changed, 361 insertions(+), 16 deletions(-) create mode 100755 cmake_modules/FindPythonLibsNew.cmake create mode 100644 doc/FAQ.md rename examples/python/{oblige.py => pyoblige.py} (100%) diff --git a/README.md b/README.md index a4e2343c6..341c51a25 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,9 @@ ViZDoom allows developing AI **bots that play Doom using only the visual informa ViZDoom is based on [ZDoom](https://github.com/rheit/zdoom) to provide the game mechanics. -**ViZDoom is the platform for [Visual Doom Competition @ CIG 2017](http://vizdoom.cs.put.edu.pl/competition-cig-2017).** :goberserk: +**ViZDoom is the platform for [Visual Doom Competition @ CIG 2018](http://vizdoom.cs.put.edu.pl/competition-cig-2018).** :goberserk: ![vizdoom_deadly_corridor](https://github.com/mwydmuch/ViZDoom/blob/master/gifs/vizdoom_corridor.gif) -![vizdoom_deathmatch](https://github.com/mwydmuch/ViZDoom/blob/master/gifs/vizdoom_deathmatch.gif) ## Features - Multi-platform, @@ -29,7 +28,7 @@ ViZDoom API is **reinforcement learning** friendly (suitable also for learning f ## Cite as ->Michał Kempka, Marek Wydmuch, Grzegorz Runc, Jakub Toczek & Wojciech Jaśkowski, ViZDoom: A Doom-based AI Research Platform for Visual Reinforcement Learning, IEEE Conference on Computational Intelligence and Games, pp. 341-348, Santorini, Greece, 2016 ([arXiv:1605.02097](http://arxiv.org/abs/1605.02097)) +> Michał Kempka, Marek Wydmuch, Grzegorz Runc, Jakub Toczek & Wojciech Jaśkowski, ViZDoom: A Doom-based AI Research Platform for Visual Reinforcement Learning, IEEE Conference on Computational Intelligence and Games, pp. 341-348, Santorini, Greece, 2016 ([arXiv:1605.02097](http://arxiv.org/abs/1605.02097)) ### Bibtex: ``` @@ -67,6 +66,8 @@ For Windows we are providing compiled runtime binaries and development libraries - [Lua 5.1 & LuaJIT (64-bit)](https://github.com/mwydmuch/ViZDoom/releases/download/1.1.5pre/ViZDoom-1.1.5pre-Win-Lua51-LuaJIT-x86_64.zip) - [Java (64-bit)](https://github.com/mwydmuch/ViZDoom/releases/download/1.1.5pre/ViZDoom-1.1.5pre-Win-Java-x86_64.zip) +See **[Installation of Windows binaries](doc/Building.md#windows_bin)** + ## Examples @@ -82,6 +83,9 @@ Python examples are currently the richest, so we recommend to look at them, even **See also the [tutorial](http://vizdoom.cs.put.edu.pl/tutorial).** +## Tutorials + + ## Documentation Detailed description of all types and methods: @@ -92,7 +96,26 @@ Detailed description of all types and methods: - [Exceptions](doc/Exceptions.md) - [Utilities](doc/Utilities.md) -[Changelog](doc/Changelog.md) for 1.1.X version. +Additional documents: + +- **[FAQ](doc/FAQ.md)** +- [Changelog](doc/Changelog.md) for 1.1.X version. + +Also full documentation of engine and ACS scripting language can be found on +[ZDoom Wiki](https://zdoom.org/wiki/). + +Useful parts: + +- [ACS](https://zdoom.org/wiki/ACS) +- [CVARs](https://zdoom.org/wiki/CVARs) (Console Variables) +- [CCMDs](https://zdoom.org/wiki/CCMDs) (Console Commands) + + +## Awesome Doom tools + +- [SLADE3](http://slade.mancubus.net/) - Doom map (scenario) editor for Linux, MacOS and Windows. +- [Doom Builder 2](http://www.doombuilder.com/) - another Doom map editor for Windows. +- [OBLIGE](http://oblige.sourceforge.net/) - Doom random map generator and [PyOblige](https://github.com/mwydmuch/PyOblige) is a simple Python wrapper for it. ## Contributions diff --git a/cmake_modules/FindPythonLibsNew.cmake b/cmake_modules/FindPythonLibsNew.cmake new file mode 100755 index 000000000..b29b287de --- /dev/null +++ b/cmake_modules/FindPythonLibsNew.cmake @@ -0,0 +1,195 @@ +# - Find python libraries +# This module finds the libraries corresponding to the Python interpreter +# FindPythonInterp provides. +# This code sets the following variables: +# +# PYTHONLIBS_FOUND - have the Python libs been found +# PYTHON_PREFIX - path to the Python installation +# PYTHON_LIBRARIES - path to the python library +# PYTHON_INCLUDE_DIRS - path to where Python.h is found +# PYTHON_MODULE_EXTENSION - lib extension, e.g. '.so' or '.pyd' +# PYTHON_MODULE_PREFIX - lib name prefix: usually an empty string +# PYTHON_SITE_PACKAGES - path to installation site-packages +# PYTHON_IS_DEBUG - whether the Python interpreter is a debug build +# +# Thanks to talljimbo for the patch adding the 'LDVERSION' config +# variable usage. + +#============================================================================= +# Copyright 2001-2009 Kitware, Inc. +# Copyright 2012 Continuum Analytics, Inc. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the names of Kitware, Inc., the Insight Software Consortium, +# nor the names of their contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +# Checking for the extension makes sure that `LibsNew` was found and not just `Libs`. +if(PYTHONLIBS_FOUND AND PYTHON_MODULE_EXTENSION) + return() +endif() + +# Use the Python interpreter to find the libs. +if(PythonLibsNew_FIND_REQUIRED) + find_package(PythonInterp ${PythonLibsNew_FIND_VERSION} REQUIRED) +else() + find_package(PythonInterp ${PythonLibsNew_FIND_VERSION}) +endif() + +if(NOT PYTHONINTERP_FOUND) + set(PYTHONLIBS_FOUND FALSE) + return() +endif() + +# According to http://stackoverflow.com/questions/646518/python-how-to-detect-debug-interpreter +# testing whether sys has the gettotalrefcount function is a reliable, cross-platform +# way to detect a CPython debug interpreter. +# +# The library suffix is from the config var LDVERSION sometimes, otherwise +# VERSION. VERSION will typically be like "2.7" on unix, and "27" on windows. +execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" + "from distutils import sysconfig as s;import sys;import struct; +print('.'.join(str(v) for v in sys.version_info)); +print(sys.prefix); +print(s.get_python_inc(plat_specific=True)); +print(s.get_python_lib(plat_specific=True)); +print(s.get_config_var('SO')); +print(hasattr(sys, 'gettotalrefcount')+0); +print(struct.calcsize('@P')); +print(s.get_config_var('LDVERSION') or s.get_config_var('VERSION')); +print(s.get_config_var('LIBDIR') or ''); +print(s.get_config_var('MULTIARCH') or ''); +" + RESULT_VARIABLE _PYTHON_SUCCESS + OUTPUT_VARIABLE _PYTHON_VALUES + ERROR_VARIABLE _PYTHON_ERROR_VALUE) + +if(NOT _PYTHON_SUCCESS MATCHES 0) + if(PythonLibsNew_FIND_REQUIRED) + message(FATAL_ERROR + "Python config failure:\n${_PYTHON_ERROR_VALUE}") + endif() + set(PYTHONLIBS_FOUND FALSE) + return() +endif() + +# Convert the process output into a list +string(REGEX REPLACE ";" "\\\\;" _PYTHON_VALUES ${_PYTHON_VALUES}) +string(REGEX REPLACE "\n" ";" _PYTHON_VALUES ${_PYTHON_VALUES}) +list(GET _PYTHON_VALUES 0 _PYTHON_VERSION_LIST) +list(GET _PYTHON_VALUES 1 PYTHON_PREFIX) +list(GET _PYTHON_VALUES 2 PYTHON_INCLUDE_DIR) +list(GET _PYTHON_VALUES 3 PYTHON_SITE_PACKAGES) +list(GET _PYTHON_VALUES 4 PYTHON_MODULE_EXTENSION) +list(GET _PYTHON_VALUES 5 PYTHON_IS_DEBUG) +list(GET _PYTHON_VALUES 6 PYTHON_SIZEOF_VOID_P) +list(GET _PYTHON_VALUES 7 PYTHON_LIBRARY_SUFFIX) +list(GET _PYTHON_VALUES 8 PYTHON_LIBDIR) +list(GET _PYTHON_VALUES 9 PYTHON_MULTIARCH) + +# Make sure the Python has the same pointer-size as the chosen compiler +# Skip if CMAKE_SIZEOF_VOID_P is not defined +if(CMAKE_SIZEOF_VOID_P AND (NOT "${PYTHON_SIZEOF_VOID_P}" STREQUAL "${CMAKE_SIZEOF_VOID_P}")) + if(PythonLibsNew_FIND_REQUIRED) + math(EXPR _PYTHON_BITS "${PYTHON_SIZEOF_VOID_P} * 8") + math(EXPR _CMAKE_BITS "${CMAKE_SIZEOF_VOID_P} * 8") + message(FATAL_ERROR + "Python config failure: Python is ${_PYTHON_BITS}-bit, " + "chosen compiler is ${_CMAKE_BITS}-bit") + endif() + set(PYTHONLIBS_FOUND FALSE) + return() +endif() + +# The built-in FindPython didn't always give the version numbers +string(REGEX REPLACE "\\." ";" _PYTHON_VERSION_LIST ${_PYTHON_VERSION_LIST}) +list(GET _PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR) +list(GET _PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR) +list(GET _PYTHON_VERSION_LIST 2 PYTHON_VERSION_PATCH) + +# Make sure all directory separators are '/' +string(REGEX REPLACE "\\\\" "/" PYTHON_PREFIX ${PYTHON_PREFIX}) +string(REGEX REPLACE "\\\\" "/" PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR}) +string(REGEX REPLACE "\\\\" "/" PYTHON_SITE_PACKAGES ${PYTHON_SITE_PACKAGES}) + +if(CMAKE_HOST_WIN32) + set(PYTHON_LIBRARY + "${PYTHON_PREFIX}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib") + + # when run in a venv, PYTHON_PREFIX points to it. But the libraries remain in the + # original python installation. They may be found relative to PYTHON_INCLUDE_DIR. + if(NOT EXISTS "${PYTHON_LIBRARY}") + get_filename_component(_PYTHON_ROOT ${PYTHON_INCLUDE_DIR} DIRECTORY) + set(PYTHON_LIBRARY + "${_PYTHON_ROOT}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib") + endif() + + # raise an error if the python libs are still not found. + if(NOT EXISTS "${PYTHON_LIBRARY}") + message(FATAL_ERROR "Python libraries not found") + endif() + +else() + if(PYTHON_MULTIARCH) + set(_PYTHON_LIBS_SEARCH "${PYTHON_LIBDIR}/${PYTHON_MULTIARCH}" "${PYTHON_LIBDIR}") + else() + set(_PYTHON_LIBS_SEARCH "${PYTHON_LIBDIR}") + endif() + #message(STATUS "Searching for Python libs in ${_PYTHON_LIBS_SEARCH}") + # Probably this needs to be more involved. It would be nice if the config + # information the python interpreter itself gave us were more complete. + find_library(PYTHON_LIBRARY + NAMES "python${PYTHON_LIBRARY_SUFFIX}" + PATHS ${_PYTHON_LIBS_SEARCH} + NO_DEFAULT_PATH) + + # If all else fails, just set the name/version and let the linker figure out the path. + if(NOT PYTHON_LIBRARY) + set(PYTHON_LIBRARY python${PYTHON_LIBRARY_SUFFIX}) + endif() +endif() + +MARK_AS_ADVANCED( + PYTHON_LIBRARY + PYTHON_INCLUDE_DIR +) + +# We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the +# cache entries because they are meant to specify the location of a single +# library. We now set the variables listed by the documentation for this +# module. +SET(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}") +SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}") +SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}") + +find_package_message(PYTHON + "Found PythonLibs: ${PYTHON_LIBRARY}" + "${PYTHON_EXECUTABLE}${PYTHON_VERSION}") + +set(PYTHONLIBS_FOUND TRUE) diff --git a/doc/Building.md b/doc/Building.md index 68a06889b..8a7a752e6 100644 --- a/doc/Building.md +++ b/doc/Building.md @@ -6,6 +6,7 @@ * [Windows](#windows_deps) * [Installation via PyPI(pip/conda)](#pypi) * [Installation via LuaRocks](#luarocks) +* [Installation of build Windows binaries](#windows_bin) * [Building (not recommended)](#build) * [Linux](#linux_build) * [MacOS](#macos_build) @@ -145,6 +146,16 @@ luarocks make ``` +## Installation of Windows binaries + +For Windows we are providing a compiled environment that can be download from [releases](https://github.com/mwydmuch/ViZDoom/releases) page. +To install it for Python, copy files to `site-packages` folder. + +Location of `site-packages` depends on Python distribution: +- Python: `python_root\Lib\site-packges` +- Anaconda: `anaconda_root\lib\pythonX.X\site-packages` + + ## Building ### Linux @@ -200,7 +211,7 @@ cmake -DCMAKE_BUILD_TYPE=Release \ ### Windows -Setting up the compilation on Windows is really tedious so using the precompiled binaries is recommended. +Setting up the compilation on Windows is really tedious so using the [precompiled binaries](#windows_bin) is recommended. `vizdoom` directory from Python builds contains complete Python package for Windows. You can copy it to your project directory or copy it into `python_dir/lib/site-packages/vizdoom` to install it globally in your system. diff --git a/doc/ConfigFile.md b/doc/ConfigFile.md index 72a494ee3..890e207a5 100644 --- a/doc/ConfigFile.md +++ b/doc/ConfigFile.md @@ -1,5 +1,5 @@ # Configuration files -Instead of configuring the ViZDoom in code, you can load it from configuration file(s). Each file is read sequentially, so multiple entries with the same key will overwrite previous entries. +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: @@ -10,7 +10,7 @@ Each entry in a configraution file is a pair of **key** and **value** separated * underscores in **keys** are ignored (*episode_timeout* is equivalent to *episodetimeout*), * string values should **not** be surrounded with apostrophes or quotation marks. -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: ..."). +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. @@ -55,6 +55,8 @@ 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. + ### Sample configuration file content: @@ -86,16 +88,16 @@ episode_timeout = 300 # Available buttons available_buttons = - { - MOVE_LEFT - MOVE_RIGHT - ATTACK - } + { + MOVE_LEFT + MOVE_RIGHT + ATTACK + } # Game variables that will be in the state available_game_variables = { AMMO2} -# Default mode - game is controlled from the code +# Default mode - the game is controlled from the code mode = PLAYER # Difficulty of gameplay ranging from 1 (baby) to 5 (nightmare) diff --git a/doc/DoomGame.md b/doc/DoomGame.md index fd0aef225..c2b828d6b 100644 --- a/doc/DoomGame.md +++ b/doc/DoomGame.md @@ -27,6 +27,7 @@ * [getAvailableButtonsSize](#getAvailableButtonsSize) * [setButtonMaxValue](#setButtonMaxValue) * [getButtonMaxValue](#getButtonMaxValue) +* [getButton](#getButton) ## [GameVariables methods](#vars) * [getAvailableGameVariables](#getAvailableGameVariables) @@ -475,6 +476,21 @@ See also: - [`Types: Button`](Types.md#button) +--- +### `getButton` + +| C++ | `double getButton(Button button)` | +| :-- | :-- | +| Lua | `number getButton(Button button)` | +| Java | `double getButton(Button button)` | +| Python | `float get_button(Button button)` | + +Returns the current state of the specified button (`ATTACK`, `USE` etc.). + +See also: +- [`Types: Button`](Types.md#button) + + ## GameVariables methods --- diff --git a/doc/FAQ.md b/doc/FAQ.md new file mode 100644 index 000000000..3898bddcb --- /dev/null +++ b/doc/FAQ.md @@ -0,0 +1,93 @@ +# FAQ + +This file contains a list of questions that ViZDoom users may ask at some point. +You can find more questions and answers by search in issues page with "question" tag +[is:issue label:question](https://github.com/mwydmuch/ViZDoom/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3Aquestion) + +Did not find answer for your question? Post an [issue](https://github.com/mwydmuch/ViZDoom/issues) + + +### How to use Windows binaries? + +For Windows we are providing a compiled environment that can be download from [releases](https://github.com/mwydmuch/ViZDoom/releases) page. +To install it see [Building: Installation of Windows binaries](Building.md#windows_bin). + + +**Original issue and answer:** +https://github.com/mwydmuch/ViZDoom/issues/190 + + +### How to use original Doom's assets? + +We cannot provide original Doom's assets due to licensing issues. +ViZDoom uses [freedoom2.wad](https://freedoom.github.io) as default assets. +However, you can use original Doom's assets by placing doom.wad or doom2.wad. +You can just place it in you working directory, +specify path to it by using [`DoomGame: setDoomGamePath`](DoomGame.md#setDoomGamePath) +or place it in the same directory as vizdoom(.exe). + + +### How to stack frames? + +ViZDoom does not automatically stacks frames for you. +You have to manually store the states from [`DoomGame: getState`](DoomGame.md#getState). and build up stacked states for your agent. + +**Original issue and answer: (contains code an example)** +https://github.com/mwydmuch/ViZDoom/issues/296 + + +### How to change keyboard binding for Spectator Mode? + +When you launch an instance of vizdoom, it will create _vizdoom.ini in your working directory (if it does not exist yet). +This file contains all the additional engine settings, including key bindings, that you can edit freely. + +You can also load .ini file from different location using [`DoomGame: setDoomConfigPath`](DoomGame.md#setDoomConfigPath). + +**Original issue and answer:** +https://github.com/mwydmuch/ViZDoom/issues/253 + + +### How to control game speed in `ASYNC` modes? + +See: [`DoomGame: setTicrate`](DoomGame.md#setTicrate) and [examples/python/ticrate.py](https://github.com/mwydmuch/ViZDoom/tree/master/examples/python/ticrate.py) + +**Original issue and answer:** +https://github.com/mwydmuch/ViZDoom/issues/209 + + +### How can to make an exact 90 degree turn in one action? + +See: [examples/python/delta_buttons.py](https://github.com/mwydmuch/ViZDoom/tree/master/examples/python/delta_buttons.py) + +**Original issue and answer:** +https://github.com/mwydmuch/ViZDoom/issues/279 + +See also: +- [`Types: Button`](Types.md#button) +- [examples/python/DeltaDuttons.cpp](https://github.com/mwydmuch/ViZDoom/tree/master/examples/cpp/DeltaDuttons.cpp) +- [examples/python/DeltaDuttons.java](https://github.com/mwydmuch/ViZDoom/tree/master/examples/java/DeltaDuttons.java) + + +### Agent does not fire after picking up ammo or weapon? + +Some weapons have a `noautofire` flag for weapons to prevent using them by accident when picking up. +Agent needs to release `ATTACK` button and then press it again to start firing after picking one of those weapons or ammo for them. + +**Original issue and answer:** +https://github.com/mwydmuch/ViZDoom/issues/289 + +See also: +- List of weapon flags: [https://zdoom.org/wiki/Weapon_flags](https://zdoom.org/wiki/Weapon_flags) +- List of Doom weapons: [https://zdoom.org/wiki/Classes:DoomWeapon](https://zdoom.org/wiki/Classes:DoomWeapon) + + +### How to pick up items (medikit, ammo, armour) when inventory is full? + +CVARs implemented in ZDoom engine are very helpful in quickly modifying some aspects of the game. +`game.add_game_args("+sv_unlimited_pickup 1")` adding before init will allow picking up unlimited items. + +**Original issue and answer:** +https://github.com/mwydmuch/ViZDoom/issues/187 + +See also: +- List of CVARs: [https://zdoom.org/wiki/CVARs:Configuration](https://zdoom.org/wiki/CVARs:Configuration) diff --git a/doc/Quickstart.md b/doc/Quickstart.md index 5e65f1f48..fab9bfd91 100644 --- a/doc/Quickstart.md +++ b/doc/Quickstart.md @@ -1,5 +1,7 @@ # Quickstart +> This guide can be a little bit outdated. + * [Quickstart for MacOS with Anaconda3](#quickstart_macos_anaconda) TODO: diff --git a/docker/README.md b/docker/README.md index dc212a6e0..7a10f6434 100644 --- a/docker/README.md +++ b/docker/README.md @@ -2,9 +2,9 @@ Provided dockerfiles (all images use Ubuntu 16.04): -* **python3** - Python3, ViZDoom with dependecies and X11 support. By default runs Python [basic example](examples/python/basic.py). -* **tensorflow** - Python3, ViZDoom with dependecies, Tensorflow and X11 support. By default runs [tensorflow learning example](examples/python/learning_tensorflow.py). -* **torch** - Torch, ViZDoom with dependencies and X11 support. By default run Lua [basic example](examples/lua/basic.py). TODO +* **python3** - Python3, ViZDoom with dependencies and X11 support. By default runs Python [basic example](examples/python/basic.py). +* **tensorflow** - Python3, ViZDoom with dependencies, Tensorflow and X11 support. By default runs [tensorflow learning example](examples/python/learning_tensorflow.py). +* **torch** - Torch, ViZDoom with dependencies and X11 support. By default run Lua [basic example](examples/lua/basic.py). ## Building diff --git a/examples/python/basic.py b/examples/python/basic.py index 9323b889e..f4f30e181 100755 --- a/examples/python/basic.py +++ b/examples/python/basic.py @@ -124,6 +124,9 @@ automap_buf = state.automap_buffer labels = state.labels + # Games variables can be also accessed via: + #game.get_game_variable(GameVariable.AMMO2) + # Makes a random action and get remember reward. r = game.make_action(choice(actions)) diff --git a/examples/python/oblige.py b/examples/python/pyoblige.py similarity index 100% rename from examples/python/oblige.py rename to examples/python/pyoblige.py