# Simple organic and brute force dungeon generation

3377 views

Subscribe to our subreddit to get all the updates from the team!

Last month, I made a pretty simple dungeon generator algorithm. It's an organic brute force algorithm, in the sense that the rooms and corridors aren't carved into a grid and that it stops when an area doesn't fit in the graph.

Here's the algorithm :

1. Start from the center (0, 0) in 2D
2. Generate a room
3. Choose a side to extend to
4. Attach a corridor to that side
5. If it doesn't fit, stop the generation
6. Attach a room at the end of the corridor
7. If it doesn't fit, stop the generation
8. Repeat from steps 3 to 7 until enough rooms are generated

It allowed us to test out our pathfinding algorithm (A* & String pulling).

Here are some pictures of the output in 2D and 3D :

Very cool!

Looks pretty effective!

Any plans to add branching or loops?

Posted (edited)

Looks pretty effective!

Any plans to add branching or loops?

Thanks!

We'll brainstorm on that in before the end of May I think. We have many ideas and libraries / algorithms we could use. For exemple, Paul Speed from the jMonkey Engine forum did the same thing as I but more complex. See https://hub.jmonkeyengine.org/t/april-2018-monthly-wip-screenshot-thread/40292.

We could also use Noise4J to generate a noise based dungeon.

There are so many algorithms and ways of doing it that it's bound to be incremental and evolve over time.

Edited by thecheeselover

On 4/26/2018 at 6:19 PM, thecheeselover said:

Thanks!

We'll brainstorm on that in before the end of May I think. We have many ideas and libraries / algorithms we could use. For exemple, Paul Speed from the jMonkey Engine forum did the same thing as I but more complex. See https://hub.jmonkeyengine.org/t/april-2018-monthly-wip-screenshot-thread/40292.

We could also use Noise4J to generate a noise based dungeon.

There are so many algorithms and ways of doing it that it's bound to be incremental and evolve over time.

Wow! It's cool. I'm going to need this later but I want to get the terrain fully function first.

## Create an account

Register a new account

• ### Similar Content

• Hiya! i'm Jason, And i want to reach everyone here who's excited about making games! And as the Title says, I'm looking for either GMS2 Programmers Or Godot Programmers.
I want to invite you to my Game Creation Of Imagistory, A Beautiful 2D RPG game with Plot twists, Corky Characters and an amazing story.
Here is some spoliers:
Long ago, A mystical Comet Flew throughout the universe.
Legends say that one day this comet will create a brand-new galaxy.
A little scientist named Brown tried to fly to space to see the comet in action.
His Friends, the Wizards, went with him to see the explosion.
Until…
A Vortex Pulled them into a strange portal. They all scattered in different locations.
What will Brown Do?

And Here is Some Art:
I'm Ciao Gelato #7986 on discord and my email is is imagistory2500@gmail.com, if you want to contact me there.

• I'm looking for a open source PBR rendering engine that I can use.  Basic requirements are Windows (C/C++) and free to use type license.

The first two hits I get on Google are:

Filament

LuxCoreRender
https://luxcorerender.org/

Does anybody have any experience using any of these, or do you recommend something else that's better?
Thanks.
Pluses: Active development, easy to compile, zero dependencies.

• What is the game like
I'm working on a game where the main mechanic is the player creates their own spells. They create spell using a sort of visual programming language
Here is a diagram showing how the spell system would work

The top spell would shoot fire out of the casters hand
The second spell would shoot a projectile in a straight line until it hit something with no other effects
The third spell would shoot a projectile and when it hits, explodes in a fireball
Armed with only their knowledge of magic the player must navigate through caves and dungeons looking for artifacts and spells to allow them to become a master of the magic arts.
What I have so far
I prototype of the spell creation system. The user can draw symbols using an oculus touch controller in the air. The computer recognizes the symbol and the user can then move the symbols around to construct spells.
List of spells I have working at the moment
Fire - does damage, burns wood, and can light torches Wind - pushes objects and puts out torches Levitate - causes the target to become weightless, when used with wind you can push even heavy objects Light - a bright light used to light up dark areas What I need
It would be great to have an artist to work with. I am going ahead doing the artwork on my own but having somebody who could take that too let me focus on the other aspects would be of great help
I would also like if somebody would take on the role of designing levels. I think this game will rely on having many different interesting encounters to force them to come up with clever solutions to problems using their magic. It would be helpful to have somebody to collaborate with for ideas in the category and to focus on trying different levels out to help me focus on the programming.
• By Sneikyz
Hello,
I'm an amateur digital artist looking for a beginner-level project. I'd like to be a part of a team that wants to learn to create games. It might be a simple idle, mini, simulation game or a visual novel.
I'm still a beginner at backgrounds and I usually draw females but I'm willing to learn.
Time invested to the game creation might differ every week mostly because of my work and will be discussed separately.

Here's my DA : https://www.deviantart.com/sneikyz
• By jb-dev
This is a picture of a regular room.
Each rooms has a chance to have props with a certain layout.
If a rock is spawn the player can try to break it by exploding it. These can spawn common collectibles like money and such...
There are many different type of layout possible, including a totally random one.
The generator simply picks a shape, an anchor position and the type of prop to be generated.
The process itself is simply a 2D boolean array. We simply draw on that array like we would in a bitmap using traditional image manipulation algorithms.
Once the array is set, then we simply add a given prop for each true cell of the array
We then finally remove every props that are either outside its room or obstructing an entry/exit point.
Right now, only two types of props can be generated, although the algorithm itself is kinda flexible.
×