Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
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 2587 times)
0 Members and 1 Guest are viewing this topic.
Offline lordberzerker97

Senior Newbie





« Posted 2012-01-13 04: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
« Reply #1 - Posted 2012-01-13 06: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 06: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: 322
Projects: 2
Exp: 4 years


I'm the King!


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

Why don't you try it? Wink

Offline tackman

Senior Newbie





« Reply #4 - Posted 2012-01-13 11: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 Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


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

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

http://old.cokeandcode.com/node/1363
http://old.cokeandcode.com/node/1444

And some source code:

http://old.cokeandcode.com/node/1445

Anywhere you get a 404 just change www.cokeandcode.com to old.cokeandcode.com

Cheers,

Kev

Offline evilfrenchguy

Junior Member


Medals: 3



« Reply #6 - Posted 2012-02-03 22: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.

 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (63 views)
2014-04-15 18:08:23

BurntPizza (61 views)
2014-04-15 03:46:01

UprightPath (74 views)
2014-04-14 17:39:50

UprightPath (57 views)
2014-04-14 17:35:47

Porlus (74 views)
2014-04-14 15:48:38

tom_mai78101 (100 views)
2014-04-10 04:04:31

BurntPizza (160 views)
2014-04-08 23:06:04

tom_mai78101 (255 views)
2014-04-05 13:34:39

trollwarrior1 (208 views)
2014-04-04 12:06:45

CJLetsGame (215 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!