Skip navigation
My easy 3-step dungeon generation algorithm using Godot Tilemaps:
0:00 / 1:22

My easy 3-step dungeon generation algorithm using Godot Tilemaps:

Sander Vanhove

@SanderVhove4.9K followers

Visit on X
299 likesDownloadOriginal post

17,891 views

My easy 3-step dungeon generation algorithm using Godot Tilemaps: 1️⃣ Spawn random rooms, merge overlapping rooms 2️⃣ Merge rooms with corridors until all are merged 3️⃣ You're done! ✌️ I don't get why people overcomplicate this 😅

30 Comments

Comments from the original post on X (Twitter)

  • Robin | Game dev ᕕ(ᐛ)ᕗ's profile picture

    @niuage

    Maybe they complicate it because they dont want players to have to go through a corridor that's 20 tiles long, when most rooms are like 4 tiles high? :)

    7 likes

  • Sander Vanhove's profile picture

    @SanderVhove

    People like walking simulators, no? 😅

  • Sander Vanhove's profile picture

    @SanderVhove

    And of course everything is configurable to support bigger maps or rooms:

    5 likes

  • Sander Vanhove's profile picture

    @SanderVhove

    Walking through a generated dungeon:

    7 likes

  • thefernando's profile picture

    @_thefernando

    realy like this style I should make things in this style.

    1 like

  • Sander Vanhove's profile picture

    @SanderVhove

    Thank! I would say: Go for it! 😁

  • thefernando's profile picture

    @_thefernando

    nice stuff I love when I see people simplifying things instead of over complicating them.

    2 likes

  • Sander Vanhove's profile picture

    @SanderVhove

    Exactly! People, and especially programmers, like to overthink systems from time to time 😅

  • GIGASWORD ~ Wishlist Now!'s profile picture

    @Hybrid_Games_

    I always love finding new ways to approach dungeon generation, thanks for posting this!

    1 like

  • Sander Vanhove's profile picture

    @SanderVhove

    No problem! 😁

    1 like

  • Svambo's profile picture

    @TherealSven2

    How does your corridor algorithm work? I'm working on something like this atm and it works pretty well most of the time, but in some rare cases I get 2 separate unconnected dungeons ...

    1 like

  • Sander Vanhove's profile picture

    @SanderVhove

    I have classes for a room, a corridor and a merded collection of rooms and corridors. So I basically take one random room and connect it to another random room with a corridor. Put all of that in a merged collection. Repeat until everything is merged into one big dungeon. 😁

  • Sander Vanhove's profile picture

    @SanderVhove

    Do you think the content of the rooms could make up for the randomness?

  • Redbaboon Games's profile picture

    @RedbaboonGames

    Maybe, the problem is, actually its too much random, the rooms have to be more logic in therm of size, also remember the sizes of the sprites if the generated dungeons, rooms are too small it can be problematic.

  • mrimvo's profile picture

    @mrimvo

    Classic Nethack style.

    1 like

  • Sander Vanhove's profile picture

    @SanderVhove

    Yeah, just rectangles and some lines between them!

    1 like

  • Sander Vanhove's profile picture

    @SanderVhove

    Makes sense 😅

  • Johannes Ebner's profile picture

    @Structed

    The complexity is still in the spawning rooms & connecting part, isn't it? I mean you need an algorithm with quite a few constraints.

    1 like

  • Sander Vanhove's profile picture

    @SanderVhove

    My algorithm just takes a random square in both rooms it's trying to connect and then put a corridor there 😅 It's really naive.

    1 like

  • Johannes Ebner's profile picture

    @Structed

    Do you have any checks on what is a valid room? A valid corridor? How many bends a corridor should have at least? How do you check for connections? 😂

    1 like