Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ template: |

Install with pip: `pip install nle==$RESOLVED_VERSION`.

See [README.md](https://github.com/heiner/nle/blob/v$RESOLVED_VERSION/README.md) and/or [docker/README.md](https://github.com/heiner/nle/blob/v$RESOLVED_VERSION/docker/README.md) for further instructions.
See [README.md](https://github.com/NetHack-LE/nle/blob/v$RESOLVED_VERSION/README.md) and/or [docker/README.md](https://github.com/NetHack-LE/nle/blob/v$RESOLVED_VERSION/docker/README.md) for further instructions.

# New in NLE v$RESOLVED_VERSION

Expand Down
8 changes: 4 additions & 4 deletions DATASET.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Instructions and Tutorials for the NetHack Learning Dataset

## License

This data is licensed under the NetHack General Public License - based on the GPL-style BISON license. It is the license used for the game of NetHack, and can be found [here](https://github.com/heiner/nle/blob/main/LICENSE).
This data is licensed under the NetHack General Public License - based on the GPL-style BISON license. It is the license used for the game of NetHack, and can be found [here](https://github.com/NetHack-LE/nle/blob/main/LICENSE).


## Accessing the Dataset
Expand Down Expand Up @@ -120,14 +120,14 @@ $ unzip /path/to/nld-nao-dir-ac.zip -d /path/to/nld-nao

## Using the Dataset ([Colab Demo](https://colab.research.google.com/drive/1GRP15SbOEDjbyhJGMDDb2rXAptRQztUD?usp=sharing))

The code needed to use the dataset will be distributed in `NLE v0.9.0`. For now it can be found on the `main` branch of [NLE](https://github.com/heiner/nle). You can follow the instructions to install [there](https://github.com/heiner/nle), or try the below.
The code needed to use the dataset will be distributed in `NLE v0.9.0`. For now it can be found on the `main` branch of [NLE](https://github.com/NetHack-LE/nle). You can follow the instructions to install [there](https://github.com/NetHack-LE/nle), or try the below.

```
# With pip:
pip install git+https://github.com/heiner/nle.git@main
pip install git+https://github.com/NetHack-LE/nle.git@main

# From source:
git clone --recursive https://github.com/heiner/nle.git
git clone --recursive https://github.com/NetHack-LE/nle.git
cd nle && pip install -e .
```

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
![NetHack Learning Environment (NLE)](https://github.com/heiner/nle/raw/main/dat/nle/logo.png)
![NetHack Learning Environment (NLE)](https://github.com/NetHack-LE/nle/raw/main/dat/nle/logo.png)

--------------------------------------------------------------------------------

<p align="center">
<a href="https://github.com/heiner/nle/actions/workflows/test_and_deploy.yml"><img src="https://github.com/heiner/nle/actions/workflows/test_and_deploy.yml/badge.svg?branch=main" /></a>
<a href="https://github.com/NetHack-LE/nle/actions/workflows/test_and_deploy.yml"><img src="https://github.com/NetHack-LE/nle/actions/workflows/test_and_deploy.yml/badge.svg?branch=main" /></a>
<a href="https://pypi.python.org/pypi/nle/"><img src="https://img.shields.io/pypi/v/nle.svg" /></a>
<a href="https://pepy.tech/project/nle"><img src="https://static.pepy.tech/personalized-badge/nle?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads" /></a>
<a href="https://twitter.com/NetHack_LE"><img src="https://img.shields.io/twitter/follow/NetHack_LE?label=Twitter&style=social" alt="Twitter" /></a>
Expand All @@ -24,7 +24,7 @@ You can read more about NLE in the [NeurIPS 2020 paper](https://arxiv.org/abs/20
README](./README.nh), at [nethack.org](https://nethack.org/), and on the
[NetHack wiki](https://nethackwiki.com).

![Example of an agent running on NLE](https://github.com/heiner/nle/raw/main/dat/nle/example_run.gif)
![Example of an agent running on NLE](https://github.com/NetHack-LE/nle/raw/main/dat/nle/example_run.gif)

This version of NLE uses the [Farama Organisation Gymnasium Environment](https://gymnasium.farama.org) APIs.

Expand Down Expand Up @@ -75,7 +75,7 @@ $ pip install nle
NOTE: If you want to extend / develop NLE, please install the package as follows:

``` bash
$ git clone https://github.com/heiner/nle --recursive
$ git clone https://github.com/NetHack-LE/nle --recursive
$ pip install -e ".[dev]"
$ pre-commit install
```
Expand All @@ -84,7 +84,7 @@ $ pre-commit install
## Docker

We have provided some docker images. Please see the [relevant
README](https://github.com/heiner/nle/blob/main/docker/README.md).
README](https://github.com/NetHack-LE/nle/blob/main/docker/README.md).


## Trying it out
Expand Down Expand Up @@ -187,7 +187,7 @@ for i, mb in enumerate(dataset):
foo(mb) # etc...
```

For information on how to download NLD-AA and NLD-NAO, see the dataset doc [here](https://github.com/heiner/nle/blob/main/DATASET.md).
For information on how to download NLD-AA and NLD-NAO, see the dataset doc [here](https://github.com/NetHack-LE/nle/blob/main/DATASET.md).

Otherwise checkout the tutorial Colab notebook [here](https://colab.research.google.com/drive/1GRP15SbOEDjbyhJGMDDb2rXAptRQztUD?usp=sharing).

Expand All @@ -201,15 +201,15 @@ Otherwise checkout the tutorial Colab notebook [here](https://colab.research.goo
- Küttler et al. [The NetHack Learning Environment](https://arxiv.org/abs/2006.13760) (FAIR, Oxford, NYU, Imperial, UCL, NeurIPS 2020).

Open a [pull
request](https://github.com/heiner/nle/edit/main/README.md)
request](https://github.com/NetHack-LE/nle/edit/main/README.md)
to add papers.



# Contributing

We welcome contributions to NLE. If you are interested in contributing please
see [this document](https://github.com/heiner/nle/blob/main/CONTRIBUTING.md).
see [this document](https://github.com/NetHack-LE/nle/blob/main/CONTRIBUTING.md).


# Architecture
Expand All @@ -221,7 +221,7 @@ repeated nethack games, and finally to binding of these games to Python
`gymnasium` environment.

If you want to learn more about the architecture of `nle` and how it works
under the hood, checkout the [architecture document](https://github.com/heiner/nle/blob/main/doc/nle/ARCHITECTURE.md).
under the hood, checkout the [architecture document](https://github.com/NetHack-LE/nle/blob/main/doc/nle/ARCHITECTURE.md).
This may be a useful starting point for anyone looking to contribute to the
lower level elements of NLE.

Expand Down
54 changes: 27 additions & 27 deletions doc/nle/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ that just feeds back observations. Below we examine these layers from lowest to
### Layer 0: “Original” NetHack Game Logic

- **part of `libnethack.so`**
- **key directories & files** [`src/`](https://github.com/heiner/nle/blob/main/src),
[`include/`](https://github.com/heiner/nle/blob/main/include),
[`dat/`](https://github.com/heiner/nle/blob/main/dat),
[`src/allmain.c`](https://github.com/heiner/nle/blob/main/src/allmain.c)
- **key directories & files** [`src/`](https://github.com/NetHack-LE/nle/blob/main/src),
[`include/`](https://github.com/NetHack-LE/nle/blob/main/include),
[`dat/`](https://github.com/NetHack-LE/nle/blob/main/dat),
[`src/allmain.c`](https://github.com/NetHack-LE/nle/blob/main/src/allmain.c)


* The original nethack game is written purely in C, found mainly in `src` and
Expand All @@ -31,48 +31,48 @@ that just feeds back observations. Below we examine these layers from lowest to
file to keep track of the internal state of the game, rendering the gamely
utterly un-threadsafe.
* The game logic itself starts in `allmain.c` where the game is started with
[`void moveloop(bool resuming)`](https://github.com/heiner/nle/blob/main/src/allmain.c#L23).
[`void moveloop(bool resuming)`](https://github.com/NetHack-LE/nle/blob/main/src/allmain.c#L23).
This function never returns, instead it runs an infinite loop
[(line 83)](https://github.com/heiner/nle/blob/main/src/allmain.c#L83),
[(line 83)](https://github.com/NetHack-LE/nle/blob/main/src/allmain.c#L83),
and may be interrupted either by the player or completing the game.

### Layer 1: Interacting with NetHack Game Logic: Windows and Window Procs

- **part of `libnethack.so`**
- **key directories & files** [`win/rl`](https://github.com/heiner/nle/blob/main/win/rl),
[`win/tty`](https://github.com/heiner/nle/blob/main/win/tty),
[`src/windows.c`](https://github.com/heiner/nle/blob/main/src/windows.c),
[`include/winprocs.h`](https://github.com/heiner/nle/blob/main/include/winprocs.h)
- **key directories & files** [`win/rl`](https://github.com/NetHack-LE/nle/blob/main/win/rl),
[`win/tty`](https://github.com/NetHack-LE/nle/blob/main/win/tty),
[`src/windows.c`](https://github.com/NetHack-LE/nle/blob/main/src/windows.c),
[`include/winprocs.h`](https://github.com/NetHack-LE/nle/blob/main/include/winprocs.h)


* Periodically the game may need input from the player, or need to return
something to be displayed to the player. To allow a variety of interfaces to be
exposed to the player (ie tty, mobile, atari etc), a developer must implement
and provide a number functions to the game, as a standard contract.
* The full api is described in
[`doc/window.doc`](https://github.com/heiner/nle/blob/main/doc/window.doc),
[`doc/window.doc`](https://github.com/NetHack-LE/nle/blob/main/doc/window.doc),
and is defined in `include/winprocs.h`. The object to be provided to the game is the
`struct window_procs`, which is (largely) a struct of pointers to functions.
* Once a developer has implemented this struct, it can be added to the chosen
`window_procs` in `src/windows.c`, via some macros. Our `window_procs` struct
is `extern`'d there under the name `rl_procs`.
* The implementation of `rl_procs` is found in
[`win/rl/winrl.cc`](https://github.com/heiner/nle/blob/main/win/rl/winrl.cc).
[`win/rl/winrl.cc`](https://github.com/NetHack-LE/nle/blob/main/win/rl/winrl.cc).
In this C++ file we implement a `class NetHackRL` that will contain all our
functions, and then we declare the struct `rl_procs` to point to the appropriate
methods.
* Our implementation of the `window_procs` wrap heavily around existing tty
`window_procs` found in
[`win/tty/wintty.c`](https://github.com/heiner/nle/blob/main/win/tty/wintty.c)
[`win/tty/wintty.c`](https://github.com/NetHack-LE/nle/blob/main/win/tty/wintty.c)
but allows us to control the capture of information and when to send it to the
user.

### Layer 2: Yielding from NetHack Game Logic: Context Switching and the “nethack-stack”

- **part of `libnethack.so`**
- **key directories & files** [`src/nle.c`](https://github.com/heiner/nle/blob/main/src/nle.c),
[`include/nle.h`](https://github.com/heiner/nle/blob/main/include/nle.h),
[`include/nletypes.h`](https://github.com/heiner/nle/blob/main/include/nletypes.h)
- **key directories & files** [`src/nle.c`](https://github.com/NetHack-LE/nle/blob/main/src/nle.c),
[`include/nle.h`](https://github.com/NetHack-LE/nle/blob/main/include/nle.h),
[`include/nletypes.h`](https://github.com/NetHack-LE/nle/blob/main/include/nletypes.h)


* In our case the user “playing” the game is not a terminal, but ultimately a
Expand Down Expand Up @@ -123,9 +123,9 @@ user.:
### Layer 3: Dynamic Library Loading: Resetting the Game

- **library:** libnethackdl.a,
- **key directories & files:** [`sys/unix/nledl.c`](https://github.com/heiner/nle/blob/main/sys/unix/nledl.c),
[`include/nledl.h`](https://github.com/heiner/nle/blob/main/include/nledl.h),
[`sys/unix/rlmain.cc`](https://github.com/heiner/nle/blob/main/sys/unix/rlmain.cc)
- **key directories & files:** [`sys/unix/nledl.c`](https://github.com/NetHack-LE/nle/blob/main/sys/unix/nledl.c),
[`include/nledl.h`](https://github.com/NetHack-LE/nle/blob/main/include/nledl.h),
[`sys/unix/rlmain.cc`](https://github.com/NetHack-LE/nle/blob/main/sys/unix/rlmain.cc)


* Now that we have a means of playing the game in `libnethack.so`, we would
Expand All @@ -148,11 +148,11 @@ nethack, instead of `nle.h`, and in fact we can test this with the file
### Layer 4: Binding to Python: Exposing the Game

- **libraries:** `_pynethack.cpython-37.*`
- **key directories & files:**[`pynethack.cc`](https://github.com/heiner/nle/blob/main/win/rl/pynethack.cc),
[`src/monst.c`](https://github.com/heiner/nle/blob/main/src/monst.c),
[`src/objects.c`](https://github.com/heiner/nle/blob/main/src/objects.c),
[`src/decl.c`](https://github.com/heiner/nle/blob/main/src/decl.c),
[`src/drawing.c`](https://github.com/heiner/nle/blob/main/src/drawing.c)
- **key directories & files:**[`pynethack.cc`](https://github.com/NetHack-LE/nle/blob/main/win/rl/pynethack.cc),
[`src/monst.c`](https://github.com/NetHack-LE/nle/blob/main/src/monst.c),
[`src/objects.c`](https://github.com/NetHack-LE/nle/blob/main/src/objects.c),
[`src/decl.c`](https://github.com/NetHack-LE/nle/blob/main/src/decl.c),
[`src/drawing.c`](https://github.com/NetHack-LE/nle/blob/main/src/drawing.c)


* Now that we have a means of playing the game, we need to bind our commands to
Expand All @@ -168,9 +168,9 @@ These include items found in `src/monst.c`, `src/decl.c`, `src/drawing.c`,

### Layer 5: Calling from Python: Playing A Copy of the Game

- **libraries:** [`nle`](https://github.com/heiner/nle/blob/main/nle)
- **key directories & files:** [`nle/nethack/*.py`](https://github.com/heiner/nle/blob/main/nle/nethack),
[`nle/env/*.py`](https://github.com/heiner/nle/blob/main/nle/env)
- **libraries:** [`nle`](https://github.com/NetHack-LE/nle/blob/main/nle)
- **key directories & files:** [`nle/nethack/*.py`](https://github.com/NetHack-LE/nle/blob/main/nle/nethack),
[`nle/env/*.py`](https://github.com/NetHack-LE/nle/blob/main/nle/env)


* The `class nle.nethack.Nethack` is our Python interface to the game. It does
Expand Down
2 changes: 1 addition & 1 deletion doc/nle/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Optionally, one can clone the repository and install the package manually.

.. code-block:: bash

$ git clone https://github.com/heiner/nle --recursive
$ git clone https://github.com/NetHack-LE/nle --recursive
$ conda activate nledev
$ pip install .

Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To build and run an image (e.g. `Dockerfile-jammy`) for your local
architecture do:

```bash
$ git clone https://github.com/heiner/nle --recursive
$ git clone https://github.com/NetHack-LE/nle --recursive
$ cd nle
$ docker build --file docker/Dockerfile-jammy . --tag nle
$ docker run -it --gpus all --rm --name nle nle
Expand Down
2 changes: 1 addition & 1 deletion nle/tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_is_loaded(self):
def test_no_memleak(self):
pytest.skip(
"Test is flaky "
"(https://github.com/heiner/nle/actions/runs/8943546654/job/24568502821)"
"(https://github.com/NetHack-LE/nle/actions/runs/8943546654/job/24568502821)"
)

chars = np.zeros((SEQ_LENGTH, ROWS, COLUMNS), dtype=np.uint8)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def build_extension(self, ext):
long_description=long_description,
long_description_content_type="text/markdown",
author="The NLE Dev Team",
url="https://github.com/heiner/nle",
url="https://github.com/NetHack-LE/nle",
license="NetHack General Public License",
entry_points=entry_points,
packages=packages,
Expand Down
2 changes: 1 addition & 1 deletion third_party/converter/converter.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void callback(tmt_msg_t, TMT *, const void *, void *);
#define BRIGHT 8


/* Taken from nle.c -- github.com/heiner/nle */
/* Taken from nle.c -- github.com/NetHack-LE/nle */
signed char
vt_char_color_extract(TMTCHAR *c)
{
Expand Down
Loading