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

Started by
12 comments, last by Shannon Barber 8 years, 3 months ago

Different algorithms do different things. Maze level segments or organic level segments, they originate from different algorithms. Any level that is made by just a simple algorithm will look like it was made by a simple algorithm. The algorithm has one pattern.

You need to stack and mix different stuff. One way is to use a brush and brush a level using different algorithms.

If you want part of your dungeon to look a certain way, you can figure out what kind of simple algorithm may create stuff that looks like that.

Big problem for me was to get the algorithm to generate something that would fit my criteria, especially all parts of the level being accessible and making unaccessible parts accessible.

If something is missing, but you can't figure out what it is, there is no way to solve that until you do.

Advertisement

Here's a graph based approach that usually forces the player to explore most of your randomly created dungeon, which is the equivalent of "fun" right? :)

http://www.roguebasin.com/index.php?title=Creating_Measurably_%22Fun%22_Maps

I guess one way to do it is to fill a list with all the possible things that could be generated. This may be easy or difficult depending on how many items you have and/or if there are any restrictions. You may want this list to be generated in a random order each time as well to add randomness. Then just use a RNG to crank out a number from 1(or 0) - # of items in the list to correspond with its index. It then creates whichever one the RNG chooses, and in the item class itself it can have rules that regulate how the item should fill the room. (For example, if it is a table or desk it should be placed in the room randomly, but against a wall). I don't know if this is necessarily the best method, but it is something I would do lol, then again I haven't given this solution to much thought.

Just a suggestion - make the templates *smaller* than a room.

Have two layers of "templates" - classify the room and then have things that can be in that type of room.

Some things are guaranteed and others have a probability of appearing.

e.g. If 'Bedroom' is a type then a bed and a dresser is guaranteed but there might be two beds, multiple dressers, a TV, etc..

e.g. If the bedroom is lager than 200sqft then new stuff can be in it like a private bathroom.

- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

This topic is closed to new replies.

Advertisement