Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
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 6341 times)
0 Members and 1 Guest are viewing this topic.
Offline kevglass

JGO Kernel


Medals: 153
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2010-11-08 15:53:16 »

Some dungeon generation code that generates some reasonably ok dungeons as a starting point:

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

Some discussion and extensions:

http://www.cokeandcode.com/node/1444
http://www.cokeandcode.com/node/1446
http://www.cokeandcode.com/node/1447



Kev

Offline SimonH
« Reply #1 - Posted 2010-11-08 17:19:09 »

Oo! Pretty! This Dungeon thingy's starting to look good! When's alpha?  Wink

People make games and games make people
Offline ShannonSmith
« Reply #2 - Posted 2010-11-08 20:24:01 »

Looks good, but one downside to this approach is you end up with a lot of large voids that may make players assume there is a hidden room somewhere. Also for this reason it won't work to well for generating building type layouts.

I think a better approach (although more difficult) might be to start with an open space and start adding walls randomly. It also might be worth playing few a few levels of Diablo, I remember the procedural dungeons it generated were always pretty good.


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

JGO Kernel


Medals: 153
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #3 - Posted 2010-11-08 23:37:48 »

I've written maze type generators where you carve out from a bigger area, but in general I like the idea the player doesn't predict where places are based on knowing the area is fully carved out.

Not saying this is the only way, just example code in case it's useful anywhere.

Kev

Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #4 - Posted 2010-11-10 09:57:16 »

Looking good kev - and surprisingly similar to how I generate dungeons for Albion.

I'm interested in how you're going to solve the door problem, and how you deal with character's being 'behind' walls. I'm still not entirely sure I've take the best approach in Albion, but I've redone it three times already and it works well enough for now.

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

JGO Kernel


Medals: 153
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #5 - Posted 2010-11-10 10:45:25 »

Whats the door problem?

Behind walls - I'm actually expecting to pad all the rooms by one tile round the edge, so probably no concept of behind walls. Bear in mind I'm intending to use warcraft 2 sprites so not quite the same angles as the rpgmaker stuff you've got.

Kev

Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #6 - Posted 2010-11-10 11:02:22 »

Ah, those sprites are much closer to a top down angle aren't they? I did do the padding thing at one point but it felt weird as doorways would then become short corridors.

I had a whole heap of other problems with doors - the main one being that they'd be visually lost and hard to see in tall walls that ran vertically (here: http://www.triangularpixels.com/Albion/Images/v0.1/Combat.png is one where I've made the walls half height to try and make them visible, but it just looks weird in other ways so I ditched that).

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

JGO Kernel


Medals: 153
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #7 - Posted 2010-11-10 11:26:10 »

I'm not just there yet, thought door rendering is next on the list (this lunchtime?) Smiley

Any good resources for door sprites though?

Kev

Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #8 - Posted 2010-11-10 11:52:49 »

Afraid not - I cobbled mine together by splicing bits of wood plank sprites together. Grin

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

JGO Kernel


Medals: 153
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #9 - Posted 2010-11-10 15:18:00 »

First hack at rendering it:



Took your approach, Doors are a rescale mash-up of a window shutter.

Path finding and some lighting next I think.

Kev

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 #10 - Posted 2010-11-10 15:38:18 »

Are you deliberately always having double doors for vertical walls? How does it look for single doors?

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

JGO Kernel


Medals: 153
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #11 - Posted 2010-11-10 15:44:05 »

Actually, those are single doors Smiley Art skills++

Kev

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 76
Projects: 15


★★★★★


« Reply #12 - Posted 2010-11-10 15:47:49 »

oh nice, must say that it already looking really nice and from what I've seen of the new slick lighting stuff + the above screenshot, this is gonna be pretty awesome, can't wait for playable version Smiley
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #13 - Posted 2010-11-10 16:03:06 »

Oh, you've shortened the walls so it's visible. I found that looked a bit weird for me when I had characters standing next to it, but you might not have that problem.

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

JGO Kernel


Medals: 153
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #14 - Posted 2010-11-10 16:23:07 »

Shortened them up a bit now and they do look nicer. Have to work out character rendering I guess.

Kev

Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #15 - Posted 2010-11-10 18:19:01 »

Looks good, but one downside to this approach is you end up with a lot of large voids that may make players assume there is a hidden room somewhere. Also for this reason it won't work to well for generating building type layouts.

I think a better approach (although more difficult) might be to start with an open space and start adding walls randomly. It also might be worth playing few a few levels of Diablo, I remember the procedural dungeons it generated were always pretty good.



This is what I did in Sinuosity, which is a maze generator that allows each space to be accessed by only one path. I tweaked the algorithm in certain tests to do some 2-lane corridors and the like, but what usually felt the best was to just open up random spaces in the level. You then have this interestingly laid out dungeon that's very mazelike but also filled with rooms, and one path to a point turns to many. What's much more difficult is randomly blocking off areas - because doing so can inadvertently cause something to be totally inaccessible. I toyed around with that part of it for a bit but never got it working well enough.

See my work:
OTC Software
Offline kevglass

JGO Kernel


Medals: 153
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #16 - Posted 2010-11-28 23:26:47 »

Seems to be working out ok visually:



Kev

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.

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

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

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

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

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

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

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
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!