Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (405)
games submitted by our members
Games in WIP (289)
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 5086 times)
0 Members and 1 Guest are viewing this topic.
Offline kevglass
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Posted 2010-11-08 16: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 18:19:09 »

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

Heroes' Keep is in development.
Meanwhile try Bloodridge
Offline ShannonSmith
« Reply #2 - Posted 2010-11-08 21: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!
Play the free demo of Revenge of the Titans!
Offline kevglass
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #3 - Posted 2010-11-09 00: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: 48
Projects: 11


Monkey for a head


« Reply #4 - Posted 2010-11-10 10: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
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #5 - Posted 2010-11-10 11: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: 48
Projects: 11


Monkey for a head


« Reply #6 - Posted 2010-11-10 12: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
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #7 - Posted 2010-11-10 12: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: 48
Projects: 11


Monkey for a head


« Reply #8 - Posted 2010-11-10 12: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
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #9 - Posted 2010-11-10 16: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!
Try the Free Demo of Revenge of the Titans
Offline Orangy Tang

JGO Kernel


Medals: 48
Projects: 11


Monkey for a head


« Reply #10 - Posted 2010-11-10 16: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
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


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

Actually, those are single doors Smiley Art skills++

Kev

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 50
Projects: 15


★★★★★


« Reply #12 - Posted 2010-11-10 16: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: 48
Projects: 11


Monkey for a head


« Reply #13 - Posted 2010-11-10 17: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
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #14 - Posted 2010-11-10 17: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
« League of Dukes »

JGO Kernel


Medals: 39
Projects: 12


Game Engineer


« Reply #15 - Posted 2010-11-10 19: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
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #16 - Posted 2010-11-29 00: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.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (59 views)
2013-05-17 21:29:12

alaslipknot (68 views)
2013-05-16 21:24:48

gouessej (98 views)
2013-05-16 00:53:38

gouessej (95 views)
2013-05-16 00:17:58

theagentd (106 views)
2013-05-15 15:01:13

theagentd (97 views)
2013-05-15 15:00:54

StreetDoggy (143 views)
2013-05-14 15:56:26

kutucuk (165 views)
2013-05-12 17:10:36

kutucuk (164 views)
2013-05-12 15:36:09

UnluckyDevil (174 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.09 seconds with 21 queries.