Code Monkey home page Code Monkey logo

godot-procedural-maze's Introduction

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:

  • size_x and size_y, the number of columns and rows of the maze grid
  • corridor_width the width of rows and columns
  • wall_width the width of generated walls
  • height the height of the maze
  • random_seed the seed used when creating the maze
  • wall_material, floor_material and ceiling material the materials used for floor, wall and ceiling

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

  • wall_models an array of meshes to be used as walls inside the maze
  • outer_wall_models an array of meshes to be used as walls
  • pillar_model is a mesh that is used where walls end

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.

godot-procedural-maze's People

Contributors

rodzill4 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.