Dungeonify - Large templated structure generator with quotas and restrictions

Now that I think about it I had this issue about a month ago, but I didn’t think it was something everyone would have, so I didn’t post about, I assumed my mucking about with the module had messed something up.

Guess I should’ve posted about it, but at least you figured it out on your own.

1 Like

Again, would love either an image or video tutorial!

I’ll try to make a tutorial on this since well its confusing but its really useful. Hopefully when my pc records my voice I can probably start making it!!!

1 Like

Thanks! I’ve been wanting to use this for a while, but don’t know where to start.

I saw this post a few months ago and forgot about it, happy I saw it again and I tried it out.



This was just a quick 2 hour build with some models from my newest build so I didnt put as much detail


I do wish I could customize break points so there isnt just a blank part.

Overall its really easy to put together quickly, and I did have some minor issues like sections not being attached fully but thats an issue on the build end and is easily fixable.

I’d definitely recommend this for a Doors type game or yea… a dungeon game

12 Likes

Amazing, but my only issue is understanding quotas and restrictions.
The documentation in the script doesn’t clarify what a quota and restriction actually does:

 Dungeonify:SetQuota(dictionary Quota?)
													
 Establishes a quota for the generator to follow.
		      Can be empty or nil.
															
	        	-----------------------
															
Dungeonify:ImposeRestriction(dictionary Restrictions?)
											
   Imposes restrictions for the generator to follow.
			  Can be empty or nil.

Although you say this is true in a reply:

But this is my code:

Dungeonify:ImposeRestriction({
	Start = 0,
	Corridor = 5,
	TJunk = 4,
})
Dungeonify:SetQuota({
	Corridor = 1,
	TJunk = 1
})
Dungeonify:Generate({
	minpieces = 4,
	maxpieces = 15,
	startpiece = 'Start',
})

I don’t actually know what setting something to 0 even does but that’s what you did for the start item so i just did it. Though i’m assuming it means the start and end thingies aren’t included in the total, so setting them to 0 means there wont me more start/end pieces apart from the actual start and end.

Anyway, I get an error:
image

if (RestrictionCount > 0 and QuotaCount > 0 and RestrictionCount > QuotaCount) then
		error(string.format("Impossible restriction given: [%s | %s] (restriction-quota)", RestrictionCount, QuotaCount))
	end

Does this not explicitly tell it to error if the total maximum is greater than the total minimum? What? I’m so confused… But doing it the other way round also errors…

Trying to ‘fix’ it makes it constantly recalculate even though some iterations clearly meet the specifications. It works first try if i only have either a tjunk quota or corridor quota, and both usually generate at least one of the other anyway. But applying a quota to both causes infinite recalculation.

I know I’m using values smaller that I’d really use, just for testing, but this probably still shouldn’t happen. I’ve probably just misunderstood something.

Ah. It seems as if I wasn’t very smart when I wrote this. Let’s look here:

	local RestrictionCount, QuotaCount = 0, 0;
	for i, v in pairs(self.Restrictions) do
		RestrictionCount = RestrictionCount + (tonumber(v) or 0)
	end

I don’t know if you know, but that doesn’t look like it individually checks every restriction.
As for your “infinite loading,” go marginally bigger or go home.

Updated through GitHub, about to leave so I entrust the erroring to you guys :wink:. Package update comes when I get home.

Got this working again for a project, but is there a way to make it so to limit what pieces can connect to what, getting a ton of ramps connected, which looks very weird

It’s sad that this module no longer works properly on the server side, I’d love to create a successor, but it might be too big of a task.

if you managed a way to add that function lmk cause im having the same issue

How would I make it so a specific room only generates once

Did you figure out how to make it so a specific room only generates once

Is there a way to limit the area that it builds in? like for instance keeping it within 500 studs of the origin location to reduce the amount of sprawling that it tends to do

2 Likes