View: Multi-Page Single Page

Quick Start

From import to a maze you can play, in about five minutes.

1. Install

Import the package. Everything lives under Assets/SimpleMaze/, and nothing is added to your scenes until you ask for it.

The core (the generator, the solver, the play rules and the maze data) has no package dependencies. The demo uses the Input System and Unity UI packages. It reads the keyboard through the Input System, so set Project Settings > Player > Active Input Handling to Input System Package or Both before you play it.

Render pipelines: URP is recommended, HDRP is supported and the Built-in pipeline still works. The demo builds its materials from the active pipeline's default shader, and on HDRP it adds a small volume so it looks the same as on the others (turn off HdrpLook on the MazeDemo component to use your own lighting instead). Simple Maze was built and tested with Unity 6000.6.

2. Generate a maze

Open Window > Living Failure > Simple Maze > Maze Generator. You can also get there from Assets > Create > Simple Maze > Maze Generator.

1

Take a preset

Press Presets and pick Classic/Circular 10 rings. A preset replaces every setting with a ready-made recipe.

2

Generate

Press Generate. Mazes are built on a background thread, so the window stays responsive, and a long batch shows a progress bar with a Cancel button. Raise Batch count to make up to 20 at a time.

3

Try a few more

Gimmicks/Keys and doors locks the way with doors whose keys hide before them. Roll/Ice board (square) makes the player slide until a wall stops it. Big/Tower of 3 floors stacks three floors joined by stairs, and Shapes/Word: MAZE carves the maze into the letters of a word.

If you change settings by hand and they fight each other (Roll on a triangle grid, say), press Auto. It fixes them and tells you what it changed.

3. Read the analysis

The pane on the right shows the selected maze. From the top:

  • The verdict: the par in steps or rolls, whether the best solution is unique or how many there are, and the difficulty out of 5. A warning shows when a player can get stuck.
  • Board: a picture of the maze with a legend, tabs for each floor, and a zoom. Hover a cell to see what is in it.
  • Best solution: a slider that steps through the solution, with the players moving, keys and gems disappearing as they're taken and gates flipping. Below it is the move list and a Copy solution button.
  • Facts and Generation report: the numbers (dead ends, loops, decisions, coverage and more) and every note the generator left.
  • Export: save the maze as a PNG or SVG, as a printable sheet, an answer key or the colour view.

Dragging the solution slider is the quickest way to judge a maze. You can see at a glance whether the route wanders the whole board or runs straight to the goal.

4. Save it

Press Save and choose:

  • Current saves the selected maze as a MazePuzzleAsset.
  • Pack (all) saves every maze in the set as one ordered MazePuzzlePack.
  • Pack (unique only) saves just the mazes with exactly one best solution.

Both asset types have inspectors with the same analysis pane, plus Verify, which solves the maze again and refreshes its stored verdict, and Re-roll, which makes a new maze from the same settings with a fresh seed. A pack also has Export all, which writes every maze as a printable picture and its answer key into a folder you pick.

5. Play the demo

Open Assets/SimpleMaze/Scenes/SimpleMazeDemo.unity and press Play. The demo opens on a welcome screen. Press Let's play, pick a mode, then choose Endless for a new maze to your order or Level Pack for the ready-made levels.

The controls are also listed at the bottom of the screen while you play:

  • Arrows or WASD move or roll, and Q, E, Z and C take the diagonal sides on hex, triangle and circular mazes.
  • Space or Enter takes the stairs (or Page Up and Page Down).
  • U (or Backspace, or Ctrl+Z) undoes a move, R restarts and H shows a hint.
  • F lets the solver play the rest of the maze from where you are, and F or R stops it.
  • Tab or 1 to 4 switches player when several players each have a goal of their own.
  • [ and ] or a right-drag turn the view, Home and End tilt it, the mouse wheel or + and - zoom, and V resets it.
  • M mutes the sound and Esc goes back to the menu.

6. Use it in your game

Make a maze in code, check what the solver found, and read the rest straight off the MazeData:

using SimpleMaze;

var settings = new MazeSettings
{
    Grid = TopologySpec.Circle(10),
    Endpoints = Endpoints.OutsideIn,   // start on the rim, goal in the centre
    Keys = 2,
    TargetDifficulty = 3,              // keep trying until it rates 3 stars
};
MazeData maze = MazeGenerator.GenerateVerified(settings);
Debug.Log($"Par {maze.Par} steps, {maze.Difficulty} stars, solvable: {maze.Solvable}");

To run your own game on it, keep a MazePlay and ask MazeRules what each move does. These are the same rules the solver used, so your game always agrees with the par:

MazePlay play = MazeRules.NewGame(maze);
int here = play.Positions[0];
int next = maze.Topology.Neighbor(here, 0);       // the cell through side 0

if (MazeRules.TryStep(maze, play, 0, next, out string reason))
{
    if (MazeRules.IsSolved(maze, play)) Debug.Log("Solved!");
}
else Debug.Log(reason);                            // why it can't go: a wall, a locked door...

Or let the demo's 3D view draw and play it for you. MazeGame adds a MazeView3D to the same object and builds the whole maze from primitives:

using SimpleMaze.Demo;

var game = new GameObject("Maze").AddComponent<MazeGame>();
game.Begin(maze);
game.View.FrameCamera(Camera.main, -1);           // -1 frames every floor

A saved maze works the same way: give your script a MazePuzzleAsset field and use its Maze, or a MazePuzzlePack and its Get(index). See the API Reference for the rest.

Where to next

  • Generating explains every setting and what it does.
  • Demos shows how the demo scene is put together and how to change it.
  • Troubleshooting covers notes, fallbacks and limits.