r/roguelikedev • u/KelseyFrog • Jul 09 '24
RoguelikeDev Does The Complete Roguelike Tutorial - Week 1
Welcome to the first week of RoguelikeDev Does the Complete Roguelike Tutorial. This week is all about setting up a development environment and getting a character moving on the screen.
Get your development environment and editor setup and working.
Part 1 - Drawing the ‘@’ symbol and moving it around
The next step is drawing an @ and using the keyboard to move it.
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
Feel free to work out any problems, brainstorm ideas, share progress, and as usual enjoy tangential chatting. :)
•
u/Kyzrati Cogmind | mastodon.gamedev.place/@Kyzrati Jul 10 '24
Welcome, everyone, and good luck! The initial announcement has the introductory info if you missed it.
Supplementary info:
Regardless of when you join--early this week, later in the week, or even in the coming weeks, you will be added if you post in the threads with updates and information.
7
u/nefffffffffff Jul 09 '24
Looking through these early comments I'm beginning to notice a pattern. I think I may also follow along with Godot. Last year I made an attempt at an action roguelike and got tangled up in part 4, FOV.
I tried using Godot's light system which worked well until I tried placing light sources besides the character in the dungeon, which made parts of the map visible despite being outside the players LOS. I ended up getting frustrated after a couple weeks of banging my head against the problem, and haven't really done much since so I'm eager to pick the hobby up again. Wish me luck!
3
u/LukesFather2011 Jul 16 '24
I've been a lurker on this sub for several years now with the dream of following this tutorial. I've worked diligently over the last 9 months to learn python to a degree that I'm at least comfortable enough to follow along. I don't exactly have an idea for a roguelike just yet, but I love the genre completely. I'm hoping that as I start to follow and create, that inspiration will strike and I can come up with something worthwhile.
17
u/SelinaDev Jul 09 '24
I've decided that for this year I want to use Godot, as I'm familiar with that, and use the opportunity to incorporate a few things I've experimented on or wanted to try since last year.
One major thing I want to try (after a few failed attempts), is a multiplayer roguelike. I've already implemented a little main menu before the game, where a second player may join besides the first player. Each player may use a game pad, or one of the players can use the keyboard. Depending on the number of players, the main game will start with one or two viewports.
If anyone is interested, I have put this in a public repository: https://github.com/SelinaDev/Roguelikedev-Tutorial-Tuesday-2024
I plan to eventually create a web build, and if I feel motivated and find the extra time, I'll write a bit more about the development and my approaches.
14
u/HexDecimal libtcod maintainer | mastodon.gamedev.place/@HexDecimal Jul 09 '24 edited Jul 09 '24
GitHub repo - Python 3.12 - Using python-tcod & tcod-ecs
I'm done with part 1 by this point. I'll be heavily refactoring my code as I follow the tutorial mostly faithfully.
I'm using my usual linters: Mypy, Ruff, and pre-commit. I enable so many linter rules in Ruff that it's easier to have all of them active by default and simply disable the rules I don't want to follow.
I went straight to using ECS this time. With a
PositionandGraphiccomponent and anIsPlayertag I already have everything I need to handle player movement and sparse object rendering.I have the game states setup as a Protocol in a separate module than where I implement the states themselves. I have the active state stored globally.
I'm not completely sure on actions, but I want them to fit into a
Callable[[Enity], ActionResult]type. I'll see how well this works out later. For now aMoveclass is the only thing I have related to actions, invoked asMove((dx, dy))(entity).ExampleState.on_eventgrabs the entity with theIsPlayertag and applies a movement action to it when the appropriate key is pressed. ThenExampleState.on_drawiterates over all entities which have aPositionandGraphicand renders them.I didn't think too hard about fonts. I just put the BDF for Cozette in my assets and loaded that.
10
u/[deleted] Jul 09 '24 edited Jul 09 '24
Going to be using libtcod/python 3 for now. Mind you, I'm not a programmer AT ALL, so I'll be doing Codecademy shit in tandem with all of this. (EDIT: Python 3 is behind a paywall on Codecademy. Hmmm...)
EVEN MOAR EDIT: I might go with the Broughlike tutorial or rot.js, as I *do* have some familiarity with front-end dev stuff (HTML5/CSS/JS). We'll see...
My "goal" is to make a ripoff of Dark Fort (which is a precursor to the tabletop rpg Mork Borg). Dark Fort is already pretty much an rng roguelike, so there should be an ease of application here. But who knows...
Don't expect major genre-defying stuff from me. In fact, don't even expect the program to run in the first place! hahaha
9
u/ZPanic0 Jul 09 '24
Taking another crack at it, this time with Godot.
I'll be using this Godot tutorial by u/SelinaDev but adapting it for C#. If I run into roadblocks, that'll just have to be on me to figure out. Just going to play it by the books and get familiar with Godot for now.
I'll be dumping builds here. Got GitHub Actions doing builds for me on every tagged push relatively pain-free.
8
u/PainFadeDown Jul 09 '24 edited Jul 10 '24
Well, so far so good. Went with the recommended choice of python3/libtcod. Only real deviation from the tutorial material so far is that I abstracted out some global/settings values into their own file, made the basic input_handler do a dict lookup to get dx/dy values (so I can add other keysets and maybe tie this to some configurable keybind backend), and also I think a couple of lines in the tutorial use depracated/non-working tcod calls/references, so probably fixed a couple of those without paying too much attention to it. Gonna let thoughts brew while I work along and see if I can come up with adjustments/mechanics and personalise the project later. If I do something significant I'll publish the repo. Really interesting reading the takes of experienced devs and looking at their projects though!
Edit: One thing that -is- kind of already bothering me is that I don't like how actions are set up, though I can't explain why, nor can I come up with a less cumbersome system. My natural aversion to inheritence, maybe?
7
u/MrDave95 Jul 10 '24 edited Jul 12 '24
Roguelike 2024 (name to be changed)
Python3.12, tcod (basic things)
GitHub repo
This will be my third try overall, but between doing my second attempt and this one I've actually became a Junior/Middle dev, so at least now I know what I'm doing :D
If it goes well, I'll try using a graphic tileset and/or compile the game into an executable of some kind
7
u/ph1l Jul 10 '24
Hey there,
I'll participate this year as well. I chose Godot 4 as well and went with Bozars Tutorial. My Goal is a more open world Roguelike, where the player visits multiple towers, "ransacks" them and sells the stuff. The most gold at the end wins xD So I need a randomized "open world" with multiple locations added. Let's see if this will be possible, but I'll try :)
This is not my first time creating a game and also not the first time using godot. Looking forward to the upcoming weeks!
5
u/jube_dev Far West RL Jul 09 '24
Go! I made part 1 quite easily thanks to the features already present in the C++ framework I use (and that I have created): actions, console font, (virtual) console. For now, everything fits well in the framework. My goal is to stick to the design of the tutorial as much as possible and make the simplest roguelike possible. But it gives me many ideas and I am taking notes for making another more complete roguelike later. Maybe I will add some helpers in the framework if I see I can factorize some code.
5
u/four_hawks Jul 09 '24
Diving into this as relative newbie to Python, sticking close to the tutorial for now but hoping to experiment more after I get the basics down!
Possibly stupid question: since it seems like virtual environments (
venvfolder) are by default ignored by git, do I need to manually configure the virtual environment on each computer I use for this project? Or is there a cleaner way?5
u/TheCommieDuck Haskell nonsense Jul 10 '24 edited Jul 10 '24
Haskell + Roguefunctor + bearlibterminal-hs + "tutorial" writing
Well, I didn't manage to get very far on porting the tutorial to haskell...so I've instead decided to sort of do half a tutorial:
StateT World IO, no optics, etc) and one with the bells and whistles (effectful, optics, my NoECS system, etc)part 1, simple Haskell
https://github.com/PPKFS/roguelike-tutorial/blob/main/part1/hs-rogue/app-simple/Main.hs
part 2, full Haskell (todo)
roguefunctor documentation (todo)
haskell bearlibterminal bindings documentation (mostly done for this part, at least)
5
u/IndieAidan Jul 10 '24
Untitled Godot 4 Roguelike Project
I decided to participate this year to hopefully encourage myself to get something working more quickly without overthinking about the overall structure/architecture of the project too much. So I started a fresh Godot project last night and set up a github repo (which I cannot add right now, but will add later).
Just want to get something bare bones made (relatively) quickly and maybe mess around with different ways of tackling the issues. I'll be following the structure of the tutorials, but probably not the tutorials themselves or exact code. Using Backterria's 32x32 sprites for characters and environments, and then the 16x16 sprites for items. I did a quick/rushed convert of the sprites to my expanded version of the Resurrect 64 colour palette, and will be giving the characters super basic 2 frame animations.
So Parts 0 & 1 done! Good luck everyone!
4
u/FooWho Jul 09 '24
I have completed the tutorial before, but it wasn't during one of these events. I am going to do the tutorial again with the other folks here.
Do people generally change the code from the tutorial as the go? Or do people usually do exactly what is in the tutorial until reaching the end and then start making changes? For example, after I completed the tutorial the first time, the first change that I made was to add some more equipment. Then I changed the way that combat works so that the hero and the monsters had accuracy and power as part of their offensive stats and had avoidance and mitigation as part of their defensive stats. But while I was "doing the tutorial" I was just trying to understand the code in the tutorial and how it works.
4
u/HeliosInvictus_ Jul 10 '24
Considering whether I want to use this as mostly a Rust learning experience or a game design learning experience. All three of the Rust toolkits that have tutorials have been updated since their tutorials came out. Chargrid seems to have quietly broken somehow unless it's only a "works on my machine" issue (even the examples won't run correctly), tcod/doryen has made major enough changes that I'd need to be more familiar with the language to translate the tutorial to its current standards, and I'm having a harder time than I expected getting RLTK/bracketlib to accept fonts other than its default.
The font thing came up as early as it did both because on the small screen of one of my laptops where I want to be able to work, the default RLTK font appears almost illegibly tiny, and because I want to see how clean/modern I can get an ASCII interface to look.
(Related: is there an existing simple way to turn monospaced fonts in TTF/OTF format into the CP437 bitmaps RLTK wants?)
4
u/yngwi Jul 10 '24
I already tried some years ago but didn’t finish. Life is busy. So now another try, I would like to use Rust/Bevy but let’s see…
4
u/Maxwells_Equations Jul 10 '24 edited Jul 10 '24
I completed part 0 and 1. I received a few errors that some of the commands had been depreciated. I made the corrections suggested and it worked without throwing any errors. Looking forward to going on to part 2.
Replace 'tcod.Console' with 'tcod.console.Console' root_console = tcod.Console(screen_width, screen_height, order="F") C:\AI\Roguelike\venv\input_handlers.py:17: FutureWarning: Key constants have been replaced with enums.
tcod.event.K_UPshould be replaced withtcod.event.KeySym.UPif key == tcod.event.K_UP: C:\AI\Roguelike\venv\input_handlers.py:19: FutureWarning: Key constants have been replaced with enums.tcod.event.K_DOWNshould be replaced withtcod.event.KeySym.DOWNelif key == tcod.event.K_DOWN: C:\AI\Roguelike\venv\input_handlers.py:21: FutureWarning: Key constants have been replaced with enums.tcod.event.K_LEFTshould be replaced withtcod.event.KeySym.LEFTelif key == tcod.event.K_LEFT: C:\AI\Roguelike\venv\input_handlers.py:23: FutureWarning: Key constants have been replaced with enums.tcod.event.K_RIGHTshould be replaced withtcod.event.KeySym.RIGHTelif key == tcod.event.K_RIGHT: C:\AI\Roguelike\venv\input_handlers.py:26: FutureWarning: Key constants have been replaced with enums.tcod.event.K_ESCAPEshould be replaced withtcod.event.KeySym.ESCAPEelif key == tcod.event.K_ESCAPE:4
u/rikuto148 Jul 11 '24
Like everyone else I want to give this a try with Godot, but I don't really like the way that the tutorial/how the game is built. It feels weird, I'm not sure how to explain it. I might give another tutorial a try.
4
u/MKijowski Jul 11 '24 edited Jul 12 '24
My plan to keep it simple and just follow tutorial has been rather short lived. After implementing first 4 parts following the rot.js tutorial from Nick Klepinger my mind wondered and I just had to rewire the rendering to use pixi.js :)
From this point on I'm going to do my own thing but I'll try to keep track of milestones from each week and I'll just put my spin on it.
Speaking of spinning - you can check out my spinning player character at https://kijowski.github.io/roguelike-2024/ (wasd controls) EDIT: I forgot to mention that random number generator seed is saved to localStorage, so if you refresh the page you will get the same game state. You can refresh the seed by pressing `x`
Code repo: https://github.com/kijowski/roguelike-2024
4
u/avinashv Jul 12 '24 edited Jul 18 '24
Caverns of the Shadow Queen | Rust/bracket-lib/legion | GitHub | Week 1 Commit
Yet another year of trying and hoping to finish this time! I came back to "Hands-on Rust" and am going to give it another run. The repo has implementation notes as well as a log week-by-week.
4
u/Old_Pops_94 Jul 13 '24
Portals of Balor | Github Repo | Week 1 Stopping Point
After lurking for a while, I figured I had enough free time this summer to give this a shot. I'm using this to (once again) try to really learn Rust, and I'm using the rltk tutorial from Herbert Wolverson (but leveraging the full bracket_lib crate).
This week was pretty basic - the end product I have isn't really any different from the corresponding point in the tutorial, modulo some minor code changes I documented in the readme. But I did use this week to also brainstorm some ideas for where I'd like this project to eventually get to. I'm sure this is being WAY too ambitious, but I'd love to spin off this tutorial into a more fleshed out game with some additional mechanics from RPGs I enjoy playing; I'd like to make something I wouldn't mind sitting down and playing myself. But one step at a time! I need to make sure I commit to week two before I get in over my head with grand visions of the next Fantasy Roguelike Epic (TM).
4
u/AleatoricConsonance Lost Gardens of the Stone Heart Jul 15 '24
I wasn't going to do it this year, but I've just finished a huge project, and so I find myself doing the Typescript tutorial, but I'm planning on a few variations:
We'll see how it goes I guess. My free time ebbs and flows, and I have about 700 trees to help plant on our place ...
4
u/_bdevs Jul 16 '24
Dev here that has been looking for a new project. Last week I was sitting around thinking to myself how much I enjoy ascii art adjacent games and especially roguelikes. Booted up some Caves of Qud for a play through and thought to myself, "I want to make a roguelike". Found this a week late but going to play catch up. Excited to get started.
3
u/Taco_Chop Jul 09 '24
Several years ago I did the libtcod/python tutorial and used it as an introduction to programming and found I really enjoyed it. Then in 2020 I had the time to take a bunch of python courses and really felt that I had a good handle on the language so I started the tutorial again on my own to use as a guide and build the game out with my new knowledge. Well I got a good start on it but life happens and programming fell by the wayside for a few years. But I think I'm ready to jump back in and try to finish the game I started with that last tutorial. I'll probably spend the first couple weeks refreshing my python knowledge and try to jump back in where I left off. I think it was around part 5.
3
u/Amadeus_DW Jul 09 '24
I decided to jump this year after several of planning on it and then not. I'm using C and Raylib (as I've been meaning to learn that library) and it's been an enjoyable experience though without meaning to I've slipped into part 2 while doing part 1 of the tutorial. But hey, what can you do? *shrugs*
3
u/Nyktor Jul 10 '24
Hi, I'm fairly new to Python and definitely to Roguelike dev. In Part 0 I honestly don't understand the need for virtual evnironment. I've installed libtcod without issues but why would I want venv? Read through the docs but didn't really understand the need for it. Thank you for the help!
3
u/TechniMan Jul 11 '24
I have gotten quite used to the tutorial by now, having done this a few years in a row. Following klepinger's ROT.js TypeScript tutorial this time; hopefully it will be easy to share if it's innately web-hostable.
But no matter how much I can predict the next step of the tutorial and recognise every code snippet despite it being a different language, I fall for some of the same traps every time. This bug I think I've run into every singe time I've written corridor-digging logic, where it only builds one axis and not the other! So frustrating as the issue is so well hidden: I'm checking I've reached the target x and y with && instead of ||, so as soon as it satisfies one axis, it quits the loop. Found it faster this time than previous times, though, thanks to the browser dev tools and a breakpoint. Hopefully I don't do it again next year! But perhaps now it's a tradition?
Anyway, I'm still cooking ideas for how to make this one interesting. I have just discovered Moonring, which is either great or terrible for inspiration as it seems to have quite a lot going on, and I don't want to get too ambitious. I'll probably try again to aim for a Diablo-like as I have previously, as it's a simple enough premise to start with.
Good luck to all!
3
u/KCEHOBYTE bedivere Jul 13 '24 edited Jul 13 '24
Rust + tcod | GitHub
Can't believe I nearly missed it, anyways I'm going to stick to tcod this year and just follow along with tutorial in the most boring way possible, the learning opportunity of this run is entirely on Rust front. In 2022 I was really close with my custom C++ entry but writing all those algorithms from scratch really hurt while it usually just boils down to a single libtcod call.
3
u/EquivalentFroyo3381 Jul 15 '24
oki! i got to part 1 and its shaping up nicely, here is my repo btw https://github.com/jossse69/Python-RL, i will prob add some stuff in the future to make it more unique from the tutorial, anyways, i will also sometime makes builds, i hope it goes to be something cool! anyways, cheers!
2
u/kuningaz55 Jul 12 '24
How the fuck does git work
2
u/haveric Jul 14 '24
Neil the Seal - Godot 4 | Github | Playable in Web (Tested in Chrome)
I am also jumping on the Godot train this year. As usual, I spent way too long trying to get infrastructure setup and have done both too much and not enough to where I want to be, so hopefully I'll have a bit of time to cleanup the rest before next week, but I at least have an exportable web version going, even if it isn't working in all browsers.
I'm going to be working with an artist this year to help create something a bit better than I can do with my programmer art, but they will not be jumping in for another week or so, but I am looking forward to figuring out the process of working with another person on game design and art.
Instead of a traditional dungeon, I'll be experimenting with more of a town/road layout structure. You will be playing as Neil the Seal, trying to cause chaos around town and stopping anybody (like the police) from getting in your way. I don't yet have an answer to all of the replacements for things that would normally be included in the tutorial, but there's still time to figure out things to fill in any of the gaps that will be missing.
Looking forward to what everyone else is doing and keep up the great work everybody!
2
u/Kehvarl Jul 14 '24
I'm happy to see this event happening again. I've gone through the various Python editions a couple of times and also done it in Lisp a few years back. This year I'm working in Ruby using the DragonRuby toolkit as my engine. We'll see how far I get trying to follow along with the main tutorial.
I'm posting my translation notes to github, and an itch.io page I set up for the project https://kehvarl.itch.io/rld-2024/devlog/764282/week-1-parts-0-and-1
I'll do a devlog for each week or each chapter depending on how far behind I get.
2
u/vrolnek Jul 14 '24
github repo.
Looks like a good project to train my common-lisp and to learn about ecs.
I'll be taking inspiration from S. Losh tutorial with raylib for the graphical part.
2
u/GeekRampant Jul 16 '24
It's still Monday night where I live, so just made it for this week.
I'm using SDL and C with C++ cherry-picking, and no other libraries. This year I really want to do something atmosphere/ambience focused, and get in and do some fun things with rendering, NPC and game logic interactions, and player feedback. For that it'll be easier to roll the game library systems from scratch so I know what all the code is doing and can tinker with it on the fly as needed.
Most of this week was getting the platform system setup for things like texture loading, sprite rendering, event management, player input handling, and game update processing. Work also involved creating the testbed sprite sheet (I imported a LOT of it from another project), which is mostly "ASCII as sprites" with a few geometric compositions to represent game objects. Hopefully I'll be able to add more game-specific sprites once the gameplay and narrative features are more sealed in.
For the programming I'm very much following a "make it work, then make it clean" process, or what Casey Muratori calls "semantic compression". This is pretty much writing whatever code does the job in place, and then factoring out the appropriate structures and functions as they become apparent. This also involves the gratuitous use of Magic Numbers, plenty of void* allocations all up front (don't give me that look), and global things which probably should not be global things :)
The sprites are rendering and the player can move around via WASD keys so I'll call this week a win. Week 2 I'll begin refactoring everything into a more modular system. Sadly no write up yet, I want to make sure everything is set before starting in on that. Tried doing it in tandem with the game development, and the result was way too wordy and with a lot of backtracking. I'll add it to this week's ToDo list with the entity, map, and rendering parts.
1
u/justjr112 Jul 14 '24
Quick update is the place to post questions?
1
u/EquivalentFroyo3381 Jul 14 '24
hi everyone! i have been out here for a good while, and i want to get back into RL dev since a while, and this is a prefect time as ever to do it :D, i hope i can get some replies here and join this :D
0
u/[deleted] Jul 11 '24
[deleted] — view deleted comment
0
u/[deleted] Jul 10 '24
[deleted] — view deleted comment
0
u/[deleted] Jul 16 '24
[deleted] — view deleted comment
0
u/[deleted] Jul 14 '24
[deleted] — view deleted comment
0
u/[deleted] Jul 14 '24
[deleted] — view deleted comment