The Black Friday Sale is here! Save up to 70% on select products now through December 2.

Maze Dungeon Generator Plugin

ZacharyKolansky - Nov 13, 2020

Generate Complex, Multistory Dungeons with UWorlds for Rooms.

  • Supported Platforms
  • Supported Engine Versions
  • Download Type
    Engine Plugin
    This product contains a code plugin, complete with pre-built binaries and all its source code that integrates with Unreal Engine, which can be installed to an engine version of your choice then enabled on a per-project basis.

Instead of creating huge levels, designers can create small rooms with Unreal’s built in map/level tools, and then have an object distribute those rooms properly, and handle scaling.

Floor Generation General Algorithm: (More detailed description for the whole dungeon in the documentation)

  1. Build a maze that fits in a Grid of R rows and C columns.
  2. Given the specified parameters, determine which cells will be part of a room and mark them
  3. Mark walls we want doors to spawn. Doors will spawn on a wall that doesn't have a mesh. The particular wall wall is between a cell that is marked as a room, and a cell that isn’t marked as a room.
  4. Draw the maze floor, except don't draw the cells that will be part of room.
  5. Stream in ULevelInstances to fill the room holes. Scale the rooms after they have streamed in.

Technical Details


  • Create a dungeon with a 3D grid containing X rows, Y, columns, Z floors.
  • Floor, door, and wall mesh piece scaling handled by the generator. Just give the size of the meshes. They are scaled to your specified scale of each tile of the dungeon.
  • Distribute rooms as ULevelInstances* in the dungeon. Room scaling to the dungeon in the X,Y,Z and directions is also managed. Connections between rooms are handled by the generator. 
  • Placement of doors to separate your rooms and the dungeon is automatically handled by the generator. 
  • Build Mazes!
  • Generator written in C++
  • HISM used for the dungeon walls for efficiency.
  • Asyc loading component for easily loading your soft pointers.

Epic’s resources used

  • Some Starter content architecture 
  • Starter content door prop.  

Code Modules:

  •  Module: MazeDungeonGeneratorPlugin. Type: Runtime.

Number of Blueprints: 5

Number of C++ Classes: 4

Network Replicated: No

Supported Development & Build Platforms: Windows 64 bit, Mac, Android, IOS,


Important/Additional Notes:

Change the singleton in the project settings to DungeonSingleton_BP, or level streaming for rooms and stairs won't work!

Level Streaming/Level Instance creation and Door spawning are only available at runtime. Constructor time can be used to show where the HISM's will be in world space, but it will be rebuilt at runtime.

Maps that represent rooms are unlit, and will appear completely black in the editor. Change the viewmode to unlit.