Dungeon Generation Tutorial! Godot

preview_player
Показать описание
Today we'll be making a random dungeon layout generator. With this generator, we will be able to create dungeons similar to those found in Soul Knight or The Binding of Isaac!

This is my first video so any feedback is appreciated :)
Subscribe for future updates

Sorry for the loud music

You can also do this project in Java or C++, the general algorithm will stay the same.

Dungeon Tester Code:

Download Godot here:

Music:
Idyllic
Sarcastic Sounds
Tower by Lukrembo
I always love you by Lukrembo
Рекомендации по теме
Комментарии
Автор

! ! !
Actually there is a problem in the generation,
when you put same min_number_rooms and max_number_rooms values
sometimes it generates more rooms than the max_number_rooms

So to fix that we can add " and size > 0" in the dungeon_generation'gd :

. . .
while(size > 0):
for i in dungeon.keys():
if(randi_range(0, 100) < generation_chance) and size > 0: < - - - - - There
var direction = randi_range(0, 4)
. . .

Except for this issue, it's a very good way of generation what you did !

Prosecute_V
Автор

came here from somebody else's video and i got to say, underappreciated, it took me a full 2-3 minutes of googling your channel to find you, but I'm sure partly its on account of the fact you seem not entirely interested in being a big channel which fair enough lol, still appreciate the tutorial immensely man! and a recommendation for a new tutorial I'm not finding much: "rulesetting" for tile maps and procedural generation, maybe giving tips for how you would set it up or "dos and don'ts" for instance i was going to group a bunch of tiles based on the "light value" of them, when i should've cleaned my tiles up to be "flat" lighting and then add light in the game as i deemed appropriate, stuff like that, that's only one of many examples I'm sure cause i just started on this stuff haha

djalexander
Автор

Thanks I was searching for this for a eternity

ulv
Автор

Make a tutorial on how to make the rooms too!

campbell
Автор

Great video, thank you, it helped a ton <3. Great editing and funny on top

guuiswere
Автор

This video is exactly what I was looking for and really well done! Keep it up!!!

palehope
Автор

Great tutorial man, but the music is too loud!

sirAlfred
Автор

Very useful tutorial, thanks for sharing. It would be cool if you could show how to replace the temp room with different pre-made rooms and how to place the entrance at end room far apart.

idleman
Автор

Thank you so much!! Until now I am using this. 😊

decemberfrostpaindine
Автор

Took forever to find something like this on YT, for those who find this on Godot 4 here is how you'd set this just up, this is just the generator script, I've taken the liberty of cleaning it up a little but it should function the same:

func generate(room_seed, room_size : int = 0):
seed(room_seed)

var dungeon := {}

if room_size == 0:
dungeon_size = randi_range(min_number_of_rooms, max_number_of_rooms)
else:
dungeon_size = clampi(room_size, min_number_of_rooms, max_number_of_rooms)

dungeon[Vector2i.ZERO] = room.instantiate()
dungeon_size -= 1

while(dungeon_size > 0):
for i in dungeon.keys():
if randf_range(0, 100) < generation_chance:
var direction = randi() % 4
var new_room_position : Vector2i
match(direction):
:
= Vector2i(1, 0)
:
= Vector2i(-1, 0)
:
= Vector2i(0, 1)

= Vector2i(0, -1)
var new_key = i + new_room_position
var found_room : DungeonRoom = dungeon.get(new_key)
if found_room:
= room.instantiate()
-= 1
var found_connection : DungeonRoom =
if !found_connection:
dungeon.get(new_key), new_room_position)
while (!has_variance(dungeon)):
for i in dungeon.keys():

dungeon = generate(room_seed * randf_range(-1, 1))
return dungeon

dibaterman
Автор

Make a tutorial on how the make the rooms!!

JKILLARL
Автор

thank you for this tutorial, helped and inspired me a lot!
sountrack in the background are too loud and distracts tho

DaronFox
Автор

this tutorial is so great that im trying to make the same thing in unity, but having some difficulties :(

shoktheiv
Автор

Can you PLEASE make the tutorial on the rooms ???

grujqubedmk
Автор

Can you make a tutorial on adding rooms please

CrypticDevGames
Автор

Would love to hear about creating the rooms

Fewkulele
Автор

I know it's been a while since this came out, but I was wondering if you could possibly explain how to add premade rooms or scenes.

chucky
Автор

how do i add actual room made of tile map and other scenes added to it

Smart-spx
Автор

Awesome tutorial! Why you stop making other ones?

n-icebeam
Автор

Tips for bigger rooms? Like the "L" rooms in Binding of Isaac or a room 2x2.

n-icebeam