Advertisement

Would anyone be interest in me posting a blog on how I created this dungeon generator

Started by April 10, 2024 01:03 AM
10 comments, last by reenigne 7 months, 1 week ago

I was wondering if anyone would be interest in how this was done.

Moved to the Lounge. All survey posts go to the Lounge.

-- Tom Sloper -- sloperama.com

Advertisement

reenigne said:
I was wondering if anyone would be interest in how this was done.

You mean, how you made a YouTube video?

-- Tom Sloper -- sloperama.com

@Tom Sloper Nice to meet you Tom.
To answer your question. No.

I was want to know if it would be of interest to anyone how I generated that dungeon of a million plus rooms under a second. There is a link for the skeptics in the video description that leads to a demo they can try themselves feel free to count the rooms. If you think it isn't being generate run it more than one time and you will realize it changes each time.

It isn't done with multi-threading for the actual procedural generation. SDL does I belief implement 2 threads for rendering. That was done on xeon x5670.
My son's ryzen 5500
completed it in 0.46 seconds.

reenigne said:
I was want to know if it would be of interest to anyone how I generated that dungeon of a million plus rooms under a second. There is a link for the skeptics in the video description that leads to a demo they can try themselves feel free to count the rooms.

Looking on the screenshot of the video, i see randomly sized rectangles, each defined within the the cells of a uniform grid using random offest and dimensions. Some rooms have path connecting them to their neighbor, which could be decided using a random number per grid edge.

I do not wonder you can generate an infinite area of this pattern, since that's just what procedural generation algorithms usually do and it's expected.

People on YT may be skeptic because they are impressed from big numbers, and they don't know how simple this is. But this won't apply to most people here. Anyone who has experimented with Perlin or Worley noise already knows how it works.

That's ofc. just my personal answer, maybe many beginners would be interested.

To an extent you are correct.
Generating rooms purely randomly in those in a limited area will certainly help but you still run into potential issues. The first of which is say you create to random rooms 3x3 but at opposite ends of their area. You would have to have something other than a strait path to connect to them. That takes more time to calculate. It means more code to switch between and more cache misses.

7 years ago I did effectively just that it resulted in 40,000 rooms in a second. That's a good start on what is needed.

Using a random number per grid edge would not ensure all rooms are connected. You end up with clusters of rooms connected together and those clusters are isolated from one another.
I use a modified random grid first search back tracking algorithm. For determining paths. But if you try doing a million rooms with the basic algorithm you won't be able to do it in that time frame especially with trying to generate the paths between rooms. I tell what I do to improve that performance in the video.

I can also use the generator in the current state it is to handle multiple levels not just a wide area.
The method also will work to allow in custom areas in the dungeon.

Advertisement

@reenigne

There's a problem with your sig URL.

Brave says: "This site can’t be reached. www.grhmedia.com’s DNS address could not be found. Diagnosing the problem. DNS_PROBE_POSSIBLE"

Edge says: “Hmm. We’re having trouble finding that site. We can’t connect to the server at www.grhmedia.com.”

-- Tom Sloper -- sloperama.com

I'm going to have to rebuild the site had to drop the provider.

reenigne said:
Using a random number per grid edge would not ensure all rooms are connected. You end up with clusters of rooms connected together and those clusters are isolated from one another.

Oh, i did not know you have tackled this problem.
That's actually interesting, and now i would read your tutorial if it's not too long.

But why do you need so many rooms?
It's just too large for a game? And because one place looks like the other, any player would feel lost pretty quickly?

I wanted to create an area large enough people can explore. As I pointed out above the system I am using means I can drop in prefab areas even like an outside terrain so I could have a level like this that eventually leads to another level that is a wide open field maybe with a village or inn or other stuff.

The dungeon parts can be filled with monsters and or stuff like a shop or residence.
It would allow a person to explore. They could go strait down or they could search more on a single level to see what they find that might come in useful later. Basically it allows me to reward people with different play styles.
I can generate from a small level of 256 rooms to levels with more than 16 million rooms. All of them connected.

This topic is closed to new replies.

Advertisement