Building a Roguelike from Scratch in Godot, 'Dungeon of Recycling' (Tutorial)

preview_player
Показать описание
In this tutorial I'll build a roguelike from scratch with most of the key features you'd expect: procedurally generated levels, limited vision, turn-based combat, and randomized item effects.

In the game you fight bags of trash that drop recyclables. Yeah. I have no explanation for why I chose this theme.

You can support my videos and games at:

And read all about GDScript here:

All the music in this video is my own, and you can hear more here:

#roguelike #tutorial #godot
Рекомендации по теме
Комментарии
Автор

Note: Some bugs were found after the video that have not been fixed (yet.)

Thoughtquake
Автор

The only reason why I don't switch from unity to godot is because unity has more tutorials. So thanks for changing that :D

islandgames
Автор

Timeline:

1:00 - Part 1: Initial Setup
5:11 - Part 2: Level Generation
16:34 - Part 3: Movement
19:12 - Part 4: Level Progession
21:13 - Part 5: Vision Limiting
24:21 - Part 6: Enemies
34:17 - Part 7: Items

mattw_dev
Автор

As a programmer used to unity, this 40 minute tutorial has told me more about how godot works and how to actually use the language than i could possible get from 100 "normal" tutorials. Thank you SO MUCH for this awesome quickstart, making an interesting product too!

dantescanline
Автор

Update for Godot 4.0 -
Because the tileset is a bunch of loose images, , Godot 4 considers them to each be an AtlasMap, each with one coordinate.. Hence, set_cell(x, y, Tile.Door) becomes set_cell(0, Vector2(x, y), Tile.Door, Vector2(0, 0)).

lendrigangames
Автор

So after more than an hour of debugging I found that, when you import tiles to the tile map, they are assigned a number. The Tile enum needs to have the tile names listed in the order that they are listed in the scene. You can find that by selecting the TileMap in the scene, then clicking Tilemap in the inspector. A drop down will appear with the top node being "TileSet". Select that and you'll be able to see which number each tile is assigned to.

tigerj
Автор

ur little diagrams on the side that explain the code points are extremely helpful, and is whats missing from all the other tutorials out there. thank you for the amazing tutorial!

nitsi
Автор

For everyone in godot 3.2 the segment about the visual doesn't seem to work properly in this version. So I've found a way to make it work. First off the update_visuals can't be called when a room is just barely finished. So what I did to fix this was create a timer right before I updated the visuals when the room is first created AND when you move to a new floor.
EXAMPLE 1.
var startRoom = rooms.front()
var playerX = startRoom.position.x + 1 + randi() % int(startRoom.size.x - 2)
var playerY = startRoom.position.y + 1 + randi() % int(startRoom.size.y - 2)
player_tile = Vector2(playerX, playerY)
yield(get_tree().create_timer(.2), "timeout")



EXAMPLE 2.
func try_move(dx, dy):
var x = player_tile.x + dx
var y = player_tile.y + dy

var tileType = Tile.Stone
if x >= 0 && x < levelSize.x && y >= 0 && y < levelSize.y:
tileType = map[x][y]

match tileType:
Tile.Floor:
player_tile = Vector2(x, y)

Tile.Door:
set_tile(x, y, Tile.Floor)

Tile.Stairs:
levelNum += 1
if levelNum < LEVEL_SIZES.size():
build_level()
yield(get_tree().create_timer(.2), "timeout")

else:
print("win")




This is how I was able to fix the bug where the visual doesn't completely work. You can mess with the timer and how much it waits, I just tested it with .2 and it made it work. I hope this helps anyone using godot 3.2. Love yourself

P.S. I've personally set my timer to 0.01 and that seemed to work just fine. Make's for a quick reload speed

deadlucky
Автор

It would've taken me a month to create a procedurally generated level code.

I'm checking out godot and these are the types of tuts I enjoy watching and seem the most helpful.

Dalik
Автор

I was honestly looking for a tutorial like the since the last week. Thank you! I hope that your own game rocks the show!

nikhilkadiyan
Автор

I appreciate the console being open at the bottom. I'm trying to get started with Godot, and that makes picking up the specific actions I'm watching, clearer. Thanks for that!

adamb
Автор

Thanks for another great tutorial! Don't worry about doing less of them. Focus on your cool game idea and make more great Godot content!

Loved the theme of this roguelike, too. Hilarious idea with the recycling can and bags of garbage.

DavidiiXV
Автор

Amazing tutorial! The best 1.5 hours I've spent on YouTube (I watched it twice). Thank you very much.

timschmidt
Автор

Godot now has a dedicated Astar2D class in latest 3.2 beta

nikhilkadiyan
Автор

Oh wow! I've always wanted to learn how to make a rogue like and now with godot! I'll definitely give this a try soon, thank you so much!

TheSteveTheDragon
Автор

great tutorial. i had a bit of trouble in the level generation part, but it worked great as a debugging training. And as you stated in your vid, it is a good case for unit testing.

claxviith
Автор

i wish i can support your endeavor. your tutorials is just the pace i really needed.

notlineeydupppz
Автор

00:00 Intro / What's inside this tutorial
00:59 Initial Setup
05:10 Level Generation
16:33 Movement
21:13 Vision Limiting
24:21 Enemies
34:16 Items

bodhi
Автор

Brilliant tutorial I've been looking for, I do believe rogue likes are great for learning programming seeing as it teaches you so much and you could do anything with them. Good tutorial 👍👍

billycrooks
Автор

Thank you for the tutorial! Thank your for explaining each step as you went through it

jameslabbe