r/roguelikedev • u/aaron_ds Robinson • Jul 06 '21
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. :)
7
u/TechniMan Jul 06 '21
Oh man, is it this time of the year again already? Although I remember not getting too far last year, apparently my repo from last year got all the way to the end of Part 9 so I'm impressed with past me. So I'll probably spend a couple of weeks re-acquainting myself with it and trying to personalise the game a bit more with ideas I had (a whole year ago AGHHH time keeps moving on) before the weekly thread gets to Part 9, then carry on with tutorial progress.
My inspiration last year (and again now, since I haven't done any roguelikedev since) was Diablo (the first) so having things like a town at dungeon level 0 (and town portal scrolls), dungeon maps larger than the screen and character stats are where I'd like it to go. A good start would be to add a readme so I can keep notes of these planned extra features! Currently it's not too far off of the tutorial code, so hopefully with some time now I can spice it up.
11
u/[deleted] Jul 06 '21
So I've made two projects, where one follows the tutorial to the letter, and the other is my attempt at branching out.
In the latter, I want to change map generation to be more like Spelunky/Isaac/etc, where it sets up a grid, then procedurally fills that grid with rooms from a list. (In this case, an external text file.)
I've found people looking to do the same on this sub, and one from the Paper of Isaac project, but the former tend to get solutions that apply to the 2019 tutorial, and the latter uses something not Python, so I have no idea how to convert it.
Any thoughts?
9
u/HexDecimal libtcod maintainer | mastodon.gamedev.place/@HexDecimal Jul 06 '21
Parts 2 and 3 of the 2021 refactored Python tutorial are up.
I had a hard time with this. I spent a lot of time working on part 2 and then didn't have enough time to change the dungeon generator in part 3.
I ended up replacing part 1 with new code so that it would only need the
main.pyscript. The changes from later on in the old tutorial back-ported to earlier parts have turned part 2 into a larger than usual section. I don't know how easy it'll be to follow.In theory everything after part 2 should be easier, but I feel like not doing much work on part 3 might have made it harder to update the later parts, or at least harder to really improve them from the previous tutorial.
It's unclear what I should focus on right now.
8
u/anaseto Jul 06 '21
This weeks' parts 2 and 3 are ready in the gruid-rltuto version of the tutorial in Go.
With respect to entities, I went with a more ECSish system than in the TCOD tutorial, handling map positions in a component-like way, though for simplicity entity graphical representation was left to the entities themselves. No special generic ECS libraries (which often come with more dynamic-like typing in Go), though, just normal hand-made Go code with normal static typing.
For map generation, I opted for a different kind of algorithm than in the TCOD tutorial, because it seemed simpler at first to just use one of gruid's map generation algorithms (like cellular automata generation): maybe I'll add an extra part at the end with more map generation stuff (including placing and connecting prefabs within a procedurally generated map).
The next two parts should be ready for next week!
8
u/Jarlish Jul 06 '21
Rust + bracket-lib Week 2
Play the latest build in your browser: link
GitHub: [link] (https://github.com/Jarlish/rogueliketutorial)
This week was a bit frustrating.
I spent two whole days trying add sound to my project because I thought it could be fun. In the end I had to scrap the idea. None of the major sound libraries for Rust would work with WASM.
Despite this I am enjoying Rust so far and is has definitely been an educational experience.
After giving up on sound, I moved on to adding the rest of this week's features. The major thing this week was the map. I went ahead in the tutorial a bit to add a camera that is independent of the map or terminal size (maps are 100x100 tiles for now). I also added basic map depth / stairs so I could test multiple map generators.
So far I have added the basic rooms and corridors map from the tutorial as well as a cellular automata map.
In the coming week I will work on implementing FOV, enemies and basic combat, and maybe the user interface. I also plan on tweaking the visuals such as the font and color palette just for fun this week.
I am looking forward to seeing how other people's projects are coming along in this thread.
8
u/mrhthepie Jul 06 '21
Part 2 - Generic Entity, Render, & Map
Sticking fairly close to the Python tutorial for Entity stuff, not too much to say about that.
Rendering is obviously significantly different. The actual rendering code is very quick and easy using the Pico-8 api. Entities store a sprite index instead of a colour and char code which gets rendered out at their position.
As for the map, I did implement code in the style of the Python tutorial at first, but I quickly threw it out in favour of using the Pico-8 builtin tilemap. This has various advantages. Save on code size since it's already setup and available to use, rendering is one function call to map() (at least for now, FOV will complicate that a bit), and I can use sprite flags to conveniently store tile attributes. Up to 8 flags per tile should be enough to get on with. Also, for this initial stage I can just create the map in the editor rather than hardcoding the coordinates as the tutorial does. (Once we get to dungeon generation, that will just write to the map with mset() and nothing else will have to change).
Part 3 - Dungeon Generation
Not too much to say about this chapter, I mostly just followed the tutorial. Just adapting the code to use mset() to write to the Pico-8 map, and to make sure I don't make any off-by-one errors due to Lua's preference for 1-based stuff over 0-based.
Gif of part 3
7
u/usami33 Jul 06 '21
I'm fully motivated for another week!
I implemented the BSP dungeon, released NPCs (rats) into the room, and installed doors.
Here's a general view.
I've also created animated sprites for movement and waiting.
I had a lot more work to do, but a week goes by fast.
6
u/Notnasiul Jul 06 '21 edited Jul 06 '21
Finally, count me in! Doing it with plain Python and Pygame (here's the repo), no tcod. Call me crazy.
I'm following the tutorial in a loose way - to keep me in track with things to do, basically. My code is a bit different:
I'm a bit ahead, with FOV working and a creature we can kill moving around, because I wanted to test all this. I'll use the spare time to refactor a few things I'm not too happy with!
6
u/Kehvarl Jul 06 '21
RoguelikeDev-2021(Common Lisp + BearLibTerminal)|Repo
Last week's progress went smoothly and put me in position to begin a more structured approach this week.
Part 2 - Generic Entity and Map
Screenshots in Repo.
Jumping a little ahead of the tutorial my Entity and Game-Map have their own files. There's nothing particularly exciting about either implementation yet: The Game-Map is a fancy array of tiles; while the Entity is currently just a position, symbol, and color.
5
u/TouchMint Jul 06 '21
Thanks for this! Working on my first!
5
u/Mangachh Jul 06 '21
Here we go, Week 2!
Last week I had some time off, so I'm nearly done with this week.
I've created a project's page where I post some videos and devlogs, nothing fancy. I'm using godot and C# so I'm only following the themes of the main tutorial but, so far so good.
5
u/j0ono0 Jul 06 '21
Working a bit ahead of the schedule at the moment. I've wrapped up the basic dungeon creation but wanted to explore some more map/environment generation techniques so tried out a Cellular Automata Method using the '4-5 rule'. Numpy made things pretty easy :D
The second map triggered some attempts at alternative folder structure. The outcome has been to rearrange things into a Python package.
https://github.com/j0ono0/roguelike_2021
5
u/iamgabrielma Ad Iterum on Steam Jul 06 '21
I just created the GitHub repo.
For now I just followed the week 1 and 2 almost identically to the tutorial, except that I'm adding Unit Testing via Python's `unittest` module. I'm still thinking about the game's theme :D
5
u/CarnivalTears Jul 07 '21
Joining in for the first year. After a couple unfinished 7DRL's I figured actually knowing what I'm doing may be beneficial :)
Repo: https://git.sr.ht/~mattherman/roguelike-dev-tutorial
5
u/CarnivalTears Jul 07 '21
Can someone explain this code from the tutorial to me?
engine.game_map.tiles["walkable"][dest_x, dest_y]I understand that the
[dest_x, dest_y]is the index to lookup in thetilesarray and["walkable"]used on thetile_dtstruct should get you the walkable bool, but why is it in this order? I would have expected it to first lookup the specific tile and then grab the bool, but the ordering makes it look as if it is the opposite.I'm new to Python and NumPy so my confusion likely stems from one of those (or both).
4
u/PhyrexStrike Indie Dev | C++ Tutorials Jul 06 '21
Hi all, currently working on getting the documentation parts of the Modern C++ tutorials ready, but here is the repo for the code so far:
Modern C++ Tutorial code
And here is the pages for the tutorial (currently bare, front-end and documentation are both not my strong suits ^^;):
Tutorial pages
I have the code for Tutorials 0 and 1 from last week done, currently working on fixing up 2 & 3 for this week and writing up the tutorials themselves!
4
u/pnjeffries @PNJeffries Jul 06 '21
START OF THE SECOND WEEK:
I think the overall theme of this project is going to turn out to be 'making a simple roguelike the most complex possible way' and this has been borne out in my first week, which has mostly been spent fighting with Unity trying to get a WebGL build to work. This is problematic at the best of times, but was made worse in this instance by my choice to resurrect some of my old roguelike engine code and to link it to Unity objects using my own reflection-based WPF-style binding library. This all worked beautifully in the editor, but as soon as I built a WebGL version suddenly my '@' was no longer in the right place and wouldn't move. This was very weird because other things, which were relying on the exact same code, were working fine.
It took me basically all of the last week to figure out what was going on and fix it, but in summary the key facts in the case are these:
This is essentially a perfect storm of intersecting silly nonsense, but in the unlikely event anybody else has this same problem; the solution is to give Unity a 'Link.xml' file that explicitly tells it what types and members you specifically want Unity *not* to throw in the bin while building.
I feel this may be the most pain anybody has ever gone through in order to get a single '@' moving around a screen, but long story short I now have a single '@' moving around a screen, and a deeper appreciation for the intricacies of Unity's build system.
Here's what that looks like. Current plan for the visuals is to go for ASCII with a 'synthwave' style somewhat inspired by the box art of the original Rogue.
4
u/Bleu-Bell Jul 06 '21
Just finished rendering my tiled map, iterating through ArrayLists in Java is definitely more verbose than it is in numpy. My 32x32 textures are tiny tiny, so I'll have to remember to zoom the camera in at some point.
Repo: https://github.com/yuxuwu/roguelike-tutorial
4
u/ISvengali Developer Jul 06 '21
Falling slightly behind, but not too badly.
I wasnt happy with any of the console options for C#, so Im putting together a simple tilemap in SFML thats aimed at this particular RL. I really want 24bit color output for lighting effects later like torches and such.
So, Im building that this week. I slept most the 3day weekend we had in the states.
4
u/billturner Jul 07 '21
I'm giving this another try. I went through the tutorial a couple of years ago, and actually added a bit more to my game. But this year, I noticed the tutorial changed a bit, so I thought I'd give it another try.
I'm going through the Python/TCOD tutorial, and my repo is here: roguelikev2
4
u/Shidima Jul 07 '21
Following along, my part 2 (And 3):
https://github.com/christiaan-janssen/RogueLikeRust/tree/part-02
4
u/the_phet Jul 07 '21
I think there's a small mistake in part 2, or something I did wrong.
When the main is updated with the new engine.py, the line
context.present(console)
should also be removed. But it never appears, in or out.
4
u/Many_Slices_Of_Bread Jul 07 '21
Very exciting! I just finished Part 2. Shall do part 3 later this week. Looking good, and my rudimentary C# knowledge is helping me along. Screen is flashing a bunch when the game runs, due to the background being blue. Do you guys just deal with it, or change to a black background to get rid of most of redraw flash? Or it there a fix later in the tutorial?
4
u/RivalRoman Jul 08 '21
I managed to get through this week's tutorials, which I followed to the letter but had a lot more trouble with than last week's (mostly due to the fact that I have virtually zero coding experience and kept forgetting/misplacing a period/comma/colon and then having to comb through each line a million times to find the error etc). However, they're done and I'm having fun on the whole.
I think over the rest of the week I'm going to try and mess around with a few things to try and branch out a bit from the tutorial. One of the things I'd like to see if I can get working is different room shapes. We'll see how that goes.
Eventually I'd like for there to be multiple maps (my game takes place in a city, so regions like uptown/downtown/the harbor/etc). I don't think I'm ready to actually try to implement anything yet, but I don't really know where that sort of thing would start. Any tips or places I can start looking to figure that out? I have some very vague ideas that involve making a new file with the different colors and room sizes etc of each region and then somehow pulling those into main/some other already existing file? I'm really not sure.
One last thing I did this week was play with the colors a little bit to give them more of a city feeling.I'll probably keep fussing with it over the next few days until I arrive at a color scheme I like enough to leave alone for a while.
Here's my repo: https://github.com/RivalRoman/rogueliketutorial2021
4
u/ender1200 Jul 08 '21
link to repo
Finished part 2.
I plan on working on part 3 during the weekend.
I mostly followed the tutorial for this part, with some additions for the screen scaling features I added.
Besides that, I played a bit with adding all sorts of tiles and making a small prototype of a sewer map.
Note that the game .exe in my repo isn't up to date.
4
u/Zach_Attakk Jul 08 '21
So far it's pretty standard stuff. I'm actually quite happy with how things are going. This time I feel like I understand what's going on more than before. It might be that I understand python better, it might be that I'm more in practice with my programming habit of late, might be that it just feels more fresh and I don't remember understanding this last time. Either way, it feels like it's less complicated.
Screenie
Repo
4
u/avinashv Jul 09 '21 edited Jul 09 '21
Rust + Rltk
Repo | Tutorial
I started this in Haxe and Python, but saw a bunch of people using this Rust tutorial and took the opportunity to switch to this because I have been meaning to learn the language and getting a Roguelike at the end of it seemed like a pretty great bonus. The repo has a log in the
READMEthat I have been writing thoughts in as I go along.I'm working ahead of the progress of the
libtcodtutorial because I'd like to get a lot of the stretch goals of the tutorial done by the end of the weeks.I bought the author's book but honestly I prefer the online tutorial since it eventually has a lot of interested stretch goals to make a fully-fleshed out game.
I spent a bit of time implementing the module imports as the book does, but otherwise it's right out of the tutorial. I would love a Github action to automatically push a WASM build to GitHub Pages (and asked this subreddit as well) the way that the Haxeflixel guys have done but I really couldn't figure it out. I have a YAML file that works partially but I don't know where to go from there. Any help would be appreciated.
4
u/squizm Jul 09 '21
Here is my week #2 progress using GameMaker. I finally sat down and got the camera working to zoom and pan with the player properly. Also, I wrote a bunch of functions to help with the tilemap referencing and usage.
GIF - https://imgur.com/a/EAoyORm Repo - https://github.com/squizm/Resistance
I have a pretty good idea on how to implement FOV next week using bresham's line algorithm and surfaces. We'll see how she goes!
4
u/SupremeChlorophyll Jul 10 '21
Repo
Screenshot
(Python 3.9 + libtcod)
As a Python beginner the second week went more smoothly than the first; once everything was set up the tutorial is easy to follow. Right now I'm mostly trying to understand the general logic of how things work in Python & how everything fits together, so I'm not changing too much yet, just following along.
During 'Part 3: Dungeon Generation', I wondered if the dungeon generation method we're using in the tutorial has a name? (I looked on RogueBasin here but couldn't find a corresponding method. Apologies if I'm asking obvious questions.)
Looking forward to next week!
3
u/rentheunclean Jul 07 '21
I worked a bit ahead, because I expect to have less time going forward. My project has advanced up to part 5 of the tutorial, so I have some basic monsters and map generation going. I like the tutorial and am seeing a lot of things I could get distracted by, but I want to try to commit to working through this before expanding my scope.
I am looking forward to doing a bit more this week!
Repo
Notes
3
u/haveric Jul 07 '21
Untitled 3d Ascii Game
Repo | Play | Gallery
Language: JavaScript
Library: Three.js
This has been a very productive week for me. I was able to get basic saving/loading implemented, which currently just stores a single map to localStorage. Each entity and component is iterated on and determines what to save for themselves, so this should be very extendable. I've also implemented a basic editor, which I am hoping to expand to the point I can customize a map and export prefabs. So far the editor can only select an entity which shows that entity's data and will let you change the scale (0-1), as well as delete entities.
I was able to get a huge performance boost from caching my geometries, especially those created as ascii characters. You can see this by pressing 'r' to create a new map and 'f2' to reveal the entire map. Both should happen near instantaneously.
I also played around with converting this year's logo into a map. You can see that by pressing 'f4' and then 'f2' to reveal the map (or looking in the gallery above). I currently have 'f2' tied to enabling the editor as well, but I'll probably be moving the functionality to reveal the map somewhere into the editor in the near future.
I'm really excited by the look of this project so far and can't wait until I get the editor to a point that I can create some static maps and play around with creation easier.
3
u/kevio17 Jul 08 '21
Just finished part 2 - I didn't post my repo last time so here it is.
First time following along anything like this so I am very much going line by line with the tutorial! Hoping to use it as something to build on as I get more familiar with both python and the developing of roguelikes.
3
u/TeamRamrod Jul 08 '21
Part 2 - Manual implementation
Avoiding using GoRogue features here lead to some slightly awkward code in rendering - without straightforward interface to copy an array of background tiles over and render in layers, I wound up manually cloning the background and modifying it to the foreground. Maybe could have avoided this with entire separate screens?
Part 2 - GoRogue implementation
Much prettier. Used map gen pipeline to add the test wall.
Part 3 - Manual
Fairly straightforward. Reinterpreted the Inner definition as a collection of points, as the slice concept doesn't translate to C# very well.
Part 3 - GoRogue
Used GoRogue's Generator pipeline system to separate out the map gen into 3 steps:
3
u/menguanito Jul 08 '21
Week 2 semi-finished! :)
My repo: https://github.com/macaso/mengrl2021
I'm still with Python 3 + libtcod. As I already told last week, I want the game to be with graphics, not ASCII. So I choosed a nice font, and today I've added bitmask rendering for the dungeon!
Image: https://imgur.com/sSk7fYV
It's a 100% Python solution, so it's reaaaally slow. Maybe tomorrow I'll try to profile the game using the standard, NumPy based, rendering function, and then using my bitmask function.
The rendering code can be improved a lot:
tiles_rgb.Oh, the code of the bitmask rendering is copied from the RLTK tutorial. I seems that I have something wrong with the generated ASCII codes, or maybe the font I'm using uses another codification. Tomorrow I'll study it better.
3
u/redblobgames tutorials Jul 08 '21
As I mentioned last week, my plan is to revisit each topic in the tutorial but this time do it differently from the tutorial.
In week 1, I spent some time setting things up differently than last year:
And then I spent most of the time on a graphical display:
I treated these as experiments that I felt free to discard if I didn't like the results, and did in fact abandon several of them. Details and screenshots in my diary and code is on github.
In week 2, I'm going to focus on the map. The big thing will be thin walls. I've studied the math but now I want to use them for a real project. I'll have to write my own map generation algorithm that uses thin walls instead of using the one from the tutorial or the one in ROT.js, and I expect to spend the entire week on map generation. Thin walls also mean I can't use the FOV from ROT.js, and I will have to come up with a different implementation in week 3.
3
u/Larront Jul 09 '21
Bit of a later post for me this week, work was pretty busy.
I spent some time implementing a map building system similar to the one found in the Rust Roguelike Tutorial, hopefully leaving some flexibility to randomly generate floors using things such as BSP, Drunken Miner algorithms. I might implement them if I have time over the weekend, or if I continue working on the game after the tutorial, but for now it's nice to have the flexibility
Repo link
3
u/[deleted] Jul 09 '21
Started off doing the Rust tutorial but ended up also following along with the new Python tutorial. Since when does Python have type specification? This is beautiful, I legit love this.
3
u/constantnoise0 Jul 09 '21
Loving the tutorial so far, although as a beginner, I'm not sure I understand much. It's probably because I've rushed ahead. I'm stuck with errors in section 6, what's my best action here? Wait until the group has caught up (and go back through the first few parts more thoroughly), or is there somewhere I can post for help?
3
u/lagdotcom Jul 09 '21
repo - play
This went fairly smoothly. I'm now using WGLT for rendering the dungeon; it isn't done in the WASM code yet. I'll get to it sometime.
3
u/Thorinori Jul 10 '21
Repo: https://github.com/Thorinori/RoguelikeDevTutorial
Language + Engine: Lua and Love2D
So I have mostly been distracted this week (Thanks Games Done Quick!) and "only" did the Entity generalization (so far, that may change), as well as a bunch of other miscellaneous things like adding in rotation, different fonts, different colors, basic idea of how I want to do upgrades, etc. Basically, a bunch of stuff to make the game look and feel better to play before I start really focusing on the dungeons themselves. Beyond that, there has been a ton of refactoring to clean up the repo and code some while trying to force myself more into a consistent, single file for a single purpose kind of structure.
I intend to get in the world and dungeon generation on Sunday maybe, and potentially starting next weeks sections as well (Unless something else distracts me that I feel like implementing sooner. I really did already start going off the rails, thought it would take at least 1 more week XD)
3
u/davesmith00000 Jul 10 '21
Still trying to stay a bit ahead, I've published playable versions of parts 1 to 5 in Scala, so week 2 is on there as Parts 3 and 4.
The repo has all the code, and there's a table of contents with animated screenshots and links to versions you can play in your browser:
https://github.com/davesmith00000/roguelike-tutorial
I'm having a great time doing this! The FOV was a bit of a head scratcher but otherwise this is very relaxing. The hardest bit is reading the Python and trying to convert it to a functional programming style in Scala while staying as close as I can to the original. :-)
3
u/EmergencySpy Jul 10 '21 edited Jul 11 '21
After failing to make anything meaningful last year, I'm trying again!
This time I'm using rust (because I absolutely love the language) with bevy game engine (because I wanted to check it out). It seems very well-designed so far. I will be using the tutorial as a rough roadmap to follow.
So far I've implemented dungeon generation using drunkard walk, but I'm not really happy with it, so I might scrap it and either do the tutorial one or maybe use cellular automata.
If I remember, I'm going to update this post with a repo link when I rework the map generation. Good luck everyone!
EDIT: Repo
I finished cellular automata, and it looks much nicer than the drunkard walk (and it's much faster!).
This is how it looks so far: image (I decided to go for sprites instead of ASCII)
3
u/AgentMania Jul 11 '21
Modern-Roguelike-Inspired Game
Whew, this was a pretty tough week on my end. Unlike in the tutorial (which guides you through making a dungeon generator) I had to come up with my own dungeon generation system.
The 3x3 room grid I laid out last week might have made it look easy, but that lead to a lot of over-thinking about how to generate the dungeon. Should all rooms be 5x5 tiles? Should rooms vary in size? Should multiple rooms connect to form larger ones? How much should the room templates decide about the room layout? Should the entire grid be one room, connected to others through a larger map?
Ultimately, I was getting sick of analysis paralysis and just went with the simple option: Each room is 5x5 tiles. There are always 3x3 rooms in the dungeon and they always connect the same way. Room templates just determine what entities spawn in each room. Maybe that's boring, but it gets the job done.
I was also able to implement some features from the coming weeks (which you can see in the links below). My main upcoming challenge will be deciding whether or not the player must defeat all enemies before being allowed to descend to the next level (a characteristic of some modern roguelikes, but not all). I have a feeling that decision will impact how I approach new features during future weeks.
Links:
Screenshot: https://i.imgur.com/XzgmStM.png
Twitter thread: https://twitter.com/ianmagenta/status/1414329494689652737
Repo: https://github.com/ianmagenta/SummerRoguelike2021
Last week's progress: https://old.reddit.com/r/roguelikedev/comments/oa2g5r/roguelikedev_does_the_complete_roguelike_tutorial/h3zdt5j/
3
u/_andy_andy_andy_ Jul 12 '21 edited Jul 12 '21
wrote up my weeks 1 and 2 (which have a bit of sidetracks) http://anderoonies.github.io/2021/07/10/roguelike-dev-does-the-complete-roguelike-tutorial-weeks-1-and-2.html
the repo is: https://github.com/anderoonies/rl2021
and a gif of some of the pretty colors: https://imgur.com/a/B5kA46I
2
u/brusbilis Jul 09 '21 edited Jul 09 '21
Roguelike.online - Parts 2 and 3 completed
Play in the browser
Github
There are gifs in the repo showing multiple random generated dungeons and exploring them.
At the moment, what has given me the most problems is the communication between the authoritative server and the dumb client (browser) until you realize what is the minimum amount of data that the browser needs to show. Communication in the server between goroutines doing different tasks is also time consuming to implement.
Exploring the dungeon i have a ping between 130-160ms which i think is reasonable for such a game.
We will see how it will behave when the server has to calculate more things (like FOV, enemies ...) and several players running concurrently (although each one with their own run).
2
u/KaizarNike Jul 11 '21
Week's Devlog | Repo | Screenshot
Started a week late, but I had some Godot Engine roguelike project sitting about that I could iterate on. Last project did witchcraft with bbcode to get each monster colored, decided tp use only a standard label with this one.
A nice feature of this project so far is that everything is condensed. I checked out the godot tutorial before going my own path. Right now the scene is four nodes with a single script governing everything.
Was thinking of skipping this group workshop until I read a twitter post asking for moddable Godot games. The idea I came up was, you build your levels in the text editor of choice and then drop them in the game to be played. I had this idea before, but it was then based on either making an ingame level editor or using godot to build levels that would get imported (messy).
There's a playable build up if you're interested, check out the devlog or windows downloadable at repo.
2
u/Gulogomi Jul 11 '21
I have a question regarding the 'inner' function in the ReactangularRoom class. I am trying to implement it using GDscript in Godot. I have trouble understanding why it is necessary that it returns a slice object instead of you two tuple values
2
u/jjatria Jul 11 '21
Ok, here we go: long time lurker, first time poster.
This is my first time going through the tutorials, and I'll be doing it in Perl.
Perl didn't have any bindings for libtcod, but writing FFI bindings has become really easy in Perl recently, so I decided to write my own. I'm going to be using the tutorials as a way to test it, and a way to test a couple of other cool recent features that I've not yet had the chance to use. I'll also be using my own ECS library that I've been working on (a sort of minimal port of EnTT), so I'm in full-on experimental mode!
The repo is here: https://gitlab.com/jjatria/perl-tcod-tutorial
Here's the bindings: https://metacpan.org/pod/TCOD
And this is the ECS library: https://metacpan.org/pod/Game::Entities
I'll probably be following along mostly with the old tutorial, though. Since this is my first time using libtcod, I'm not so sure what is new and what is old, what is deprecated and what is recommended, etc. I'm keen on supporting whatever API is recommended, but I found the lack of documentation of the more recent features a bit of a challenge.
Maybe I can find some guidance here about that as well :)
I didn't know this had started, so I'm a little bit ahead already: I'm on step 7. I've tagged relevant milestones on the repo in case you are interested. And who knows, maybe I can start over with the new version of the tutorial if I figure out what the new API is supposed to look like in C. :D
2
u/NSD_Brad Jul 12 '21
Week 2 (C++/SDL/libtcod)
repo
Part 2 - The generic Entity, the render functions, and the map
This ended up being a bit trickier than I expected. I was overzealous in week one trying to predict my future needs, so I ended up spending some time yanking a bunch of code out. Most of it made it back in some form or another, but still, lesson learned! I also had a pointer-into-vector mishap.
Part 3 - Generating a dungeon
I had a head-start on this part, though: I did the libtcod C++ tutorial a while back and had already been playing with the dungeon generation code from it for a while. Still gave it a bit of clean-up vs. my last iteration, though.
2
u/aga_acrobatic Jul 12 '21
TypeScript + Phaser | repo
The goal of this project is to test my abilities to make a game with Phaser and to start learning TypeScript. And obviously to have fun 😀
Part 2 - The generic entity, and the map
The Entity class itself is just a simple Phaser Image Object. No need to invent the wheel anew. But I had to decide how to deal with movement in this game.
In the tutorial - as in many tutorials I have seen on roguelikes - movement is basically setting the entity's cooridnates to the designated ones and redrawing it's character/sprite.
In Phaser this is obviously a viable option. But there is another one, which involves bodies and physics. Phaser has a very nice physics engine for simple stuff. Apart from things like velocity, acceleration, etc. it allows movement towards and collisions. I really like the convenience of declaring a set of tiles or any objects as colliding and writing simple collider callbacks. That's what a framework is for.
So I decided to explore movement in my roguelike via Phaser's physics engine. Moving the player Entity towards a target was easy . It took me quite a while though to make it move only one tile at a time - i.e. stop the movement in the middle of the next tile. In the end it was quite simple: resetting the Entity's physics body when the distance to it's target is small enough.
Entity Class
Part 3 - Generating a dungeon
It took me a while to create a Phaser Tilemap from the procedurally generated dungeon as shown in the tutorial. And like every time I try this: It took me ages to get the code for the tunnels right. Don't ask me why. I always manage to butcher it somehow 🙄
2
u/AleatoricConsonance Lost Gardens of the Stone Heart Jul 12 '21
Finished Week 2 - using the Rust/RTLK tutorial. I was going to use the Chargrid one but couldn't get it to work on my setup. I'm totally new to Rust. Also have the book by the author which has a lot more introductory Rust material which is really helping.
I am finding the tutorial a little frustrating - it's not quite as "change this here and change that bit there " as the libtcod tutorial, and I've had to peek at the reference files to figure out where some things should go. But I've muddled through, so all good really.
1
u/mifuyne Jul 13 '21
Yikes, I waited too long to get this done! Trying to cram two parts worth of learning into my head was not ideal. I'm sure I'll forget something down the road and get confused.
I switched over to the 2020 roguelike tutorial, sadly. I don't have enough experience with Python (still a beginner really...) and my only experience with ECS was through Unity back in 2011.
Part 2 complete
The part that made my scratch my head for a while was the
action.performpart of the code. I spent an embarrassing amount of time trying to figure out why that works. Eventually I found out that action contains the Action objects likeEscapeActionandMoveAction. It was so obvious in hindsight, but at least I learned a neat trick!Part 3 complete
The learning experience from this one is...read the code carefully! I left out "slice" in
procgen.py:31and was wondering why was it only generating a row at the top and bottom instead of filling it in! Again, an embarrassing amount of time was spent before I figured that one out. Another lesson learned 🙂0
u/[deleted] Jul 06 '21
[deleted] — view deleted comment
0
u/[deleted] Jul 11 '21
[deleted] — view deleted comment
14
u/[deleted] Jul 06 '21
[removed] — view removed comment