Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (685)
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 2d array  (Read 3745 times)
0 Members and 1 Guest are viewing this topic.
Offline lordberzerker97

Senior Newbie

« Posted 2012-01-13 03:59:16 »

 Hello guys. I need help with my game again. I am currently trying to figure out how to create randomized dungeons. I currently know how to tile map games and what I really want to know is how to create dungeons. Please give me some steps on how to do it. Or some code will be nice.
Offline sproingie

JGO Kernel

Medals: 202

« Reply #1 - Posted 2012-01-13 05:09:04 »

What have you looked at so far?  Because there are a whole *lot* of resources out there that I can find if I simply google the first two words of your post.  It's easier to help if there's a starting point, i.e. some actual code you've started to write or an algorithm you're interested in.
Offline lordberzerker97

Senior Newbie

« Reply #2 - Posted 2012-01-13 05:17:56 »

 Well I don't have an actual code for random dungeon generation. Usually when searching through google i see most dungeons using BSP trees. The one thing I am really wondering is if BSP trees are compatible with 2D arrays...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ra4king

JGO Kernel

Medals: 409
Projects: 3
Exp: 5 years

I'm the King!

« Reply #3 - Posted 2012-01-13 05:27:35 »

Why don't you try it? Wink

Offline tackman

Senior Newbie

« Reply #4 - Posted 2012-01-13 10:40:48 »

What have you looked at so far?  Because there are a whole *lot* of resources out there that I can find if I simply google the first two words of your post.

Yeah, "hello guys" returns 152 000 000 results!

But seriously;
Why don't you try it? Wink

If you hit walls with trying that BSP tree method then ask, maybe we can be of further help. (Well, others, I'm not really smart when it comes to random dungeons.)
Offline kevglass

« JGO Spiffy Duke »

Medals: 272
Projects: 25
Exp: 18 years

Coder, Trainee Pixel Artist, Game Reviewer

« Reply #5 - Posted 2012-01-13 10:44:21 »

Here's some stuff i wrote up about dungeon generation:

And some source code:

Anywhere you get a 404 just change to



Offline evilfrenchguy

Junior Devvie

Medals: 3

« Reply #6 - Posted 2012-02-03 21:35:43 »

If I were to do it, I'd generate a random number between x and y equal to the number of "rooms" initially to fit in the array. Then I'd loop through for each room and pick a random size (maybe in tile units), accounting for the number of rooms I have to fit. At that point it's up to you to generate each room based on your game.

Or, as another option, you could have a 2d DungeonRoom array. Before you generate each specific room, place them in the array first (randomly of course ^_^), so that when a room is being generated it knows that there might need to be doors placed on a particular wall.
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Dwinin (60 views)
2015-11-07 13:29:08

Rems19 (73 views)
2015-10-31 01:36:56

Rems19 (65 views)
2015-10-31 01:32:37

williamwoles (102 views)
2015-10-23 10:42:59

williamwoles (89 views)
2015-10-23 10:42:45

Jervac_ (102 views)
2015-10-18 23:29:12

DarkCart (130 views)
2015-10-16 00:58:11

KaiHH (112 views)
2015-10-11 14:10:14

KaiHH (151 views)
2015-10-11 13:26:18

BurntPizza (164 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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‑
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!