[WIP] Randomly Generated Dungeon! [Revived]

For in-development or completed ZDoom projects
Forum rules
Got a cool project idea but nothing else? This forum is NOT for you! Put it in this thread instead!
Please read the full rules for more details.

[WIP] Randomly Generated Dungeon! [Revived]

Postby Nash » Mon Apr 12, 2010 4:15 pm

Image


Latest version: LINK UNAVAILABLE


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 Sat May 17, 2014 12:50 pm, edited 9 times in total.
User avatar
Nash
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: [WIP] Randomly Generated Dungeon!

Postby qwerqsar » Mon Apr 12, 2010 10:39 pm

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!
User avatar
qwerqsar
istor
 
Joined: 02 Jun 2007
Location: The beautiful Anahuac (A mexican kind of Midgard)

Re: [WIP] Randomly Generated Dungeon!

Postby Jinal » Tue Apr 13, 2010 12:35 am

A Diablo themed Doom wad would be possible perhaps?
Jinal
Banned User
 
Joined: 06 Apr 2008

Re: [WIP] Randomly Generated Dungeon!

Postby Cutmanmike » Tue Apr 13, 2010 4:26 am

Groovy. I look forward to a project that actually uses this. Maybe an endless multiplayer survival adventure? :P
User avatar
Cutmanmike
Not dead
 
Joined: 06 Oct 2003
Location: United Kingdom

Re: [WIP] Randomly Generated Dungeon!

Postby Nash » Tue Apr 13, 2010 4:39 am

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
Nash
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: [WIP] Randomly Generated Dungeon!

Postby Chex Warrior » Tue Apr 13, 2010 10:03 am

This is a great idea, good luck.
User avatar
Chex Warrior
 
Joined: 13 Apr 2010

Re: [WIP] Randomly Generated Dungeon!

Postby Mr. Chris » Tue Apr 13, 2010 10:20 am

Very WIPy, as it definitely needs variety in it.

The first level generated had no exit.
User avatar
Mr. Chris
Ask me about Oblige
 
Joined: 13 Mar 2009
Location: Suffolk County, NYS

Re: [WIP] Randomly Generated Dungeon!

Postby Nash » Tue Apr 13, 2010 10:26 am

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

Re: [WIP] Randomly Generated Dungeon!

Postby Nash » Tue Apr 13, 2010 11:24 am

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
Nash
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: [WIP] Randomly Generated Dungeon!

Postby qwerqsar » Tue Apr 13, 2010 7:48 pm

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
qwerqsar
istor
 
Joined: 02 Jun 2007
Location: The beautiful Anahuac (A mexican kind of Midgard)

Re: [WIP] Randomly Generated Dungeon!

Postby Nash » Tue Apr 13, 2010 8:07 pm

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
Nash
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: [WIP] Randomly Generated Dungeon!

Postby NeuralStunner » Tue Apr 13, 2010 8:07 pm

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
NeuralStunner
O'Neill with it.
 
Joined: 21 Jul 2009
Location: Secret Magnet Testing Facility

Re: [WIP] Randomly Generated Dungeon!

Postby Nash » Tue Apr 13, 2010 8:12 pm

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
Nash
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: [WIP] Randomly Generated Dungeon!

Postby NeuralStunner » Tue Apr 13, 2010 8:44 pm

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?)
User avatar
NeuralStunner
O'Neill with it.
 
Joined: 21 Jul 2009
Location: Secret Magnet Testing Facility

Re: [WIP] Randomly Generated Dungeon!

Postby carlcyber » Tue Apr 13, 2010 8:52 pm

@ NeuralStunner:
You mean something works like Block of Doom 2 editor?
carlcyber
 
Joined: 27 Jan 2005

Next

Return to Projects

Who is online

Users browsing this forum: Kyle873, TheDarkArchon, twinkieman93, XutaWoo and 22 guests