majikayogames / SimpleDungeons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SimpleDungeons for Godot 4

V2 Update is out. If you used the first version and want to upgrade, you will have to set up your dungeons again. Now dungeon kits don't exist and you just define individual rooms.

Currently in the process of finishing up the v2 update including documentation & bug fixes

SimpleDungeons is a Godot 4 addon which allows for the creation of procedurally generated 3D dungeons/levels using user defined prefab rooms.

SimpleDungeons Tutorial video: https://www.youtube.com/watch?v=v58l05FsdPs

You can download this repo and open its folder in Godot to run the sample project.

Installation

  1. Clone this repo or download as a zip by clicking the Code button above.
  2. Copy the contents of the addons folder to your project's addons directory.
  3. Enable the plugin in Project Settings > Plugins > SimpleDungeons.

Usage

  • Add a DungeonGenerator instance to your scene (addons/SimpleDungeons/DungeonGenerator.tscn) and set the size and shape of the dungeon you want to create.
  • Set the dungeon kit variable (which houses all the prefab rooms) on the DungeonGenerator. Use one of the sample DungeonKits or create your own.
  • Refer to the sample DungeonKit examples to see how you should structure the DungeonKit.
    • Each room needs doors defined by creating Node3Ds with the prefix "DOOR" for required doors or "DOOR?" for optional doors.
    • Define the AABB of each room with an invisible CSGBox3D named "AABB" as a direct child of the DungeonRoom. Must be standardized to the "room_size" export variable set on the DungeonKit scene.
    • Each room must inherit from the DungeonRoom class. When creating custom room scripts, make sure to add the @tool directive if you want to see in editor debug info for the room's doors.
    • You can connect to the placed_room signal which is emitted on the DungeonRoom once the generation is finished.
    • Other useful functions are DungeonRoom.get_doors() -> Array[Door] on DungeonRoom and Door.get_room_leads_to() -> DungeonRoom instance or null if none. Also DungeonRoom.get_door_by_node(door_node : Node3D) -> Door. Useful for removing unused optional doors after generation is finished.

License

This addon is available under the CC0 license.

About

License:Creative Commons Zero v1.0 Universal


Languages

Language:GDScript 100.0%