r/roguelikedev • u/KelseyFrog • Aug 11 '26
RoguelikeDev Does The Complete Roguelike Tutorial - Week 2
Congratulations for making it to the second week of the RoguelikeDev Does the Complete Roguelike Tutorial! This week is all about setting up the map and generating a dungeon.
Part 2 - The generic Entity, the render functions, and the map
Create the player entity, tiles, and game map.
Creating a procedurally generated dungeon!
Of course, we also have FAQ Friday posts that relate to this week's material
- #3: The Game Loop (revisited)
- #4: World Architecture (revisited)
- #22: Map Generation (revisited)
- #23: Map Design (revisited)
- #53: Seeds
- #54: Map Prefabs
- #71: Movement
- #75: Procedural Generation
Feel free to work out any problems, brainstorm ideas, share progress, and as usual enjoy tangential chatting. :)
51
Upvotes
12
u/Kyzrati Cogmind | mastodon.gamedev.place/@Kyzrati Aug 12 '26
I've been compiling the directory of participants over the first week, with links to repos and other info, and will continue to maintain that throughout the event as new folks post and update their projects going forward. Simply posting a repo in the weekly threads gets your project added.
So far this year we have 22 declared participants in my data, 12 of whom have shared public repos. Only slightly fewer participants than at this point last year, though many more with active repos. No doubt more will be joining over the coming week or two--not too late to join since the first week is mostly just about getting the basics set up :)
Good luck!
10
u/mariobadr Aug 12 '26
C and SDL3 | repo | play in browser
Had to do what I could at the end of last week 'cause I'm now on vacation. So my dungeon generation is a little incomplete.
I swapped out the font, too, but noticed that the font I chose isn't the best for a roguelike. The glyphs are not centred in the tile :(. Does anyone have any roguelike font recommendations?
8
u/Rakaneth Aug 12 '26
Rust, sola-raylib | repo | play here
Decided to return to Rust this year. My focus this year is on development workflow as well as polish. Raylib is my current favorite library for games, and I want to finish a project in Rust. I have a basic workflow set up that will allow me to test locally and push to Itch (link above) with little hassle. It was something of a challenge to get sola-raylib's web builds working, but I do like being able to build for the web without having to write Javscript. With this in place, I can start on the meat of the game.
7
u/LukeMootoo Aug 12 '26
JavaScript nonsense, week 2:
https://github.com/mootootwo/2026rltutorial
My notes so far: https://mootootwo.github.io/2026rltutorial/part-0/devblog https://mootootwo.github.io/2026rltutorial/part-1/devblog https://mootootwo.github.io/2026rltutorial/part-2/devblog
The last time I started this, whenever I got to something in the tutorial that I didn't like or didn't understand, I just substituted something from the Coding Cookies or Nluqo tutorials, or made something up (I hope those guys are doing well, neither have published code in years).
You can probably imagine how that led to trouble as time went on.
Anyway, I'm sticking closer to the tutorial this time, though I still have to adapt a lot to JS and figure out things without libraries. And without really knowing JS, haha.
Before last week, I hadn't touched any programming in a couple of years. So I am surprised at how much more I understand, now.
Thanks to everyone in this community for being here. This is a really inspirational place to make things.
6
u/Gix Aug 12 '26
Repo, screenshot
I may have gone a little overboard 😅️ I started prototyping on the devlog and got carried away...
For part 2 I went with an ECS (EnTT), plus an occupancy map that gets updated whenever a component of type position gets constructed / destroyed.
For part 3, instead, I went back-and-forth between different algorithms: since I'm creating a Populous-inspired roguelike, I need to create islands, instead of dungeons. I finally settled on something based on this (thank you u/redblobgames), you can see an interactive demo on the blog. I didn't manage to add trees, grass, and dirt yet, because I spent most of the time trying to add hillshading, but I'm quite happy with how it turned out!
6
u/Purpose2 Aug 13 '26
Pretty basic so far, but Week 1 is done in Godot. Starting on week 2.
Repo here.
6
u/Nokiraton Aug 14 '26
Part 2 was mostly about replacing the placeholder “everything is floor" with something that could count as a real map: walls, floors, collision, and basic generation. I’d already done a fair bit of groundwork, so this phase was really about giving that foundation an actual space to run in. Even though the near-future direction will be Urban, I started with a simple room-and-corridor generator first because it I already had a couple lying around, and it's good enough to validate basics like movement/collision and FOV.
I’ve deliberately avoided going straight to ECS as well. I’ve used it before, and in that project it ended up being more friction than benefit, plus the library I picked hit a component cap much earlier than expected.
Added field of view, map memory, and simplistic enemies. FOV only updates when something actually changes, like player movement or map regeneration, instead of every frame, and explored terrain remains remembered after it leaves the player's LOS. I also added graded visibility so tiles near the edge of vision render darker than nearby ones - I'm pretty happy with how it looks for now, but I'm definitely considering an offset-elliptical FOV based on cursor position.
On gameplay side, enemies now spawn into rooms with simple rules, can block movement, and can be attacked with a simple bump combat system, although they don't fight back. At this point I’ve already started drifting into urban map generation work and probably gone a little further than planned, but that is mostly because this has been a lot of fun to build. By end of week I should have basic elevation good to go, even if I don't have the means to traverse it without debugging tools.
The graduated FOV also translated over well to streetlights that I know I added faaaar too early. It was that or a day/night cycle, which I don't think I'm ready for yet.
Screenshots:
5
u/IndieAidan Aug 14 '26
Alright, I speedran the first week and a bit of the SelinaDev Godot 4 tutorial. Hopefully will find some more time to catch up more. No repo to share at the moment, partially as it is just the SelinaDev tutorial so far and I threw in Backterria's assets to have some slight change in visuals.
4
u/level27geek level0gamedev Aug 17 '26 edited Aug 17 '26
Usagi Broughlike | repo | very hectic map-gen gif
First OOPs!
I'm cutting it pretty close to the deadline this week. Apparently not doing any coding for years, and not really being a programmer to begin with, means that translating a tutorial from one language to another and making it work with a framework you haven't used before will lead to some issues... who knew‽
The broughlike tutorial relies pretty heavily on classes - a construct that lua doesn't really have. So my first step was try to add class functionality. Fortunately I found the classic library that has all the basic functions I need. So far, so good.
Only, I soon discovered that I hate the syntax of classes in lua! I either have to pass the table that will be turned into a class as a parameter each time OR use the syntactic sugar that uses a colon to call methods. Both methods feel really odd/janky when writing lua, and both already lead to issues, as I keep forgetting their quirks.
I'm considering abandoning classes alttogether and just do what lua gods intended and make all tables all the way down.
This is because this weeks part of the tutorial, making the dungeon generate fully walkable dungeons, was a pain to try to make work with classes is lua.
To be honest, the Stage 2 of Broughlike Tutorial is partially to blame, especially the "Banishing disconnected islands" section. It's not really explained well, and is written using code that is efficient, but is very hard for a newbie like myself to parse. What made matters worse that array methods like
filterorconcatused in that function don't exist natively in lua!I tried and failed to recreate that section as written a handful of times. I eventually got it working after realizing that what the 'getConnectedTiles()' function really does is a flood fill. I was able to implement it using a different (much simpler) way after reading about flood fill algorithms. It might be not as pretty as the tutorial code, but at least I have a way to identify fully walkable dungeons!
Programming the the Usagi way
I'm getting more familiar with the usagi engine after spending a proper week using it. The big seller features didn't come in handy yet (easy saves, 1 click exports, runtime code updates - the last one actually got in the way few times at the beginning), but the simple API encouraged me to look for simpler solutions.
I added the class library early on, but I think it was to my detriment and felt a little like going against the "spirit" of the engine. I was only able to really make progress after taking a step back and simplifying. I feel that the way engine is designed encourages this approach. Maybe not as strongly as something like PICO-8, but it's there... and is much more my speed.
I also love that the engine is in active development and has a very friendly dev (and community). It's already very close to my dream engine/framework, and there's a good chance it will actually get there. I'm sticking with it for now.
What I'm not sticking with are the lofty goals I wrote about in week 1! The plan is now to just finish the Broughlike tutorial, because there will be speedbumps along the way when translating it to lua. For now, I'm forcing myself to forget about checking the other tuts and expanding it into a full game - those things can happen after.
Although, the more I work on it, the more I feel the of a pull of the fable/witch forest theme more than the backrooms... but maybe it's due to using my old fantasy tileset :D
4
u/Selestielle Aug 18 '26
I finished very late this week, life has been busy but I'm pushing myself to keep going with the tutorial nonetheless!
After completing this week's tutorial parts I wasn't thrilled with the dungeon layouts that were being generated, so I decided to research and implement an alternative BSP generation method as well. It's a little rough at the moment, in particular I'm keen to improve the tunneling between rooms, but I'm already much happier with the layouts it produces.
If you'd like to have a look, check out
procgen_bsp.pyin my repo. No devlog yet for this week because I simply ran out of time to turn my notes into something presentable, but I'm hoping to catch up on that next week.7
u/Admirable-Evening128 Aug 12 '26 edited Aug 15 '26
UPDATE: I added a more repo-like repo,
https://github.com/pylgrym/2026rt
--I realize that the cool kids nowadays, link to their "repos",--
--so I have made a small source code index page,--
--to not feed the AI trolls too well:--
--https://xok.dk/other/2026rt/index0.html--
for 2+3 - player, render, map(+generation), I mainly cleaned up/structured my typescript effort.
For the game map model, I did a 2d-grid-of-tilesEnum class (where tiles can only be floor or wall so far.)
I stuff that, together with player-xy, into a Game model.
For display/render, I do a viewport render on top of rot.js, which of course
draws the contents of the Game model.
The dungeon generation so far is a default pulled directly from ROT.
To tie it together,
I then have an async gameloop which awaits keyboard input,
then dispatches it with the turn-taking code/commands in the 'move-player' module.
(which at the moment, with no monsters,
is just the player moving in 4 compass directions.)
The nice thing about async is that you can style/write your code
in the same way we used to write BASIC games in the 80's, hooray.
The result, where a lonesome @ can roam around a deserted dungeon, is still at
https://xok.dk/other/2026rt/dist/index.html
It will be a bit more fun once the monsters show up.. :-)
It ticks in at 175 lines of actual code, which I appreciate
(you can fit a roguelike in about 80-90 lines of code or less, but it won't be pretty/readable.)
3
u/RosalioRusso Aug 12 '26
Sub Looper!
Language: C++ & Raylib
I started a few weeks early for an unrelated game jam but only made it to part 7/8 so far. Not much done that's particularly interesting, though I am having fun playing with pointers to other pointers for inventory management :D
Still thinking about a core idea to really base the game around but foundation is coming along.
3
u/kyaaam Aug 17 '26
repo
I swapped my tech of choice for the project to DragonRuby (DR) after completing Week 1 in both Love2D and DR and preferring DR. I also recently used it in a gamejam, so no real learning curve. Ditching rotlove required me to seek out implementations for some tools like Bresenham lines (I ended up porting the libtcod implementation from Python to Ruby). I completed Week 2 quickly and decided to start designing some new level procgen. Since my game will involve playing as a frog in a swamp (more on that later), the plan is to use a cellular automata cave with additional passes to ensure connectivity. I have a basic implementation currently, but will need more time. I also have a first pass at FOV using a recursive shadowcasting implementation in Ruby, referenced in RogueBasin.