Dungeon Generation: A Procedural Generation Guide

Could you give us a file or free model of this thing?

Just take the place.

You could always turn it into a model.

I know this is kinda old but, could you attach a place or model file? Anything.

Would be awesome. Thanks for making this amazing tutorial.

I just used the Github link at the bottom of OP, then copy and paste source lua into a new .rbxl file.

Then you can play with it and either customize or learn more from it.

OP offers a guide so readers can follow along.

2 Likes

what does this do exactly?

does this add x to the self.map array or does it create its own array.

or does it have something to do with 2d arrays???

1 Like

I know that this may be somewhat difficult to do, but I have a request for a tutorial. I am attempting to create a game similar to this:
https://www.roblox.com/games/2768379856/SCP-3008-2-4?refPageId=963e8746-c8dc-473a-8e3c-cf488133f212

In this game, the creator has made different little plots, each one having a different floor and different furniture. For instance, if you 5 types of plots, one could have planks as a flooring, one could have fabric, another ice, another grass, and another pebbles. I was wondering how I would make these plots with different variety and with spaces between them for walkways. I’d also like to know how I could have a set plot at a set location, like the pillars in the game. For instance, every 3 plots, a pillar. I am a beginner scripter, so I would really like a tutorial for this. Thank you!

2 Likes

Amazing tutorial defiantly needed this for my game I’m working on thanks!

Perhaps you could go to scripting help and ask people how you would do this? I’m sure a lot of people there can answer your question. (Btw IF you decide to do that, Don’t ask them to make a full script.)

1 Like

In fact after a few hours, I did make my own topic. Unfortunately, like I said, I’m a horrible scripter.

that’s really really simple actually. start by choosing the map size; let’s say there’s 4 plots on each side

local plots = 4
for a = -plots, plots do
	for b = -plots, plots do
		
	end
end

this code goes through each point in our imaginary grid. in each of those points you need to choose a random plot model like so; (this code goes inside both loops)

local size = 20 -- let's say 20 is the size of our plot

local clone = game.ServerStorage["plot"..math.random(1,5)]
clone.Parent = workspace
clone:SetPrimaryPartCFrame(a*size, 1, b*size)

keep i mind you need to have a primarypart set for all of these models, so the script can move them into their position.
if you want a specific room in a specific spot you can just do

if a == number and b == number then clone = workspace.ServerStorage.specificRoom:Clone() end

sorry if i formatted anything wrongly whoops i’m new to this :grimacing:

1 Like

Thank you very much! I’ve been waiting for a reply for a while now! :grinning:

1 Like

no problem! if you need any more help feel free to message me :> good luck!

2 Likes

People like you bring hope to the dev-forums

2 Likes

So, I know I’m a little late, but I just now finally got around to trying this. I’m a beginner scripter, so I don’t know much. I was wondering where these scripts would go and if they were local scripts or not. Thanks!

it’s a server script (not local) because it generates the map for the server. if u need any more help, u can message me on roblox if u want to so we don’t clog this post :o

Hey! Thanks for making this! This is actually a pretty nice Module. I use it in my game, later when I get access to the pc I will add some credits. I forked it a little bit so Zombies will spawn in the rooms. Thanks for the module! Have a good day!

Thank you.
I may make a maze game base on this

Im super confused please can someone provide a .rbxl of it actually working?

1 Like

I know I’m extremely late to this - but I think there are some flaws in the system. As shown in the picture, most of the dungeon is out of bounds to the player. The highlighted bits are the parts that are accessible.
image

The only solution I can really find would be to check if pathfinding inbetween each room is possible - which may be intensive on the server. You’d have to restart the entire generation progress if anything failed.

This guide was made 4 years ago when I was only 16. Obviously, this is dated and flawed. So I’d expect bugs after all.

…But it still stands as good advice on the design process of your code.

1 Like