A customisable 3D platform for agent-based AI research
C C++ Lua Python GLSL ShaderLab Other
Clone or download
Permalink
Failed to load latest commit information.
assets [shaders] Add a shader "decal_alpha" for rendering with transparency. Jun 19, 2018
assets_oa [gadgets] Make more gadgets available. May 4, 2018
data [datasets] Add MNIST dataset. May 4, 2018
deepmind [maze_generation] Improve argument validation and error checking Jun 28, 2018
docs [docs] Update link to level script Aug 10, 2018
engine [egl_glimp] Make EGL errors in the shutdown path non-fatal. Jun 27, 2018
examples [game] Add 'start_index' flag to set initial episode index. May 22, 2018
game_scripts [log] Make logging functions stringize their arguments. Jul 3, 2018
lua_tests [log] Make logging functions stringize their arguments. Jul 3, 2018
public [dmlab_so_loader] Fix typo in error message. May 25, 2018
python [docs] Document the Bazel flag for optimized building Jun 28, 2018
q3map2 [q3map2] Avoid division by zero Feb 23, 2018
testing [allowHoldOutLevels] Add setting allowHoldOutLevels and improve error… Jun 21, 2018
third_party [rl_api] Replace direct label in linkopt with $(location label). May 3, 2018
.gitignore .gitignore rules for Bazel output Nov 30, 2016
.travis.yml [travis] Remove obsolete config setting Jan 26, 2018
BUILD [python] Make random agent code compatible with Python 3. May 22, 2018
CONTRIBUTING Rules for contributing Nov 29, 2016
LICENSE Initial commit Nov 29, 2016
README.md [docs] Document the Bazel flag for optimized building Jun 28, 2018
RELEASE_NOTES.md [game_scripts] A logging library with configurable verbosity Jun 28, 2018
WORKSPACE [WORKSPACE] Add hermetic dependency on the Python "six" package. May 22, 2018
dmlab.lds Linker script for isolating the main code into a DSO Nov 30, 2016
eigen.BUILD Bazel workspace and external build files Nov 30, 2016
glib.BUILD [glib.BUILD] Use internal "pcre" so as to not require an external dep… Jan 25, 2018
jpeg.BUILD Bazel workspace and external build files Nov 30, 2016
libxml.BUILD Bazel workspace and external build files Nov 30, 2016
lua.BUILD Bazel workspace and external build files Nov 30, 2016
png.BUILD [WORKSPACE] Update external dependency versions of eigen, jpeg, libxm… Jan 19, 2018
python.BUILD Bazel workspace and external build files Nov 30, 2016
sdl.BUILD Bazel workspace and external build files Nov 30, 2016
six.BUILD [WORKSPACE] Add hermetic dependency on the Python "six" package. May 22, 2018
zlib.BUILD Bazel workspace and external build files Nov 30, 2016

README.md

DeepMind Lab

DeepMind Lab is a 3D learning environment based on id Software's Quake III Arena via ioquake3 and other open source software.

DeepMind Lab provides a suite of challenging 3D navigation and puzzle-solving tasks for learning agents. Its primary purpose is to act as a testbed for research in artificial intelligence, especially deep reinforcement learning.

About

Disclaimer: This is not an official Google product.

If you use DeepMind Lab in your research and would like to cite the DeepMind Lab environment, we suggest you cite the DeepMind Lab paper.

You can reach us at lab@deepmind.com.

Getting started on Linux

$ git clone https://github.com/deepmind/lab
$ cd lab

For a live example of a random agent, run

lab$ bazel run :python_random_agent --define graphics=sdl -- \
               --length=10000 --width=640 --height=480

Here is some more detailed build documentation, including how to install dependencies if you don't have them.

To enable compiler optimizations, pass the flag --compilation_mode=opt, or -c opt for short, to each bazel build, bazel test and bazel run command. The flag is omitted from the examples here for brevity, but it should be used for real training and evaluation where performance matters.

Play as a human

To test the game using human input controls, run

lab$ bazel run :game -- --level_script=tests/empty_room_test --level_setting=logToStdErr=true
# or:
lab$ bazel run :game -- -l tests/empty_room_test -s logToStdErr=true

Leave the logToStdErr setting off to disable most log output.

Train an agent

DeepMind Lab ships with an example random agent in python/random_agent.py which can be used as a starting point for implementing a learning agent. To let this agent interact with DeepMind Lab for training, run

lab$ bazel run :python_random_agent

The Python API is used for agent-environment interactions.

DeepMind Lab ships with different levels implementing different tasks. These tasks can be configured using Lua scripts, as described in the Lua API.


Upstream sources

DeepMind Lab is built from the ioquake3 game engine, and it uses the tools q3map2 and bspc for map creation. Bug fixes and cleanups that originate with those projects are best fixed upstream and then merged into DeepMind Lab.

  • bspc is taken from github.com/TTimo/bspc, revision d9a372db3fb6163bc49ead41c76c801a3d14cf80. There are virtually no local modifications, although we integrate this code with the main ioq3 code and do not use their copy in the deps directory. We expect this code to be stable.

  • q3map2 is taken from github.com/TTimo/GtkRadiant, revision d3d00345c542c8d7cc74e2e8a577bdf76f79c701. A few minor local modifications add synchronization. We also expect this code to be stable.

  • ioquake3 is taken from github.com/ioquake/ioq3, revision 738465d677bddac1385da7d6099b58ca0c4a797f. The code contains extensive modifications and additions. We aim to merge upstream changes occasionally.

We are very grateful to the maintainers of these repositories for all their hard work on maintaining high-quality code bases.

External dependencies, prerequisites and porting notes

DeepMind Lab currently ships as source code only. It depends on a few external software libraries, which we ship in several different ways:

  • The zlib, glib, libxml2, jpeg and png libraries are referenced as external Bazel sources, and Bazel BUILD files are provided. The dependent code itself should be fairly portable, but the BUILD rules we ship are specific to Linux on x86. To build on a different platform you will most likely have to edit those BUILD files.

  • Message digest algorithms are included in this package (in //third_party/md), taken from the reference implementations of their respective RFCs. A "generic reinforcement learning API" is included in //third_party/rl_api, which has also been created by the DeepMind Lab authors. This code is portable.

  • EGL headers are included in this package (in //third_party/GL/{EGL,KHR}), taken from the Khronos OpenGL/OpenGL ES XML API Registry at www.khronos.org/registry/EGL. The headers have been modified slightly to remove the dependency of EGL on X.

  • Several additional libraries are required but are not shipped in any form; they must be present on your system:

    • SDL 2
    • Lua 5.1 (later versions might work, too)
    • gettext (required by glib)
    • OpenGL: A hardware driver and library are needed for hardware-accelerated human play. The headless library that machine learning agents will want to use can use either hardware-accelerated rendering via EGL or GLX or software rendering via OSMesa, depending on the --define headless=... build setting.
    • Python 2.7 (other versions might work, too) with NumPy, PIL. (A few tests require a NumPy version of at least 1.8.) Python 3 is supported experimentally.

The build rules are using a few compiler settings that are specific to GCC. If some flags are not recognized by your compiler (typically those would be specific warning suppressions), you may have to edit those flags. The warnings should be noisy but harmless.