Jump to content
  • Advertisement
Sign in to follow this  
FantasyVII

good approach to randomly generate the contents of a dungeon or room

This topic is 1078 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all,

 

So I have been working on a randomly generated dungeon crawler game. I have managed to randomly generate rooms and connect them with each other.

 

The next step is to fill these empty rooms with content like beds, tables, treasure chests, pillars, prison cells, etc... 

I'm just wondering what do you guys think is a good approach to fill a room with these items in a way that a level designer would? I was thinking of using the same approach Diablo 3 did. A level designer would create different templates of a room and the game would pick a random template of that room and place it into the game.

 

I'm just wondering if you guys have any more ideas on how to go about doing this.

 

Thanks happy.png

Share this post


Link to post
Share on other sites
Advertisement

If replayability isn't super important, or it's like Binding of Isaac, where the rooms just have different sizes, making templates for each room should be fine.

 

Filling those rooms is dependent on what the game has. Does the entire game have one theme? (For example, just a bunch of levels that are similarly themes, re-using the same assets, such as those corresponding to a desert) or does it have many? (Different versions of assets for each 'biome' such as desert, underwater, volcano, etc.)

 

You could just make a template for what fills the room as well, which would be easier than making an algorithm to make it completely random, but still functional (Chest surrounded by pillars, chest inside of pillars, chest on area that cannot be reached, etc.)

 

I'd think that game designers would generally keep it consistent (Bed and desk together, for instance) and just vary the places of those objects.

 

I'd say go for making a template for each, then re-assembling it to generate a level. It shouldn't be that hard to create five or so templates for rooms and items each. You can add a few more with each update.

 

Sorry for the late replay. I was in a sleep coma happy.png

 

Well right now how I have the rooms setup is every time you play the game the level generator will generate a random size of a square room then starts to carve corners into the room like so:-

71nM0Mh.jpg

 

So if I were to make a template of a room, I would have to make the room size fixed and then maybe add some empty room with different sizes. Although I think I can make the temple thing work with different room sizes. The thing is, by creating a template the game would generally look more beautiful than just fill the rooms with random things, however the game won't be as random as I want it to be. hmm....

 

Yes, the game does have multiple themes, each level will be different from the previous one.

 

 

 

If it makes sense for your game, you could do relative positioning to handle different size rooms, eg a table at (75%, 0%)

Yeah, I think I had a slimier idea. I'm just trying to see if there is any better approach to this.

 

Thanks you happy.png

Edited by FantasyVII

Share this post


Link to post
Share on other sites

FantasyVII you might want to consider a solution somewhere in-between.  You could make your templates smaller than a room so that a room would be comprised of a random but structured set of templates (4/8/?).  You'll unique levels but you can spend time working your templates and adding details.  It's always going to be something of a trade-off but it's worth considering.  I spent a long time going over this problem for my game and arrived at the decision that rooms made from a set of templates will allow me to be creative and allow for random levels quite nicely.

Edited by Dewar

Share this post


Link to post
Share on other sites

templates and random rooms will be complicated, as each template must be adapted to a random room shape. 

 

probably better to generate items based on room type, and then use a random placement, with a fixup that moves it to an appropriate location, such as next to the closest wall, or something like that. and don't forget about random sets of random items. IE place random tables and random chairs as a single random object set. i think this two level approach may be what's vexing AndreTheGiant with his level generation code. generate random rooms, then generate random levels from the random rooms.

 

i've been DM'ing since 1977, and i started on procedurally generated dungeon design in 1982, so i know a thing or two about designing dungeons <g>.

Share this post


Link to post
Share on other sites

Thank you everyone for your replies. I think i'm going with @Norman Barrows approach. This is the approach I was going to go with when I stared this game but after a year in development I hesitated for whatever reason. I thought to ask the Gamedev forum just to make sure i'm going into the right direction. Anyways, thank you everyone. and thanks for the video link @Khatharr.

 

@TheChubu LOL.

 

happy.png

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!