Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (492)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Dungeon Generation  (Read 2660 times)
0 Members and 1 Guest are viewing this topic.
Offline iCiNGG

Junior Newbie





« Posted 2011-11-25 19:09:21 »

Hey guys! I'm making a top-down RPG-ish like game and I wanted to add randomly generated dungeons. I've generated a maze randomly before but I don't want for all the rooms of the dungeon to be the same size. Basically, what I'm wondering is how to go about generating the dungeon. My previous attempts were all disastrous. So any help or related algorithms would be very much appreciated, thanks!
Offline pitbuller
« Reply #1 - Posted 2011-11-25 21:12:10 »

This might help you.
http://thegreystudios.com/blog/?p=146
Offline iCiNGG

Junior Newbie





« Reply #2 - Posted 2011-11-25 21:48:09 »


Oh, that looks interesting. I haven't learned BSP Trees yet so I'll go look into more. Thanks!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #3 - Posted 2011-11-25 22:39:13 »

http://roguelikedeveloper.blogspot.com/2007/11/unangband-dungeon-generation-part-one.html

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline bach

Senior Member


Medals: 3
Projects: 2



« Reply #4 - Posted 2011-11-26 08:26:58 »


Oh, that looks interesting. I haven't learned BSP Trees yet so I'll go look into more. Thanks!

Hey,

I wrote this article. Feel free to get in touch if you have any questions.. More than happy to help out.

Cheers,
Bach
Offline iCiNGG

Junior Newbie





« Reply #5 - Posted 2011-11-26 16:34:29 »

Hey,

I wrote this article. Feel free to get in touch if you have any questions.. More than happy to help out.

Cheers,
Bach

Oh wow, that sounds good. I'll get in touch if I run into any walls. Though that might be a while since I'm still learning more about trees, still somewhat of a beginner at computer science in general.


Thanks! I've implemented the basics of it but the dungeon it makes are pretty ugly, at the moment. I'll have to work on fixing it up.
Offline ra4king

JGO Kernel


Medals: 345
Projects: 3
Exp: 5 years


I'm the King!


« Reply #6 - Posted 2011-11-26 21:29:40 »

....if I run into any walls.
Bahahahahahahaha nice unintentional pun Grin

Offline gbeebe

Senior Member


Medals: 5
Projects: 1



« Reply #7 - Posted 2011-11-27 02:10:08 »


LOLZ!!!
Offline iCiNGG

Junior Newbie





« Reply #8 - Posted 2011-12-14 23:50:10 »

Sorry I haven't been able to get back to you guys, but I've been pretty busy with finals and tennis.
I only recently got some time to work on the dungeon generation and was able to get decently randomized rooms, but I'm wondering what the best way to connect the rooms is, because my last attempt resulted in some bad looking dungeons.
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #9 - Posted 2011-12-15 01:05:44 »

http://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap documents 11 different algorithms you could use.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline iCiNGG

Junior Newbie





« Reply #10 - Posted 2011-12-15 01:27:52 »

http://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap documents 11 different algorithms you could use.
Wouldn't that require rooms to be all the same size?
There might way that I might be able to adapt it to random room sizes though, not sure if it would actually work.
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #11 - Posted 2011-12-15 12:36:20 »

What I was thinking was that you could use the recursive back tracer, since it creates a maze that everywhere in the maze is accessible from everywhere else. Then randomly carve out random sized rooms from the maze.

Offline bach

Senior Member


Medals: 3
Projects: 2



« Reply #12 - Posted 2011-12-16 00:57:22 »

Sorry I haven't been able to get back to you guys, but I've been pretty busy with finals and tennis.
I only recently got some time to work on the dungeon generation and was able to get decently randomized rooms, but I'm wondering what the best way to connect the rooms is, because my last attempt resulted in some bad looking dungeons.

Hey,

the way I do it (as described in the above linked article) is to create a bsp tree. Once the tree reaches the desired depth (== room size) you just traverse back up the tree and connect neighbouring nodes.

The actual connecting can be very simple: Find centre of node A, decide which direction node B is (N, E, S, W) and create a straight line to the room until you reach an empty tile in node B.

You can obviously do this a lot more complex if desired by using a pathfinding algorithm. However, I'd try the easiest first and see how you go Smiley

Cheers,
Bach
Offline iCiNGG

Junior Newbie





« Reply #13 - Posted 2011-12-16 22:19:57 »

Sorry I haven't been able to get back to you guys, but I've been pretty busy with finals and tennis.
I only recently got some time to work on the dungeon generation and was able to get decently randomized rooms, but I'm wondering what the best way to connect the rooms is, because my last attempt resulted in some bad looking dungeons.

Hey,

the way I do it (as described in the above linked article) is to create a bsp tree. Once the tree reaches the desired depth (== room size) you just traverse back up the tree and connect neighbouring nodes.

The actual connecting can be very simple: Find centre of node A, decide which direction node B is (N, E, S, W) and create a straight line to the room until you reach an empty tile in node B.

You can obviously do this a lot more complex if desired by using a pathfinding algorithm. However, I'd try the easiest first and see how you go Smiley

Cheers,
Bach

Alright, I'll give it a shot. Are you using 2d arrays to hold the tile type and just changing the value when you connect them?

Offline bach

Senior Member


Medals: 3
Projects: 2



« Reply #14 - Posted 2011-12-17 22:46:59 »

Alright, I'll give it a shot. Are you using 2d arrays to hold the tile type and just changing the value when you connect them?

Yup, at dungeon generation time I just keep a 2d integer array. Once the dungeon is generated I use more complex types to keep track the individual tiles.

Let me know if you run into any problems, happy to help Smiley

Cheers,
Bach
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (33 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (40 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!