Trying out MiniHack

MiniHack uses the popular Gym interface for the interactions between the agent and the environment.

A pre-registered MiniHack environment can be used as follows:

import gym
import minihack
env = gym.make("MiniHack-River-v0")
env.reset() # each reset generates a new environment instance
env.step(1)  # move agent '@' north

The gym.make command can also be used to override specific environment parameters:

env = gym.make(
   observation_keys=("pixel", "glyphs", "colors", "chars"),

To see the list of all MiniHack environments, run:

python -m minihack.scripts.env_list

Playing as a human

The following scripts allow to play MiniHack environments with a keyboard:

# Play the MiniHack in the Terminal as a human
$ python -m --env MiniHack-River-v0

# Use a random agent
$ python -m --env MiniHack-River-v0  --mode random

# Play the MiniHack with graphical user interface (gui)
$ python -m minihack.scripts.play_gui --env MiniHack-River-v0


If the package has been properly installed, one could run the scripts above with mh-envs, mh-play, and mh-guiplay commands.