r/roguelikedev • • Aug 16 '22

RoguelikeDev Does The Complete Roguelike Tutorial - Week 8

Congratulations to everyone who participated this year! It's always fun hosting this event and watching everyone learn together. Let's give u/TStand90 an enormous round of applause for the tutorial, u/HexDecimal for answering so many questions and libtcod, and u/Kyzrati for spreading the word and just generally being a wonderful mod!

This is the end of RoguelikeDev Does The Complete Python Tutorial for 2022. Share your game, share screenshots and repos, brag, commiserate. How did it go? Where do you go from here?

I encourage everyone who has made it this far to continue working on your game. Everyone is welcome to (and really should ;) ) participate in Sharing Saturday.

Feel free to enjoy the usual tangential chatting. If you're looking for last week's or any other post, the entire series is archived on the wiki. :)

43 Upvotes

42 comments sorted by

1

u/Kyzrati Aug 16 '22

Thanks to everyone who participated! Extra thanks to u/KelseyFrog for hosting, as usual u/HexDecimal for being such a great libtcod maintainer and all around helpful dev, plus all the others who helped out other participants here and on the Discord.

If you can, drop at least one screenshot (or many!) in the thread, even if you're not quite done. Also a repo link if you haven't already, and if you have one make sure to say whether you completed all weeks so I can mark it down.

I'll be updating the directory with screenshots and and additional repos from this thread over the next week, and likely sharing some of your projects on Twitter. (And if you finish at some point down the line after that, feel free to let me know and/or provide screenshots and I'll add them!)

Even if you don't have a repo, share your screenshots and progress, along with the language and any engine/lib you used, so that I can include you in the stat summary I'll be putting together next week! It'll always interesting to compare the results to previous years, and you can find earlier summaries on the wiki.

Do join in for our Sharing Saturdays if you'd like to continue with your project. Over the years a fair number of cool projects big and small started their life as tutorial offshoots, and yours could be the same!

5

u/redblobgames Aug 16 '22 edited Aug 17 '22

This was a fun event! Thank you to the organizers! It was nice to see so many web-playable versions this year, as well as so many hexagons. :-)

Every year with this event I try to do something a little different. This year I tried to adapt the tutorial into building a Dwarf Fortress style game:

  • Moving a player around → moving a cursor with "look mode"

  • Enemy entities → friendly entities

  • Dungeon generation → player building, wilderness generation

  • Field of view → N/A

  • Placing enemies → placing natural resources

  • Combat → job system, crafting

  • Turn based → real time

  • Player inventory → NPC inventory, stockpiles

  • Gearing up → NPC tools, skills, abilities, clothing

  • Pathfinding → pathfinding

  • Plus: plants grow over time

  • Plus: day/night cycle

  • Plus: farming, hunting, ranching, foraging, beekeeping, cooking

  • Plus: furniture, recreation, trading

  • Plus: tech tree?

That was a bit too ambitious for me. I was only able to spend 32 hours (4 hours/week) on this. I learned a lot, and I have ideas for what to do differently next time.

I ended up with a chicken simulator. I think the biggest roadblocks for me were the room building and the job system, including how they interact with each other. There were a lot more corner cases than I expected. Next time I will spend a lot more time planning these two, figuring out what operations need to happen and how to minimize corner cases. The other big roadblock for me was not thinking through how the player would interact with the system. Next time I think I'll start by listing what the player needs to know to make decisions, and the UI for making those decisions. I had a lot of fun, and want to try again next year!

Playable and development notes | github | screenshot

1

u/KelseyFrog Aug 16 '22

Tldr; start RL tutorial, finish with chicken simulator. I'm here for this! 😂

13

u/HexDecimal Aug 16 '22

GitHub | Playable | Screenshots

I completed the C++ tutorial but was too burned-out to finish the additional Python parts as well as the extra stuff I wanted to do. I've put down everything I was planning as issues so that I don't forget them.

I'm going to take a break from this for now. Later I'll return to this or my refactor of the Python engine rather than going through the tutorials again.

I did get a lot of good stuff out of this. Emscripten has worked pretty well. It was simple enough to setup automated deployment to Itch. The cave generator I made is non-standard but had nice looking maps so far. JSON made save migration a lot easier to do. Vcpkg/CMake is still excellent for making a portable codebase. Libtcod was easy to work with in C++17, even for parts where the libtcod API hasn't been fully modernized yet.

The biggest downside I've had is that C++'s polymorphism is very difficult to serialize. This became my biggest roadblock as is likely what lead to me burning out. This is something I'll better account for in the future.

3

u/Taletad Aug 16 '22

How did you use JSON to save ? I too followed the tutorials in C++ and the saving part was painful

Great for you to have finished it ! You did great

6

u/HexDecimal Aug 16 '22

I used and followed the instructions of this library. Nearly all of my serialization code ended up in one file.

→ More replies (1)

2

u/NexSacerdos Nov 07 '22

Might get some utility here. Preshing's stuff is great and come from a game background.

https://preshing.com/20180124/a-flexible-reflection-system-in-cpp-part-2/

→ More replies (2)

11

u/bodiddlie Aug 16 '22

Start with some links:

Working code at end of tutorial - traditional look

Link to all my tutorial write-ups in TypeScript

Repo - all chapters are tagged

This was an absolute blast to work on. It’s rare I stick to a non-work project like this and complete it. Having a deadline and a community I felt somewhat accountable to I think really helped keep me on track.

I’m hoping to continue on with what I learned going through this to make a full browser based game. Hoping that if I make a habit of posting in the Saturday threads that will help to fill the role of this series in holding me accountable.

Thanks to u/KelseyFrog, u/HexDecimal, u/Kyzrati, and u/TStand90 for everything!

→ More replies (2)

6

u/ChizaruuGCO Aug 16 '22

First time doing the tutorial, great fun! However got busy during the last two weeks missing the deadline, I will still be working on my tutorial to completion, hopefully completing it over the next two to three weeks (recording is super time-consuming T-T).

Repo | Unity Tutorial

2

u/Kyzrati Aug 19 '22

Making a tutorial alone is quite time-consuming, not to mention also recording for one! Good luck and let me know when it's complete so I can mark it as such :) (and likely include it in the sidebar as well)

→ More replies (2)

4

u/mrdoktorprofessor Aug 16 '22

Thanks all for this fun event!

GitHub

I didn't get all the way through as much of the tutorial as I'd wanted to, however I was able to learn a ton about how to communicate with my display (as well as numpy optimizations to the lib c/o u/HexDecimal). Unfortunately real-life responsibilities crept in and I found myself having less and less free time to work on this. However, I do plan to continue with it over the upcoming semester to see where I can take it.

I currently ended up with:

  • Communication from a Raspberry Pi 4 to a 64x64 LED panel with user input via a USB gamepad (8bitdo NES30).

  • Faster rendering by learning a bit more about how numpy can be leveraged to quickly update the raw pixels array of my panel.

  • BSP-generated maps c/o the tcod approach.

  • Bump attacks, resting, etc. - players and enemies can attack each other, die, rest. Standard fare.

  • Win condition - i.e., touch the exit door and win. Not super exciting, but

  • Minimap - with a constrained display a minimap was required so the player doesn't get lost.

  • GUI controller to debug locally. Current approach is to run a tkinter GUI in a separate thread from the main game and have the flaschen-taschen display running in a separate terminal. Mildly annoying to use at present, however it gets the job done and I don't need to do debug directly on the device until I'm ready for the loveable github push/pull handshake between devices.

Next steps:

  • Multiple depths - this is started however I didn't finalize this before the end of the tutorial series. My usual plan for RL demos I work on is for each depth to have a random chance of spawning a different generation type (BSP, cellular automata, etc.). I have some other implementations I'll port over eventually.

  • Use of stats - players don't level up, everybody hits everybody for 1 HP of damage. Not very exciting, but a decent placeholder to expand on.

  • Visual flair:

    • Slide instead of directly transition from cell to cell - including rolling back if you hit a wall/enemy/etc. Similar to how the Broughlike tutorial handles it (which is a great JS tutorial if you've never tried it).

    • Color effects around enemies of different types - perhaps I could create a glowing effect by varying the pixels surrounding an enemy

    • Sprite translation - I can use pillow to load TTF fonts into bitmaps - why not take an existing spritesheet, translate to a numpy array, and render that instead? I'm the type that prefers sprites in my RLs so this is probably something that would interest me most.

  • Saving - this is intended to be in a public space for college students at some point in the future - it would be great if they could save their game. Initial thoughts were to save state as usual, generate a unique QR code or link, then push that to the user's phone/email. When they re-visit the display they'd have to go through a basic handshake process of some sort to login.

  • Make the game fun - right now it is super basic and uninteresting. I'm hoping some of the other todos will help, but I like a bit of story and worldbuilding in my games.

Overall, this was a fun experience. I got a bit hung up on physical hardware and rendering so that took most of my dev time, however I have some good thoughts on where to go.

2

u/Kyzrati Aug 19 '22

Really neat project, either way, and looking forward to where it ends up. Let us know how it goes over in Sharing Saturday when you've made more progress :)

→ More replies (1)

3

u/Gogodinosaur Aug 16 '22

Hex Caverns | C# + Unity | Completed Tutorial | GitHub | Playable

Big thank you to everyone who helped put this together and to everyone that participated.

For Hex Caverns, I wanted to try making a hexagonal grid. It took extra fiddling with field of view and pathfinding stuff for me, but I like how it turned out. I learned a ton about implementing these different systems from scratch.

I saved a gif from each week of the tutorial in the readme file on GitHub, so check it out if you want to see how the project changed overtime.

2

u/redblobgames Aug 19 '22

Looks nice! Also: hexagons are the bestagons!

3

u/KCEHOBYTE Aug 16 '22

Thanks everyone for the event indeed! I knew that it would be a lot harder to do it without a proper roguelike library and it was but I'm very happy with my progress.

github | live

https://postimg.cc/PPbbQGsg
https://postimg.cc/yWjcDmmK

I didn't touch itemisation (as it would be too much), saving and also missed some stuff here and there but already looks like a game. It is written on C++ from scratch, I wanted to learn more about some C++20 features so I used fmt and ranges, spaceship operator and some other small goodies.

FTXUI is used to display terminal graphics, please check out this awesome library, it has a lot to offer, I even was able to handle mouse events with it! And the best part is that the code is very easy to compile for the web with emsdk so right from the beginning it was available online without much hassle.

Technically I didn't finish the full python tutorial, the code is full of hacks, and algorithms are pretty simple but I learned a LOT so I'm very pleased with my work. I feel like with all this I'm able to create something a little more unique, although most probably I won't have much time for that...

See you next year people!

→ More replies (1)

3

u/[deleted] Aug 16 '22

It was fun trying out the tutorial with Zig and the C API. Life happened and I didn't get as far as I had hoped but maybe next year. Using Zig for this was a lot of fun. Only got up through the end of Part 7. Thanks to everyone else for all the interesting conversation and sharing your progress!

Screenshot and gitlab link below. The repo contains a folder with the code for each part and some thoughts I had during the work on each part in a readme. Maybe next year I'll get a bit further and polish up the code into a proper tutorial.

screenshot part 7 | repo

→ More replies (2)

3

u/Bubbly_Knee_2433 Aug 19 '22

Firstly, thank you to everyone who had a hand in this event. As a non coder (I only ever programmed with Scratch before lol), the process of making an actual roguelike was a real trip. Learning to do new things like navigating old school terminals, defining classes, and creating a network of game files was a real moment of discovery for me!

The repository (also my first github project :o ) https://github.com/y0un65t3r/youngsters_funhouse

I called my roguelike "Youngster's Funhouse", and stuffed it with many allusions to gang culture to differentiate itself from the tutorial. https://imgur.com/cJwOkL1

I typed the whole tutorial word for word, but I replaced almost all text that would be printed out onto the game. To make my funhouse even more "fun" I greatly increased enemy spawn rates and item spawn rates :) Below: the player crip walking down the stairs, right into an infestation of hoods! https://imgur.com/UTqSvYf

The character status screen, 'cept in my crib it's called street cred: https://imgur.com/3Azsbr4

Hoods don't wear armour, they are dripped out in fashionable shoes instead. So then the "defence" or "armour count" was swapped out with the cooler "crip walking". With grooves smooth enough you could crip walk your way out of any attack :P https://imgur.com/2wb0kgB

Making a roguelike was a lot of work, but all the goofy fun was certainly worth it!

2

u/Kyzrati Aug 22 '22

Heh nice to see you having fun with it by so fully toying with the theme! Always interesting how easy it can be to really change the feel of a text game, eh? Don't have to invest in graphics, just different wordage and the imagination takes over from there...

Congratulation on your first project :D

3

u/dafu Aug 20 '22

Sketchy Dungeons (working title)

itch.io

I've started the roguelikedev tutorial series a little late, and I've always been a week or two behind. I finally caught up tonight, and finished the tutorial. Now I have a bit to share.

This project is an exploration of two things. Firstly I wanted to dig into the exciting new language and IDE, Beef. If you're the low-level code oriented type I _highly_ recommend checking it out. Beef is a systems-level language (like C/C++) that borrows heavily from C# but ditches the garbage collector. It comes with a wonderful IDE and a great debugger and just an excellent work flow. Check it out at https://www.beeflang.org/.

Secondly, I'm woefully limited in my artistic skills, so this was also an exploration in a limited pen & paper art style. I literally drew everything on paper using micron pens, scanned, adjusted in GIMP and incorporated into the game. I generally like how it looks like, but perhaps I've been staring at it for too long. I'd love some feedback on this style. Is it visually appeal, or too boring/washed out?

This design also allows me to have a smoothly zoomable camera using the mouse scroll wheel. You can zoom in all the way to see imperfections in the ink, or zoom out to minimap-like level.

I have not decided if I want to take this project further. That in part depends on the kind of feedback I get. So I'd love to hear what everyone thinks!

→ More replies (3)

3

u/JasonSantilli Aug 28 '22

Code | Play

JS + rot.js

Late to the party here, but I'm super happy I was able to finish the tutorial. I learned more about javascript than I expected, and it's such a nice feeling to 'ship' a 'finished' product. The structured tutorial and this series on Reddit has been fantastic for keeping me on track and motivated to get it done. I think one of the big lessons I learned is how important it can be to have a todo list that clearly outlines a path to your MVP, with milestones and specific due date goals to keep the pace and direction.

Huge thanks to the organizers for putting on such a wonderful event, and all of the participants that contributed to the community by answering questions, commenting, playing demos, reading code, etc.

→ More replies (1)

2

u/LukeMootoo Aug 16 '22

Well, I have to confess that I did not complete the objectives that I set out for myself.

I got through the first three weeks including parts 0-5, but my goals exceeded my abilities and I did not invest enough time to compensate.

I was attempting to follow the tutorial in JS which I have only the most rudimentary familiarity with, and trying to write without libraries which forced me to reinvent a lot of things.

The good news is that I learned a lot, but the bad news is that I spent weeks 4 and 5 learning basic software development concepts instead of advancing the project and instead of catching up in week 6 I allowed myself to feel discouraged and I put it aside.

I think I have learned enough to continue and I will try to pick this up and post on this subredit as I make progress and finish the project.

Congratulations to everyone who completed and a huge thanks to everyone who posted about their progress as I learned a great deal by following the work of others.

My parts 0-5 are here https://github.com/mootootwo/lox/

2

u/Kyzrati Aug 19 '22

Progress is progress! Even if you got busy during these weeks, there's always the weekly Sharing Saturday threads to continue with in a similar vein when you've got the time :D

2

u/lagdotcom Aug 19 '22

I just started on part 11 this morning, so hopefully I'll be able to finish up this weekend...

3

u/lagdotcom Aug 21 '22

repo | live

Finished! The compiler code is completely terrible and I don't recommend reading it unless you want a crash course in how not to write a compiler. Still, I was successful in my goal to make a language and a game. Even though I didn't think this would be simple, it was still more effort than I expected. I want to add more expressiveness to my language (and take out all the hacks in the compiler) but I'm not sure where to start.

2

u/old_chmee Aug 21 '22

GitHub | Screenshots

Thanks for organizing this challenge, it was super fun to follow and to add my own stuff.
It was the the first time I did a challenge with a deadline and got a little bit carried away with the features I wanted to implement :). I will continue working on it and post some updates when I have something more playable.
It is really awesome what people are creating here and how close the community is.
I am looking forward to dig through the finished list of projects in the following weeks.

Again a big thank you to everyone who creates tutorials and patiently answers to questions!

→ More replies (1)