[WIP] Randomly Generated Dungeon! [Revived]

For Total Conversions and projects that don't otherwise fall under the other categories.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
Nash
 
 
Posts: 17455
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

[WIP] Randomly Generated Dungeon! [Revived]

Post by Nash »

Image

Original post from 2010:

A few days ago, I rediscovered the old game Dungeon Hack and suddenly had the urge to attempt to create a random dungeon generator in ZDoom.

This is an experimental, work-in-progress random dungeon generator system for GZDoom. It will always be WIP as I am constantly adding and adding stuff onto it.

At this point, I can't say if it'll be a proper, full game - I'm just having fun experimenting with this. It might turn into a first-person Roguelike, maybe even a full-scale RPG like Diablo. Who knows?

Features:

Dungeon is randomly generated everytime you start the map.
Fully-working MODELDEF doors.
Random monster placement.

Planned features:

Improvements to the dungeon generating algorithm
Room prefabs (randomly places prefabbed rooms)
Decoration
Items
Locked doors, requiring keys that are randomly spawned
Starts and exits

Stay tuned...
Last edited by Nash on Thu Oct 13, 2016 2:26 am, edited 14 times in total.
User avatar
qwerqsar
Posts: 236
Joined: Sat Jun 02, 2007 10:06 am
Location: The beautiful Anahuac (A mexican kind of Midgard)

Re: [WIP] Randomly Generated Dungeon!

Post by qwerqsar »

Nice to see the first result :D !
The map it creates look often good, although I don't know why I spawned 3 of 3 times on the outside of the dungeon... Guess it's real bad luck!
Jinal
Posts: 317
Joined: Sun Apr 06, 2008 2:51 pm

Re: [WIP] Randomly Generated Dungeon!

Post by Jinal »

A Diablo themed Doom wad would be possible perhaps?
User avatar
Cutmanmike
Posts: 11347
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom

Re: [WIP] Randomly Generated Dungeon!

Post by Cutmanmike »

Groovy. I look forward to a project that actually uses this. Maybe an endless multiplayer survival adventure? :P
User avatar
Nash
 
 
Posts: 17455
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: [WIP] Randomly Generated Dungeon!

Post by Nash »

Yeah it could possibly have Diablo-like gameplay.

Anyway, after a quality night's sleep, I looked over again at the code and saw how crappy it was. I have a clearer mind now so I'm gonna rewrite it a bit...

What I tried to do last nite was basically:

1) Build first room
2) Pick random wall
3) Build random length corridor in that direction
4) Place a room at the end of the corridor and randomly offset it a bit
5) Repeat step 2 ROOM_LIMIT times

It generates a bunch of mess. :P

I went ahead and totally rewrote DigCorridor() so it actually works correctly now. I'm also scrapping the idea above and will probably go for my original approach:

1) Build ROOM_LIMIT amount of rooms randomly (random position and dimensions)
2) Step through each and every created room in the list - for each room, pick random wall
3) Dig corridor of random length in that direction
4) Once corridor has reached the end, pick another random direction and length, and dig again (must not go back in previous direction)
5) Repeat step 4 until corridor digger collides with open space (should I check if the open space is a room, or should I let it not care whether it collides with a room or corridor?)
6) Go back to step 2 and repeat until all rooms in the list has been gone though

Once I have that working, I'll start working on doors. I think I have an idea on how to actually implement it but I'm trying not to overload my poor unintelligent brain too much right now. :P
User avatar
Chex Warrior
Posts: 3
Joined: Tue Apr 13, 2010 8:59 am

Re: [WIP] Randomly Generated Dungeon!

Post by Chex Warrior »

This is a great idea, good luck.
User avatar
Armaetus
Posts: 1256
Joined: Fri Mar 13, 2009 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10 Home
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: New York State

Re: [WIP] Randomly Generated Dungeon!

Post by Armaetus »

Very WIPy, as it definitely needs variety in it.

The first level generated had no exit.
User avatar
Nash
 
 
Posts: 17455
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: [WIP] Randomly Generated Dungeon!

Post by Nash »

I know. It's not even building the dungeon properly yet. :P
User avatar
Nash
 
 
Posts: 17455
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: [WIP] Randomly Generated Dungeon!

Post by Nash »

Found an interesting article on using BSP trees to subdivide and build the dungeon:

http://doryen.eptalys.net/articles/bsp- ... eneration/

I might try this...
User avatar
qwerqsar
Posts: 236
Joined: Sat Jun 02, 2007 10:06 am
Location: The beautiful Anahuac (A mexican kind of Midgard)

Re: [WIP] Randomly Generated Dungeon!

Post by qwerqsar »

Nash wrote:I think I have an idea on how to actually implement it but I'm trying not to overload my poor unintelligent brain too much right now. :P
You're kidding, right?
I like how it is going, plus it would look cool with some typical fantasy monsters roaming :D
Great idea!
User avatar
Nash
 
 
Posts: 17455
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: [WIP] Randomly Generated Dungeon!

Post by Nash »

The BSP technique looks cool but IMO the dungeons look too organized and orderly... it's not random enough for my tastes.

So it's back to my idea for now. :P

I spent the last 5 hours fixing DigCorridor(). I'm so tired.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space

Re: [WIP] Randomly Generated Dungeon!

Post by NeuralStunner »

Nash wrote:... my poor unintelligent brain ...
Oh pfuh. You're an unsung genius. Wait, you do sing... Nevermind. ;)

Personally I'm impressed with how "lite" the code is! I bet the map itself is an absolute hulk though.

... "HULK MAP!" :P
User avatar
Nash
 
 
Posts: 17455
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: [WIP] Randomly Generated Dungeon!

Post by Nash »

Well if there was some way to generate UDMF maps through scripting (if anyone remembers a thread I created a while back - this was exactly the reason) then preparing the map could be totally easy.

I almost settled for WadC but I couldn't bothere figuring out the runtimes it needed, plus it didn't do UDMF.

In the end, I just created the sectors in DB2 manually. It's not that difficult: Create first sector, sequentially paste copies to the right until I reach DUNGEON_WIDTH copies (the selection box in DB2 is handy as it copies and pastes sectors in the correct order). Then repeat vertically for DUNGEON_HEIGHT copies.

Generating sector tags for all the sectors was made easy by a QBasic program LilWhiteMouse wrote.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space

Re: [WIP] Randomly Generated Dungeon!

Post by NeuralStunner »

Nash wrote:Well if there was some way to generate UDMF maps through scripting (if anyone remembers a thread I created a while back - this was exactly the reason) then preparing the map could be totally easy.
Of course, they'd have to be run beforehand by an external program, then loaded up into ZDoom.

If you wanted to be weird, you could generate an ACS script to do the stuff sector-by-sector, then call ACC on it and pack it up. (Is there a good command-line based wad packer?)
carlcyber
Posts: 163
Joined: Thu Jan 27, 2005 1:04 am

Re: [WIP] Randomly Generated Dungeon!

Post by carlcyber »

@ NeuralStunner:
You mean something works like Block of Doom 2 editor?

Return to “TCs, Full Games, and Other Projects”