RodZill4 / godot-procedural-maze

A simple procedural maze for 3d games using Godot Engine
MIT License
76 stars 20 forks source link

godot-procedural-maze

A simple procedural maze for 3d games using Godot Engine

Inside Godot

TPS view of the multimesh maze

To create a new maze, create a new script that extends either maze.gd or maze_multimesh.gd from the addons/procedural_maze directory and attach it to a new StaticBody.

maze.gd builds a 3d maze using 3 materials (1 for the floor, 1 for the walls and 1 for the ceiling) and exports the following variables:

maze_multimesh.gd uses an array of wall models and will instantiate them randomly and has the following additional variables:

You can add a child node named Config to the maze and add CollisionShape nodes with box shapes to this node. this will exclude the corresponding zones from maze generation (the example show how this can be used to define rooms and openings in the maze).

Your maze script can also redefine the instanciate_objects function. This function is automatically called at the ens of maze generate with an array of object locations as parameter. Objects are either "loot" and "door" and ordered in a "maze walking order" that can be used to place doors and keys in the maze.

Character model used by the example: https://opengameart.org/content/animated-human-low-poly.