Random Map Generator – Modular, Scalable, and Customizable.
Hey everyone!
I’ve been working on a Random Map Generator designed to be both modular and customizable for various types of games – Caves, Dungeons, Maze, FPS, Etc… It’s built for flexibility, supports multiple generation algorithms, and comes with visual profiles to help you see results instantly.
-------------------------------------------=| Plugin | UnCopyLocked | Tutorial |=-------------------------------------------
How It Works:
- A grid is created based on your settings.
- Each cell is processed with rules for structure type (wall, enemy, trap, etc.).
- The selected visual profile determines how the final structure appears in-game.
Features:
- Infinite customizability for different map types
- Realtime generation to zone in on your preference.
- Supports saving settings to use in the future.
Why I Built This
I’ve always loved procedural generation. Originally inspired by terrain generation, but took a break due to having issues with conceptualizing creating towns to be built in to the terrain (Like Minecraft). However, with new profound knowledge from this project, I might be able to create what I couldn’t.
To pilot this technique I am in the final stages of a mining game that uses this technique, which I will be launching a trailer in the months to come. I hope this plugin will aid those in shying away from more linear maps.
Info
Using the Plugin UI
- Profile – determines the theme (e.g., Town, Cave)
- Style – generation algorithm (e.g., Cellular, Room-Based)
- Path Width – controls hallway thickness
- Grid Size – how many cells wide and tall the dungeon is
- Part Size – physical size of each cell (studs)
- Dungeon X, Y, Z – where to spawn the dungeon in the world
- Wait Time – increase if the dungeon doesn’t fully generate (helps with large maps or server lag)
Image
Generate + Save
- Adjust the parameters in the plugin UI.
- Click Generate to create the dungeon in real-time.
- If you like the result, click Save , which you will be prompted for a name, then it will store the settings to
settingsFolder
in ReplicatedStorage
.
Image
Use Saved Settings in Your Game
- In
ServerScriptService
, create a new Script.
- Paste this code:
local SS = game:GetService("ServerScriptService")
local RS = game:GetService("ReplicatedStorage")
local DungeonGenFolder = SS:WaitForChild("DungeonGen")
local SettingsFolder = RS:WaitForChild("settingsFolder")
local SetUpModule = require(DungeonGenFolder:WaitForChild("SetUp"))
local settingToUse = SettingsFolder:WaitForChild("Example") -- or name of your savedSetting
SetUpModule.Initialize(settingToUse)
Run the game — your dungeon will spawn automatically!
Spawn Players into the Map
Summary
- Inside the
SetUp
module, move or adjust the commented-out section for player spawning.
- Place SpawnPlayer function at the end of the script
- For advanced control, use the
PlayerHandler
module inside helperScripts
.
Create a Custom Profile (e.g., FPS Map)
- Duplicate the
Template
Profile script in the Profiles folder.
- Rename it (e.g.,
FPSProfile
).
- Customize the generation rules inside the script:
- Add Parts or objects accordingly to rules
- View other profiles to get an idea
- Use it either with the plugin by placing it inside the Profiles folder
- Or Use it in your saved setting code, ( You will need to go inside your saved setting and update the profile to your script name)
Change Log
-Added Plugin support
-Rebranded to a generalized map generator
-Fix profiles not updating with changes
-Added Test place
-Added more example images
-Added Tutorial
-Complete overhaul.
Feedback & Requests
If you’d like a more detailed tutorial on creating your own dungeon profiles, let me know! I’m happy to expand this into a full guide if there’s enough interest.
Poll
- Helpful
- Advanced Tutorial
Examples:
#Edit: Possible examples by modifying/creating the profile presets available.
Example1
Example2
Example3
Style Examples
Profile Examples
27 Likes
This is extremely helpful. I would need something like that eventually on my game; I don’t need to worry about it anymore.
1 Like
is it normal for it to just turn into a black maze with a bunch of 2x2 studs inside it
edit: heres a picture of it
is this normal or like
i thought it would generate something like the examples but like
its just that
am i doing something wrong or like
what
i just have it in workspace
Yes, the Basic profile is currently selected. It’s mainly there to help you visualize the dungeon layout, including how different objects spawn on specific grid types (represented by the different colored grids).
You can explore other presets by changing the floorNumber
variable (located in the main server script called GRID
). Each floor number from 1 to 5 has its own preset with different visual styles and generation algorithms.
Alternatively, you can go into FloorSettings
and switch the profile from Basic to something else—like Maze, for example. This will change how the dungeon is generated and visualized. Since floorNumber = 1
right now, updating the profile under the first item in FloorSettings
will immediately affect the visual output.
Try changing the profile to “Grass” to see a more structured and concrete layout instead of the default black maze style.
#Edit: For example:
#Edit2
Those examples are not present in the profiles here, as they are from my main game. But they use the same logic and is up to you all to modify or create your own profile to get the output you are looking for.
1 Like
ok i figured out how to use it and like
its QUITE COOL!
10/10 cheeseburgers
might use this somewhere
Had a stroke of genius last night. One of the reasons I stopped messing with terrain generation, was because I could not figure out placement of towns. Yes, I could randomly place objects at random and hope it would look good, but after working on this, I have gotten some better insight on how I might achieve this.
Here is an example:
I have updated my resource to include the [Profile] - Town and the [Style] - Townia.
The town profile only works with the town style and vise versa right now as I am re-writing the rest of the logic.
Other
As it is currently using Random walk room placement algorithm, but at the same time not using certain functions that assign grid types. So not all Grid types are present in that [Style] - Townia.
Try it out yourself by switching floorNumber = 6 and look at the Town module script under profiles to see how I achieved this look.
Other
Which you can also mess with these variables inside the Town Module to adjust the terrain.

Of course you can always go in to FloorSettings and adjust [6] and its variables like partSize, pathSize, gridSize to get different results
2 Likes
oh man thats kinda cool
fvnkljdnfgjkndafg;kaj;oij;hjkl
1 Like
Absolutely agree, I believe this project has a lot of potential and flexibility. It’s not limited to a traditional “dungeon” style.
Honestly, you could even use it to spit out random PvP or FPS maps too. Just toss in some stuff like walls, spots to mess around.
1 Like
can you do a tutorial on how to set this up, wanna mess with this style, but no matter what i change i get this error

1 Like
Yes, I’m planning to create a tutorial soon. In the meantime, I’m working on turning this into a plugin to provide a more user-friendly experience.
A quick note about that warning message you might see when using the Town | Townia preset: it’s completely normal and nothing to worry about. It simply means every grid cell has been assigned a type—whether it’s air, wall, enemy, etc.—and there are no remaining types left to assign.
If you find the warning distracting, feel free to comment it out in your code.
1 Like
thought it was the reason it isnt generating anything
not sure
all that is made
Hmmmm…
-Are you running it as the server or playing it as a player?
-What types of changes have you made/ your settings ( Did you increase grid size, part size, etc?) (Maybe a large grid size is having issues with generation?)
-If you switch to other Styles/Profiles does it work?
The only bug I have found – (which I am curious if this is your issue) – is sometimes it tries to visualize the dungeon before all the grids have been initialized, which is dependent on compute power. The temp fix is a wait time.
-Try increasing WaitTime from 10 to 30+ which is located in the main GRID script. Let me know if that makes it work.
I am hoping once I get it as a plugin, and re-write the logic. It should fix that.
- Added plugin support. (swapped link and deprecated old one)
- Re-wrote code logic
- updated documentation above ( View Use Case )
- Also you will see the following if you make any changes to a profile or script inside the DungeonGen folder. That is my work in progress to make it so the plugin will detect and apply the changes to the scripts.
[Watcher] Detected change in dungeonFolder. Rebuilding profiles...
First time making a plugin, let me know if there is any issues
Will pump out a tutorial shortly with creating your own custom profile.
Complete Over haul!!!
- Complete revamp on the plugin GUI
- Added Tutorial (Video kinda cringe and randomly put together, but oh well)
- Added some more example photos.
- Added a unCopyLocked place to see everything in action.
Let me know your thoughts on any bugs or changes you would like to see.
nice!!
vnsjkzlnvdjknsalkvjndslkjvbsaljhbkblh
1 Like
Brining out the true possibilities!
--< I would like to see what other can make with this plugin >--
1 Like
Wow this is really cool!
I might fiddle around with it, and might even use it in my DBD game to make all maps randomly generated.
1 Like
I feel like it should generate the bushes and houses and trees for us too not just the simple map
Thank you,
When you do get around to it, I would like to see what you come up with!
1 Like
I totally get where you’re coming from! That’s actually why I included the Town
profile and the Townia
style — they come with some basic prefabs like house-shaped blocks, bushes, and terrain elements to help get you started.
But, to achieve more detailed or custom visuals like the ones above, you’ll want to tweak the Town
Profile module with your own assets. I’ve included helpful tips and tricks within each profile script to make that easier.
This project is meant to be more of a creative tool — it gives you a strong foundation, but leaves room for your own unique style and ideas to really shine. So think of it as a canvas where you can add your own creative touches to bring your world to life!
1 Like