r/roguelikedev • u/KelseyFrog • Jun 28 '22
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. :)
17
u/HexDecimal libtcod maintainer | mastodon.gamedev.place/@HexDecimal Jun 28 '22
I'm working in C++17 and doing the ancient C++ tutorial on RogueBasin. I'm starting from the libtcod C++ template and plan on using the latest libtcod features rather than the older ones taught by that tutorial. My new repository is here.
This means I've pretty much joined everyone else who was trying to rewrite the C++ tutorial code. I dropped from most of the projects I was following since no one could keep the continuous integration running and chose to break portability rather than keep the CI workflows. As long as the CI passes the project will work on all platforms including HTML deployment.
I'm trying to use what I've learned from the new Python tutorials, but anything I change is going to make it harder to follow the tutorial. We'll see how far I can get with this attempt.
Good luck everyone on the Python tutorial! I'll be around helping people out here and on the Discord. I don't recommend doing the C++ tutorial.
13
u/Kyzrati Cogmind | mastodon.gamedev.place/@Kyzrati Jun 28 '22 edited Jun 29 '22
Welcome, everyone, and good luck! The initial announcement has the introductory info if you missed it.
Other notes:
I will start updating the directory this week, but if you join in later I can add you then, just post your info in the threads to be included :D
Edit: 27 participants declared in the first 24 hours, so far 16 with repos added to directory.
9
u/snowball_dev Jun 28 '22 edited Jun 29 '22
Decided that this was the best time for me to start learning the new Godot 4 alpha, since it has some cool new features like an improved scripting language (now has lambda's and map/filter/reduce) and tilemaps that can include custom data.
I have a week off right now, so I probably won't follow the week structure, but here is part #1:
repo
If all goes well I plan to create a tutorial series about roguelikedev with Godot 4, as the current Godot tutorial is using Godot 3 and only implements half of the features of the libtcod tutorial.
7
u/redblobgames tutorials Jun 28 '22 edited Jun 28 '22
TL;DR: going to try something more "fortress mode" and less "adventure mode" this year.
Two years ago I went through the summer series with JavaScript but following the Python tutorial v1. My goal was to understand the material better by being forced to reimplement everything in Javascript, since I couldn't copy/paste the Python code. It worked pretty well. Then last year I decided to go through each chapter but try to implement it differently, and I got only partway through. I implemented thin walls, openable doors, a different map generator, a different FOV, sprite graphics, animation, and planned to do more, but I was a bit too ambitious.
This year my initial plan was a bit ambitious but remembering last year, I'm trying to pare it down. But my main idea is to do something more "fortress mode" and less "adventure mode". I haven't figured out details yet. But I think at the very least this means I need friendly NPCs, no FOV, more pathfinding, digging/building, and no dungeon generator. I'm going to stick with making it browser based, as I was quite happy with the way it went last year.
5
u/[deleted] Jun 28 '22
I haven't used git before, so this was a weird process getting that all setup.
Going with some old-school c. Decided to use SDL for the lower bits, will see how it goes.
Only recently switched my main PC to linux, am loving it so far, if you know how to get SDL running then the code should work for windows, but honestly I didn't even attempt to try it.
git repo
Very_Exciting_Screenshot
5
u/cordinc Jun 28 '22
Hello everyone. Roguedev newbie here using Javascript with the rot.js library. Haven't used js in over 20 years and wanted to learn again, so this is great. Well done to the organisers.
So far I'm following a mix of various tutes including the python one and codingcookies. At the moment the code is largely copy&paste in a cargo cult style. Hopefully I can clean it up a bit as this goes on.
Anyway, week 1 is here and a "playable" version here.
5
u/deathm00n Jun 28 '22
It has been some time since last I programmed in Python (have been working with Java for some time), so I decided to follow the tutorial as is. But I have seen some code that I don't think I have seen before, can someone confirm that I understood it correctly?
I tried to search what exactly the "->" means and "action:" with a colon like that. What I found is that this is a way to hint at a variable type? So in the function declaration it is saying that this function will return an Optional[Action], correct? What about the second line? It reminds me of a ternary if, but it is probably not it. Does it mean that action is a variable that is supposed to be of the type Optional[Action] and if it is not that type then it receives None? Or is None the initialization value?
5
u/Gogodinosaur Jun 28 '22
I wanted to try to create a hexagonal based grid for a roguelike. I know C# and Unity, so I decided to just use those and try the new type of grid.
So far, I've implemented the @ symbol movement on the hex grid. The project is on Github.
Here's a gif of the initial movement.
4
u/JasonSantilli Jun 28 '22
I was a little early to the party this year and started following along a few weeks back. We'll see how long I can stay on pace with the amount of free time I've got. I'm following along in vanilla js using rot.js.
Link to my completed Part 1
It's been interesting trying to work around the problems that come up when working off of the libtcod python3 tutorials and trying to translate to what makes sense in JavaScript and the slightly different implementations of the helper functions in rot.js. I've found myself spending a lot of time getting a basic prototype down and then fully refactoring large swaths, so I'm not sure my milestones will be all that great to follow, but I can't recommend the Coding Cookies blog listed in the sidebar enough (Link to part 1). It doesn't really follow the same tutorial structure, but has been great for helping me better understand the ins and outs of rot.js, especially where the official documentation can be a little lacking. Later tags in my repo certainly have taken a lot of inspiration from the structure this blog lays out.
Looking forward to getting further along in the series and seeing how everyone does!
4
u/Bubbly_Knee_2433 Jun 28 '22
These FAQ posts really hype me up when I see the possibilities!
4
u/goose-rails Jun 28 '22 edited Jun 28 '22
Hi all!
I received my Playdate last weekend and have fallen in love with this quirky little handheld. Coincidentally, my first 7DRL a few months ago was a Game Boy-inspired mini roguelike shmup. I think I am just in love with retro handhelds.
Thus, I am going to make a more traditional roguelike for the Playdate, with as many features as I can cram. It’s going to be a challenge considering the size of the screen and that there are only two buttons and a crank, but that will only make it more fun.
So far, I have a character drawn to screen and moving around with the d-pad. Nothing very exciting to show just yet.
Forgot to mention that I’ll be making it in Lua, which I’ve never used before. I’m trying to follow the Python tutorial but some things are trickier (mainly the fact that Lua doesn’t have classes).
4
u/candyleader Jun 28 '22 edited Jun 28 '22
Ok so I've started! Not quite finished week one yet.
Using Python but because I can't possibly make life easier for myself I'm using the Esper ECS package to spin it out in my own special way.
Repo is here: https://github.com/lefishy/rl2022
Thinking about going very non trad and making a crafting/survival game but we'll see. That sounds difficult hahaha
edit: Finished week one now. Not sure I like the event dispatching stuff for input. Can someone more experienced than me tell me if it gets changed down the line? Otherwise I'll try to work out my own system.
4
u/luismars Jun 28 '22
First time sharing something here!
I usually develop in C# with Monogame but I always find the process of downloading an executable for a game from some random dude from the internet a little bit dangerous/tedious. So I decided to try to make something with C# and Blazor, no webgl, no canvas, nothing too fancy, just plain HTML and wasm.
Also I always wanted to try GitHub Actions so this was a good chance to try them!
Right now it only uses WASD to move, but I'll try to add some form of mobile interaction in the future.
Here is the repo.
And here you can see it in action.
4
u/mrdoktorprofessor Jun 29 '22
I've done this tutorial a few times now and always pick up something new from it.
I've been working on a JavaScript one separately that may or may not see the light of day, but for academic/research work I've been playing with LED matrices.
No promises, but I will try to make an honest effort to get through this using a 64x64 Adafruit LED display, a raspberry pi, and an 8bitdo NES30 controller.
I have a basic display running and will start porting over the tutorial into my setup, but wanted to make a post here to keep myself honest.
The biggest issue is the Flaschen-Taschen sw (for talking to the matrix) runs on Python 2.7, so I have to use old syntax for now until I make the effort to update that repo.
Pic!
Repo will be open sourced and follow the tutorial as close as I can!
4
u/LukeMootoo Jun 29 '22
Hi all!
I'm trying this in native JavaScript, will see how it goes! I don't really know how to write code, but I attempted the CodingCookies and the Broughlike tutorial previously and "learned" some things. Where by "learned" I mean "copied".
I've had some difficulty implementing the class templates described in the tutorial and instead used simple functions for most things. Also, despite CodingCookies best efforts at teaching, I still don't really understand how to make namespacing work so I have too many things in the global scope.
I have a gitpages landing page here and it links to my notes on part-0 and part-1 and you can see the results here and here. Finally this is the repo
Major shout-out to u/JasonSantilli who's code is amazingly clean and a huge inspiration. He has successfully implemented a lot of the tutorial instructions that I could't quite figure out and I took shortcuts for, and I keep looking back at his trying to find ways to improve myself.
4
u/lagdotcom Jul 01 '22
Hello everyone! I'm back again this year with an even sillier plan than using Forth or WebAssembly. I'm writing my own language! I have little experience with this so I'm sure it will be a mess by the end, but that's fine.
The repo is at https://github.com/lagdotcom/rlscript-jsdriver and you can see the latest build at https://lagdotcom.github.io/rlscript-jsdriver/
If you want to see that actual game code, it's in the file called "week1.rl" for now. GitHub has informed me that extension is already used by something called Ragel so I'll have to come up with another one and perhaps a better name for the language than "RLscript".
3
u/Zuburg Jun 28 '22 edited Jun 28 '22
This is my first time actually coding something properly, so I'm excited to see how it goes!
My Repo link
I'm using the Python 3 libtcod tutorial. In my excitement to get started, I already completed up to part 3 today, but I had a few questions:
I started learning Python about two weeks ago, but I find I understand less than 1/3 of the code I'm writing from the tutorial, should I go a lot slower and wait in till my Python is good enough to understand what the hell I'm typing out?
After completing part 3, my "game" was flickering insanely, and I pretty much panicked and replaced my code with copy pasted tutorial code. I now know that was a bad idea, because I've no clue as to how it was bugging out, so I never learnt what was wrong (its fixed now because of the copy pasted code). for future reference any idea what would have caused it to flicker?
I look forward to seeing everyone else's games!
3
u/SupremeChlorophyll Jun 28 '22
New year, new summer tutorial! Woot! I learned a lot last year, but got stuck at the code re-factoring stage in week 4, so I plan to follow along more loosely this time, using PuzzleScript.
Link to repo.
3
u/[deleted] Jun 28 '22
Joining this year in C++, using SDL library for graphics rendering and the MDA 9x14 tileset from the Dwarf Fortress Tileset page. Building on Windows. Have a local git repo going, will be uploading to github in the near future.
3
u/revokon Jun 28 '22
My Repo
This year I've decided to follow /u/Kyzrati's advice that the best language to make a roguelike in is one you know well, and decided to use plain old Java with AsciiPanel. Of course this does mean that, compared to libtcod, I will have to do my own implementations of things like FOV and pathfinding, but that will just be a part of the fun.
So far I've just set up the very basic stuff, and part 1 should be finished soon.
3
u/knaveightt Jun 28 '22
I'm excited to join this year! Had actually started this a few weeks ago when I found the 2021 threads, so am a bit ahead, but am going to pace myself for the duration of this series and join in on the discussion as we go!
Here is my repo link for this series. I am using python and pretty much following the tutorials to a tee. I plan on adding my own flavor of things (colors, creatures, items and entities) towards the end as I get my grips on how the engine is shaping up.
The one thing that stood out to me in these beginning parts, is this is the first time I utilized virtual environments for python development - can definitely appreciate the usefulness of this and plan on expanding my understanding of using venv.
fwiw, my first experience in roguelikes was playing ADOM with my friends back in grade school. Seeing an @ symbol on the screen from my own volition was already pretty nice :)
3
u/WorksOnMyMachiine Jun 28 '22
Python Follow-Through
I am going to use multiple languages this year. I am going to follow the python-tcod tutorial since I already started it a week back so that will be my main project.
I am choosing a second language but I am split between c# or java. Depends which is easier to setup, I was having issues with SadConsole on m1 mac and it looks like it wont be supported until the next release of MonoGame.
Can't wait to see what you guys build! Lets goooooo!
3
u/caliskor Jun 28 '22
I'll have a go this year with GML (Game Maker Language). I don't think I'll stick to the order of weeks' themes 1:1, but I will definitely use it as a guideline. My repository can be found on Github. For now I will use sprites instead of glyphs, since this way of doing things is more familiar to me, but maybe at some point I will switch to using a custom font.
As of now I have a moving character, and some basic collisions with walls. My plan for Week 1 is to focus on setting up different tile types, and add the cost of movement.
My prototype is set in a post-apocalyptic world, so traveling depletes Player's stamina, food, and water. Resting will replenish the stamina, while hunting and gathering will restock resources. The system will not be too fancy for now, as I want to avoid feature creep.
3
u/programmer_owl Jun 28 '22
Decided to follow along with the event to dip my feet in roguelike development. I'm using C, libtcod, and flecs as my main technologies. I'm using the Rust Roguelike Tutorial since it mirrors the Python tutorial, but uses an ecs.
Github repo
3
u/bobalop Jun 29 '22
So I started on the tutorial (libtcod python) with my son and we made it all the way thru the refactoring part and the game compiles and we can run around and everything functions correctly except the char isn't drawn to screen anymore. I was wondering if there might be a simple solution to what might be causing this or if there might be a particular part of the code I should look at to fix this. Thanks in advance!
3
u/glitchdot2 Jun 29 '22
Many times, I have tried to finish python3 + libtcod roguelike tutorial. I believe this group tutorial will keep me motivated till the end this time :)
3
u/WorksOnMyMachiine Jun 29 '22
Hey guys! Wanted to come back and say that I was able to setup my second project to follow the tutorial. I am using libGTX, libGTX-KTX, kterminal.
Finally got it working and I can move the `@` symbol around the screen. Looking forward to the next weeks!
As before, I have my main project in Python and this side kotlin project is just to have a little challenge to learn another language
Java Repo Python Repo
Any feedback on my java setup is greatly appreciated. I have zero idea what I am doing and just scoured the web for stuff
3
u/bodiddlie Jul 04 '22
I've posted Part0 and Part1 of my rework of the tutorial for ROT.js up on my blog now.
My plan next is to do the Python versions of Part 2 & 3 this week for myself, implement those in ROT.js, and then do a write up. We'll see how long it takes since the tutorials get a little more involved as we go and adapting the code plus writing the prose around them takes a while. I'll update in this weeks coming thread as it goes.
3
u/FratmanBootcake Jul 04 '22
I'm slightly late but only decided to have a stab at this this morning. I'm going a slightly different route, and it's one that will certainly mean I either a) fail to complete the tutorial (I think highly likely) or b) make much slower progress and produce a much simpler game.
Anyway, here's the link to my moving '@' character.
The route I'm taking is that this is coded in my own assembly language which is being run on an 8-bit cpu within a fantasy console I've made that's reminiscent of the 8-bit Nintendo and SEGA eras. I have a total ROM size of 64KB to work with and a whopping 8K of RAM. I'm currently rocking 400 bytes to get that '@' moving round the screen.
I'm quite interested to see how far I can get with this. Even making a simple random dungeon seems like it'll be quite the challenge!
2
u/codyebberson Jun 28 '22
TypeScript + WGLT
Repo
Demo
2
u/Cylog Jun 29 '22
Little bit late to the party ... all participants seems already so far in the area. (I thought we weren't starting until the 28th, now understood that you basically work in the week before).
To the project itself:
I'm programming mainly at work and during sparetime with visual studio c++/c# (since vs 6.0 before that with borland c++/pascal - both are wonderful ide's). I would always try to test visual studio code, mingw, cmake ... 'cause I never used it really before. I would always check working with gcc. And I have no direcct access to linux or mac, so with cmake everyone can test my code.
Basics:
Technical:
First thougts:
It is absolutely motivating to tread a path together with so many people. VS Code takes some getting used to and is a bit of a bitch at first, but by now we've both gotten along quite well. gcc is an exceptionally competent compiler. CMake is ... difficult. On the one hand the documentation is lousy and some normal build tasks can only be done in a roundabout way, on the other hand it is a defacto standard for c/c++ projects and really very powerful.
Considering that I've only been sitting on it for two days (and had a gastroscopy this morning), I'm quite happy that everything works so well.
2
u/makraiz Jun 30 '22
I'm following along in two projects, and have completed parts 0 & 1 in each so far:
I haven't worked with Python in years, and I decided to follow along with the Python tutorial as a refresher. Python Repo
I also decided to try to follow along with Rust & Bevy. I'm just winging it, but I will try to keep pace with the Python tutorial week by week. I don't know how far I'll get, but at least it's a fun exercise, and I get to work with my favorite language. Rust Repo
2
u/[deleted] Jun 30 '22
Going to give this a go with Zig and see how far I can get. I regularly work in Java/Python/JS but haven't used a systems language in years. Interested in seeing how this compares to C. Finished parts 0 & 1 and working on describing the changes in readmes as I go.
Repo is here: repo on gitlab
first screenshot
2
u/old_chmee Jun 30 '22 edited Jun 30 '22
I tried this tutorial ages ago and want to try it again. My goal is to play around with different types of map creation with prefabs and switch between rooms/dungeon and overworld. Maybe if there is time i would also like to experiment with some npc character interaction to get some story telling in as well.I am looking forward to this challenge and hope i can free up as much time as possible for this project.
git repo
2
u/KCEHOBYTE bedivere Jun 30 '22
Hi all, very excited to be here! I've been wanting to take part for years :]
On one of the hackathons, we used this pretty great terminal C++ FTXUI library and despite the fact it's not a perfect fit here I'll try to stick to it this year.
I make a living with C++ so here I'll try to have fun with some cool C++20 features and since I'm not using a roguelike library there is a lot of tricky stuff I'll have to implement from scratch!
For starters, I more or less implemented Part 1 and Part 2 from the old roguebasin C++ tutorial, next step would be dungeon generation, I'm going to port some code from python tutorial to do that.
Here is the repository with the code AND I managed to compile it into Webassembly and host it to be accessible online (this technology still sounds like magic to me).
I wish all of you folks a great event and happy hacking!
2
u/bodiddlie Jul 01 '22
Doing the standard python tutorial to get a handle on it, and then working on translating to TypeScript and ROT.js. Hoping to write it up on my blog, but it's been 3 years since I posted and it's an old gatsby blog, so of course I can't spin it up locally anymore lol. Thinking I might also have to rewrite my blog.
Part 0 code is up here.
I'll get Part 1 code up tomorrow hopefully.
2
u/luxury_yacht_raymond Jul 01 '22
I am, for now, following the tutorial using Python but intend to deviate at some point as I have Ideas (but I have no set timeline nor a-must-reach-goal in mind). I am long time programmer in very many languages across platforms, paradigms etc. Tcod is new to me but it looks and feels very nice. Up till now I have done (last night) parts 0 and 1 and intend to do at least few parts during weekend.
2
u/reuben-john Jul 01 '22
I'm working on learning both game development and Rust via "Hands-on Rust". I ran through one of the old Python roguelike tutorials years ago, but never did anything with it beyond that.
I'm targeting web using WASM so that I can easily share it with whoever.
Code is available at my github repo
Play live in browser
2
u/stevenportzer Jul 02 '22
Meant to respond to this sooner.
This year, like last, I'm following along in Rust. Different from last year, I'm taking this opportunity to rewrite all the code I'm been copying from project to project to hopefully make it less hacky. Right now I have the @ moving around in a terminal just fine, but I'm still working on rewriting the WebAssembly wrapper to get the @ moving around in a browser.
During the later weeks of the tutorial I'd like to prototype some game engine ideas and maybe finally separate out all the map generation code into a reusable library.
2
u/deathm00n Jul 03 '22
A little late with the repo, but here it is repo
I am following the tutorial as it is. I have not used python in some time and I liked it when I used it, so will try to learn with it.
Had some issues setting up the repository, since I usually just work on old code that already have a repo set up. But now I think it is ok
2
u/haveric Jul 03 '22
I'm excited for another summer of building roguelikes and this year I am challenging myself once again by implementing a hex map. I plan to re-use a lot of my previous years' infrastructure, but adapt it for hexes and improve upon it as I go. It's already proving to be an interesting challenge, but I'm hopeful that once I get the infrastructure going, it will be fairly painless.
Repo | Demo (Numpad movement) | JavaScript (hopefully zero libraries other than build tools)
2
u/UnidenFighting Jul 05 '22 edited Jul 05 '22
Late to the party but just pushed my initial implementation to GitHub.
I am using Rust with the Bevy game engine. I will be loosely following the libtcod tutorial while drawing heavy inspiration from the great Rust RL tutorial by Herbert Wolverson and taking some liberties elsewhere.
This is my first time participating in such a coding event and my goals are to
1
u/[deleted] Feb 11 '23
I'm trying to give this a try, but I think I setted something wrong, it doesn't found the ejavu10x10_gs_tc.png file
0
u/[deleted] Jun 30 '22
[deleted] — view deleted comment
0
u/[deleted] Jun 28 '22
[deleted] — view deleted comment