Dungeon Generator (Page Update)

:brick: Dungeon Generator – Procedural Dungeon Creation System!

New versions coming out soooonnn :3

Hey if u like my Scripts, would not mind u joining my dc server to see what im up too! MaxRealm!/M.E

:link: Model Link: Dungeon Generator


- Status -

This project is in V2. if u find bugs report it in Max Realm Studio - DC

NEW:

Added Zombies and Props spawning!

:pushpin: Overview

The Dungeon Generator is a robust procedural room-placement system designed to generate rogue-like dungeon layouts using prebuilt modular rooms. It performs collision-aware room placement, supports weighted randomness for room selection, and auto-furnishes placed rooms with decorative objects.

Ideal for dungeon crawlers, adventure games, and randomized level design.


:hammer_and_wrench: Features

  • :repeat_button: Infinite room generation until no spawn points remain
  • :prohibited: AABB-based overlap checking
  • :bullseye: Weighted room selection (via NumberValue object in template)
  • :toolbox: Automatic Place Objects from pre-defined room slots
  • :package: Clean modular code split across multiple scripts

:open_file_folder: Script Breakdown

:scroll: DungeonGenerator.lua

Handles the entire generation logic:

  • Scans for spawn points and overlap boxes
  • Aligns rooms based on designated SpawnPlacer parts
  • Rejects overlapping placements
  • Recursively processes new spawn points
  • Outputs full log of generation process to output
DungeonGenerator:Generate(rootRoom)

:scroll: RoomRegistry.lua

Provides a weighted random pool of room templates stored in ServerStorage.RoomTemplates. To adjust room rarity, insert a NumberValue named Weight under the model.

{
  Model = RoomTemplate,
  Weight = 3, -- Higher means more likely
}

:scroll: FurnIsh.lua

Auto-furnishes each room after placement. Looks inside a folder named Objects in each room and replaces placeholder parts with real object clones from ServerStorage.Objects.


:brick: Setup Instructions

:card_file_box: Folder Structure

ServerStorage
β”œβ”€β”€ RoomTemplates
β”‚   β”œβ”€β”€ Room1 (Model) [has Weight NumberValue]
β”‚   β”œβ”€β”€ Room2 ...
└── Objects
    β”œβ”€β”€ Water (Normal Part)
    └── Chest (Model)

ReplicatedStorage / ServerScriptService
β”œβ”€β”€ DungeonGenerator (Folder/Module)
β”‚   β”œβ”€β”€ DungeonGenerator.lua
β”‚   β”œβ”€β”€ RoomRegistry.lua
β”‚   └── FurnIsh.lua

Workspace
β”œβ”€β”€ StartRoom (room with RoomSpawnPoints)

:pushpin: Required Room Parts

Each room template must contain:

  • :red_triangle_pointed_up: SpawnPlacer (red part): Determines alignment point for placement
  • :green_circle: RoomSpawnPoints: Parts named "RoomSpawnPoint" used as connection points
  • :package: OVERLAPBOXS folder: Holds parts used for collision detection

:play_button: How to Use

  1. Place the StartRoom manually in Workspace with at least one RoomSpawnPoint.
  2. Call:
local DungeonGenerator = require(path_to_DungeonGenerator)
DungeonGenerator:Generate(workspace.StartRoom)
  1. Watch as rooms are placed in real-time until all spawn paths are exhausted.

:warning: Notes

  • Rooms missing SpawnPlacer will be skipped with a warning.
  • Overlapping rooms are auto-removed during placement.
  • Room weighting can control generation flow and room rarity.

:speech_balloon: Feedback & Suggestions

Feel free to reply here with improvements or showcase your generated dungeons!
This system is modular and designed to be extended (e.g., biomes, room types, custom room validation).


:chequered_flag: Example Output (Console)

πŸ› οΈ Starting dungeon generation from: StartRoom
  β€· Queued spawn point: StartRoom.RoomSpawnPoints.Part
🎯 Processing spawn point: StartRoom.RoomSpawnPoints.Part
    πŸ”„ Trying template 'RoomA' (weight=2.00), 5 left in pool
    βœ… Placed room: RoomA
      βž• New spawn point queued: RoomA.RoomSpawnPoints.Part1
...
🏁 Dungeon generation complete. No more spawn points.

:film_projector: Example Video & Place

Is this help full?

  • Yes
  • No
  • Needs some work
0 voters
12 Likes

its all ive ever wanted thank you

1 Like

exactly what i was looking for and so recent too holy luck

1 Like

Hi, nice creation.

Can the test place be opened up so it is editable?

Do you think there is any way of adding like a β€˜roof’ or texture material to the top of where the outside the walls or rooms are , so like it is covered?

Is there support for like different room materials to be generated , so that it is not all the same?

Thanks

removed the zombie from the objects folder and i get this error
image
(also why does the model include a script disabling health regen)

u need to remove the Objects spawners from the rooms too
Also i was plaining on added loot tables and regen food stuff and forgot i even had that still in there xd

1 Like

ill see what i can do. but better off making new rooms and editing it. but the side things yea ill try to add that

post has been closed so this wont be happening sowwy