MiniHack supports several forms of observations, including global or agent-centred viewpoints (or both) of the grid. The table bellow illustrateds three forms of agent-centred observations of the grid of the map in MiniHack.
Pixel Observations | Symbolic Observations | Textual Observations |
---|---|---|
In addition, observations can include player statistics, in-game text messages, and inventory information.
MiniHack has a dictionary-structured observation space. Most keys are inherited from NLE, while some are added in MiniHack. To make sure that the desired observations are returned by the environment, the corresponding options should be passed during the initialisation. The observation_keys
parameter can be used to specify the observation space in any MiniHack environment:
env = gym.make(
"MiniHack-River-v0",
observation_keys=("glyphs", "chars", "colors", "pixel"),
)
Note that using different observation keys can make environments significantly easier or harder.
Name | Description |
---|---|
glyphs |
a |
chars |
a |
colors |
a |
specials |
a |
screen_descriptions |
a |
pixel |
a representation of the current screen in image form, where each cell is represented by a |
blstats |
a representation of the status line at the bottom of the screen, containing information about the player character's position, health, attributes and other statuses. It comes in the form of a dimension |
message |
the utf-8 encoding of the on-screen message displayed at the top of the screen. It's a |
inv_glyphs |
a |
inv_letters |
a |
inv_oclasses |
a |
inv_strs |
a |
tty_chars |
the character representation of the entire screen, including the message and map, of size |
tty_colors |
the color representation of the entire screen, including the message and map, of size |
tty_cursor |
the location of the cursor on the screen, a 2-dimensional vector of (x,y) coordinates. |
For `glyphs`, `chars`, `colors`, `specials`, `pixel`, `screen_descriptions`, `tty_chars`, and `tty_colors` a cropped observation centered the agent can be used by passing the observation name suffixed with `_crop` (e.g. `chars_crop`). This is a NxN matrix centered on the agent's current location containing the information normally present in the full view. The size of the crop can easily be configured using the `obs_crop_h` and `obs_crop_w` parameters of the environment (9 by default). Cropped observations can facilitate the learning, as the egocentric input makes representation learning easier.