LabMaze

1.0.6 · active · verified Thu Apr 16

LabMaze is a standalone release of the maze generator used by DeepMind Lab, providing Python bindings to its C++ core. It can be configured to simplify paths and create rooms, and includes art assets to texture the environment. The primary purpose is to generate maze layouts for navigation tasks within other libraries. The current version is 1.0.6, released on December 5, 2022, indicating an infrequent release cadence focused on compatibility and bug fixes rather than new features.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create both random and fixed-layout mazes using `labmaze`. `RandomMaze` generates a maze with specified dimensions and a random seed. `FixedMaze` allows you to define a maze layout using a string, where 'P' denotes player spawn points and 'G' denotes goal positions. The `entity_layer` attribute provides a text representation of the generated maze.

import labmaze

# Generate a random maze
maze = labmaze.RandomMaze(height=11, width=13, random_seed=42)
print("Random Maze Entity Layer:")
print(maze.entity_layer)

# Generate a maze from a fixed layout
# 'P' for player spawn, 'G' for goal
fixed_layout = """
###########
#P . . . G#
# . # . . #
# . # . . #
# . . . . #
###########
"""
fixed_maze = labmaze.FixedMaze(
    text_maze=fixed_layout,
    num_spawns=1, # Can be overridden if 'P' tokens are present
    num_objects=1 # Can be overridden if 'G' tokens are present
)
print("\nFixed Maze Entity Layer:")
print(fixed_maze.entity_layer)

view raw JSON →