[WIP] Randomly Generated Dungeon! [Revived]
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.
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.
[WIP] Randomly Generated Dungeon! [Revived]
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.
- qwerqsar
- Posts: 236
- Joined: Sat Jun 02, 2007 10:06 am
- Location: The beautiful Anahuac (A mexican kind of Midgard)
- Contact:
Re: [WIP] Randomly Generated Dungeon!
Nice to see the first result !
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!
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!
Re: [WIP] Randomly Generated Dungeon!
A Diablo themed Doom wad would be possible perhaps?
- Cutmanmike
- Posts: 11347
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Re: [WIP] Randomly Generated Dungeon!
Groovy. I look forward to a project that actually uses this. Maybe an endless multiplayer survival adventure?
Re: [WIP] Randomly Generated Dungeon!
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
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
- Chex Warrior
- Posts: 3
- Joined: Tue Apr 13, 2010 8:59 am
Re: [WIP] Randomly Generated Dungeon!
This is a great idea, good luck.
- 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
- Contact:
Re: [WIP] Randomly Generated Dungeon!
Very WIPy, as it definitely needs variety in it.
The first level generated had no exit.
The first level generated had no exit.
Re: [WIP] Randomly Generated Dungeon!
I know. It's not even building the dungeon properly yet. :P
Re: [WIP] Randomly Generated Dungeon!
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...
http://doryen.eptalys.net/articles/bsp- ... eneration/
I might try this...
- qwerqsar
- Posts: 236
- Joined: Sat Jun 02, 2007 10:06 am
- Location: The beautiful Anahuac (A mexican kind of Midgard)
- Contact:
Re: [WIP] Randomly Generated Dungeon!
You're kidding, right?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.
I like how it is going, plus it would look cool with some typical fantasy monsters roaming
Great idea!
Re: [WIP] Randomly Generated Dungeon!
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.
So it's back to my idea for now. :P
I spent the last 5 hours fixing DigCorridor(). I'm so tired.
- 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
- Contact:
Re: [WIP] Randomly Generated Dungeon!
Oh pfuh. You're an unsung genius. Wait, you do sing... Nevermind.Nash wrote:... my poor unintelligent brain ...
Personally I'm impressed with how "lite" the code is! I bet the map itself is an absolute hulk though.
... "HULK MAP!"
Re: [WIP] Randomly Generated Dungeon!
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.
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.
- 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
- Contact:
Re: [WIP] Randomly Generated Dungeon!
Of course, they'd have to be run beforehand by an external program, then loaded up into ZDoom.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.
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?)
Re: [WIP] Randomly Generated Dungeon!
@ NeuralStunner:
You mean something works like Block of Doom 2 editor?
You mean something works like Block of Doom 2 editor?