Visualizing The Data minerl.viewer

To help you get familiar with the MineRL dataset, the minerl python package also provides a data trajectory viewer called minerl.viewer:

The minerl.viewer program lets you step through individual trajectories, showing the observation seen the player, the action they took (including camera, movement, and any action described by an MineRL environment’s action space), and the reward they received.

usage: python3 -m minerl.viewer [-h] environment [stream_name]

positional arguments:
  environment  The MineRL environment to visualize. e.g.
               MineRLObtainDiamondDense-v0
  stream_name  (optional) The name of the trajectory to visualize. e.g.
               v3_absolute_zucchini_basilisk-13_36805-50154.

optional arguments:
  -h, --help   show this help message and exit

Try it out on a random trajectory by running:

# Make sure your MINERL_DATA_ROOT is set!
export MINERL_DATA_ROOT='/your/local/path'

# Visualizes a random trajectory of MineRLObtainDiamondDense-v0
python3 -m minerl.viewer MineRLObtainDiamondDense-v0

Try it out on a specific trajectory by running:

# Make sure your MINERL_DATA_ROOT is set!
export MINERL_DATA_ROOT='/your/local/path'
# Visualizes a specific trajectory. v3_absolute_zucch...
python3 -m minerl.viewer MineRLTreechop-v0 \
        v3_absolute_zucchini_basilisk-13_36805-50154

Interactive Mode minerl.interactor

Once you have started training agents, the next step is getting them to interact with human players. To help achieve this, the minerl python package provides a interactive Minecraft client called minerl.interactor:

The minerl.interactor allows you to connect a human-controlled Minecraft client to the Minecraft world that your agent(s) is using and interact with the agent in real time.

Note

For observation-only mode hit the t key and type /gamemode sp to enter spectator mode and become invisible to your agen``t(s).

Enables human interaction with the environment.

To interact with the environment add make_interactive to your agent’s evaluation code and then run the minerl.interactor.

For example:

env = gym.make('MineRL...')

# set the environment to allow interactive connections on port 6666
# and slow the tick speed to 6666.
env.make_interactive(port=6666, realtime=True)

# reset the env
env.reset()

# interact as normal.
...

Then while the agent is running, you can start the interactor with the following command.

python3 -m minerl.interactor 6666 # replace with the port above.

The interactor will disconnect when the mission resets, but you can connect again with the same command. If an interactor is already started, it won’t need to be relaunched when running the commnad a second time.