|
1 |
| -# DeepMind Lab |
| 1 | +# <img src="docs/logo.png" alt="DeepMind Lab"> |
2 | 2 |
|
3 |
| -A 3D learning environment. |
| 3 | +*DeepMind Lab* is a 3D learning environment based on id Software's |
| 4 | +[Quake III Arena](https://github.com/id-Software/Quake-III-Arena) via |
| 5 | +[ioquake3](https://github.com/ioquake/ioq3) and |
| 6 | +[other open source software](#upstream-sources). |
| 7 | + |
| 8 | +<div align="center"> |
| 9 | + <a href="https://www.youtube.com/watch?v=M40rN7afngY" |
| 10 | + target="_blank"> |
| 11 | + <img src="http://img.youtube.com/vi/M40rN7afngY/0.jpg" |
| 12 | + alt="DeepMind Lab - Nav Maze Level 1" |
| 13 | + width="240" height="180" border="10" /> |
| 14 | + </a> |
| 15 | + <a href="https://www.youtube.com/watch?v=gC_e8AHzvOw" |
| 16 | + target="_blank"> |
| 17 | + <img src="http://img.youtube.com/vi/gC_e8AHzvOw/0.jpg" |
| 18 | + alt="DeepMind Lab - Stairway to Melon Level" |
| 19 | + width="240" height="180" border="10" /> |
| 20 | + </a> |
| 21 | + <a href="https://www.youtube.com/watch?v=7syZ42HWhHE" |
| 22 | + target="_blank"> |
| 23 | + <img src="http://img.youtube.com/vi/7syZ42HWhHE/0.jpg" |
| 24 | + alt="DeepMind Lab - Laser Tag Space Bounce Level (Hard)" |
| 25 | + width="240" height="180" border="10" /> |
| 26 | + </a> |
| 27 | + <br /><br /> |
| 28 | +</div> |
| 29 | + |
| 30 | +*DeepMind Lab* provides a suite of challenging 3D navigation and puzzle-solving |
| 31 | +tasks for learning agents. Its primary purpose is to act as a testbed for |
| 32 | +research in artificial intelligence, especially deep reinforcement learning. |
| 33 | + |
| 34 | +## About |
| 35 | + |
| 36 | +Disclaimer: This is not an official Google product. |
| 37 | + |
| 38 | +If you use *DeepMind Lab* in your research and would like to cite |
| 39 | +the *DeepMind Lab* environment, we suggest you cite |
| 40 | +the [DeepMind Lab paper](https://deepmind.com/documents/deepmind_lab.pdf). |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +## Getting started on Linux |
| 45 | + |
| 46 | +* Get [Bazel from bazel.io](http://bazel.io/docs/install.html). |
| 47 | + |
| 48 | +* Clone DeepMind Lab, e.g. by running |
| 49 | + |
| 50 | +```shell |
| 51 | +$ git clone https://github.com/deepmind/lab |
| 52 | +$ cd lab |
| 53 | +``` |
| 54 | + |
| 55 | +* For a live example of a random agent, run |
| 56 | + |
| 57 | +```shell |
| 58 | +lab$ bazel run :random_agent --define headless=false -- \ |
| 59 | + --length=10000 --width=640 --height=480 |
| 60 | +``` |
| 61 | + |
| 62 | +Here is some [more detailed build documentation](docs/build.md), |
| 63 | +including how to install dependencies if you don't have them. |
| 64 | + |
| 65 | +### Play as a human |
| 66 | + |
| 67 | +To test the game using human input controls, run |
| 68 | + |
| 69 | +```shell |
| 70 | +lab$ bazel run :game -- --level_script tests/demo_map |
| 71 | +``` |
| 72 | + |
| 73 | +### Train an agent |
| 74 | + |
| 75 | +*DeepMind Lab* ships with an example random agent in |
| 76 | +[`python/random_agent.py`](python/random_agent.py) |
| 77 | +which can be used as a starting point for implementing a learning agent. To let |
| 78 | +this agent interact with DeepMind Lab for training, run |
| 79 | + |
| 80 | +```shell |
| 81 | +lab$ bazel run :random_agent |
| 82 | +``` |
| 83 | + |
| 84 | +The Python API for the agent-environment interaction is described |
| 85 | +in [docs/python_api.md](docs/python_api.md). |
| 86 | + |
| 87 | +*DeepMind Lab* ships with different levels implementing different tasks. These |
| 88 | +tasks can be configured using Lua scripts, |
| 89 | +as described in [docs/lua_api.md](docs/lua_api.md). |
| 90 | + |
| 91 | +----------------- |
| 92 | + |
| 93 | +## Upstream sources |
| 94 | + |
| 95 | +*DeepMind Lab* is built from the *ioquake3* game engine, and it uses the tools |
| 96 | +*q3map2* and *bspc* for map creation. Bug fixes and cleanups that originate |
| 97 | +with those projects are best fixed upstream and then merged into *DeepMind Lab*. |
| 98 | + |
| 99 | +* *bspc* is taken from [github.com/TTimo/bspc](https://github.com/TTimo/bspc), |
| 100 | + revision e6f90a2dc02916aa2298da6ace70a8333b3f2405. There are virtually no |
| 101 | + local modifications, although we integrate this code with the main ioq3 code |
| 102 | + and do not use their copy in the `deps` directory. We expect this code to be |
| 103 | + stable. |
| 104 | + |
| 105 | +* *q3map2* is taken from |
| 106 | + [github.com/TTimo/GtkRadiant](https://github.com/TTimo/GtkRadiant), |
| 107 | + revision 8557f1820f8e0c7cef9d52a78b2847fa401a4a95. A few minor local |
| 108 | + modifications add synchronization and use C99 constructs to replace |
| 109 | + formerly non-portable or undefined behaviour. We also expect this code to be |
| 110 | + stable. |
| 111 | + |
| 112 | +* *ioquake3* is taken from |
| 113 | + [github.com/ioquake/ioq3](https://github.com/ioquake/ioq3), |
| 114 | + revision 1c1e1f61f180596c925a4ac0eddba4806d1369cd. The code contains extensive |
| 115 | + modifications and additions. We aim to merge upstream changes occasionally. |
| 116 | + |
| 117 | +We are very grateful to the maintainers of these repositories for all their hard |
| 118 | +work on maintaining high-quality code bases. |
| 119 | + |
| 120 | +## External dependencies, prerequisites and porting notes |
| 121 | + |
| 122 | +*DeepMind Lab* currently ships as source code only. It depends on a few external |
| 123 | +software libraries, which we ship in several different ways: |
| 124 | + |
| 125 | + * The `zlib`, `glib`, `libxml2`, `jpeg` and `png` libraries are referenced as |
| 126 | + external Bazel sources, and Bazel BUILD files are provided. The dependent |
| 127 | + code itself should be fairly portable, but the BUILD rules we ship are |
| 128 | + specific to Linux on x86. To build on a different platform you will most |
| 129 | + likely have to edit those BUILD files. |
| 130 | + |
| 131 | + * Message digest algorithms are included in this package (in |
| 132 | + [`//third_party/md`](third_party/md)), taken from the reference |
| 133 | + implementations of their respective RFCs. A "generic reinforcement learning |
| 134 | + API" is included in [`//third_party/rl_api`](third_party/rl_api), which has |
| 135 | + also been created by the *DeepMind Lab* authors. This code is portable. |
| 136 | + |
| 137 | + * Several additional libraries are required but are not shipped in any form; |
| 138 | + they must be present on your system: |
| 139 | + * SDL 2 |
| 140 | + * Lua 5.1 (later versions might work, too) |
| 141 | + * gettext (required by `glib`) |
| 142 | + * OpenGL: a hardware driver and library are needed for hardware-accelerated |
| 143 | + human play, and OSMesa is required for the software-rendering, headless |
| 144 | + library that machine learning agents will want to use. |
| 145 | + * Python 2.7 (other versions might work, too) |
| 146 | + |
| 147 | +The build rules are using a few compiler settings that are specific to GCC. If |
| 148 | +some flags are not recognized by your compiler (typically those would be |
| 149 | +specific warning suppressions), you may have to edit those flags. The warnings |
| 150 | +should be noisy but harmless. |
0 commit comments