r/roguelikedev • u/aaron_ds Robinson • Jul 28 '20
RoguelikeDev Does The Complete Roguelike Tutorial - Week 7 - Parts 12 & 13: Monster/item progression and equipment
This week is all about adding game progression and equipment.
Part 12 - Increasing Difficulty
Deeper dungeon levels become increasingly more difficult! Here we create tools for dealing with chances and making them vary with level.
Part 13 - Gearing up
For the final part of our tutorial series, we'll take a look at implementing some equipment.
Of course, we also have FAQ Friday posts that relate to this week's material
- #11: Random Number Generation(revisited)
- #36: Character Progression(revisited)
- #44: Ability and Effect Systems(revisited)
- #56: Mob Distribution
- #60: Shops and Item Acquisition
- #76: Consumables
- #77: The Early Game
- #78: The Late Game
- #79: Stealth and Escaping
- #80: Determinism and Randomness
Feel free to work out any problems, brainstorm ideas, share progress and and as usual enjoy tangential chatting. Next week we'll have a final discussion and share our completed games. If you have made it this far congratulations! You deserve it! :)
2
u/SuperMagneticNeo Jul 30 '20
Hold on, is this not from the old tutorial? Have I missed something?
7
u/FratmanBootcake Jul 28 '20 edited Jul 28 '20
My progress is starting to get all out of whack with the tutorial. I've implemented equipment and going deeper into the dungeon already. I've also implemented a minimap as I have a scrollable camera. screenshot
I also have implemented a loot/drop system for when mobs are killed. There is a weighted loot table for each mob and the game rolls off on that table. It could trivially be extended to account for nested tables which means I could have super rare items in their own table.
I'm currently working on a hand-written save/load feature (mostly because I'm using this whole process to learn a bit of c++). So far I have, in principle, a way of serialising my GameObjects. It works on a test GameObject (just position, render and fighter components but extending is a matter of implementing the same method for each component).
Each component has/will have a serialise and deserialise method, as does my GameObject class. Writing a GameObject to a file as a series of bytes seems to work (hand checked the output against the values I wrote in) but I'm currently wrestling with the deserialisation. I've done something funky somewhere because it isn't working.
EDIT: I've now got the deserialising working. It turns out I had assumed an endian-ness for my machine which was wrong. I am 'writing' integers as bytes to a vector (I then go through the vector and write to a file - I will probably change this to writing to the file straight away but the vector was a good test container) by doing the following in a function called serialiseInt
It turns out that calling
serialiseInt(0)was doing something funky. I assume it was doing a cast of some sort behind the scenes but when I specifiyint x = 0;and then callserialiseInt(x), it gives me the correct result.5
u/enc_cat Rogue in the Dark Jul 28 '20
Week 6 was a good one for Rogue in the Dungeon, which felt especially good after the struggles of week 5.
I was intimidated by having to implement the save/load mechanism for the first time. It turned out to be a piece of cake, not thanks to my (lack of) programming skills but to the amazing Rust crate Serde! Serde can serialize and deserialize basically anything you throw at it. So, all I had to do is to save a whole snapshot of the game and load it back. I did not bother trying to prevent save-scumming, both because I would not know how to and, even more importantly, because this is supposed to be a game: who am I to judge if someone likes to cheat a little?!
Being done with save/load, I added a leveling mechanics. This was particularly fun, because it gave me the chance to practice a little of game design! I don't generally like the standard experience-points mechanics, as it fundamentally rewards killing everything that moves and makes other, subtler approches a suboptimal choice. (Moreover, it is also tricky to implement: I don't know of a solid system to determine when a mob is killed due to the player's actions, rather then some other cause.) Rahter, I wanted to reward exploration, so I implemented a special item that increases the rogue's attributes. In that, I am clearly taking inspiration from Brogue. Unlike Brogue, though, I wanted the player to choose which attribute to increase (among constitution, strength, dexterity, perception and intelligence), to allow personalization of the character. I initially represented such special item as a potion. Then, I thought that was quite flavorless while it should rather be something special: a magical crystal (creativity is not my forté). I finally realized that there is no point in carrying such an item around, as you normally want to use it immediately, and that thus it should not be an item at all, but something more like a land feature (maybe an altar). Unfortunately, I ran out of time, so I will have to fix that in the future.
Having a little time left on my hands, I also implemented a lightning scroll (last week I had to skip the scrolls' chapter for lack of time). Having misunderstood the tutorial, I actually mixed up the lightning and the fireball scrolls, and my lightning just bolts straight in one direction. To fix that and implement the missing scrolls is left as future work. As a final nice touch, though, I made it so that the lightning's damage is increased if the target is standing in a water tile.
Overall I am happy to be (more or less) keeping on par with the tutorial, and that my base system seems to be working fine as I add new feature (modulo the refactoring I had to do last week). The result is far from perfect, though: the code quality is not great, as I have little time to polish and document it. Moreover the frontend is quite buggy and it crashes every now and then: I have put little effort in it, as I preferred focusing on the engine. When the tutorial is over, I will have to work on fixing these things before adding more features, but I still believe that, in the end, I will have a solid base to develop a full game!
4
u/Ombarus @Ombarus1 | Solar Rogue Jul 28 '20
I'm officially one week behind on my videos as I just posted the one for last week. I have done part 12 and 13 myself but the video is no where near done.
In part 10 I struggled a bit with Shelve so I went with Pickle since I've used it in quite a few projects before. Not sure if there's an important difference there.
I might do a wrap up video because I've come to realize that there's incredibly a lot of similarities in the structure of the tutorial and the structure of my "main" game Solar Rogue. It'd be interesting to see how the architecture evolved in my own game and if there's something I could use from the tutorial!
3
u/Obj3ctDisoriented Jul 28 '20
C++ BearLibTerminal Tutorial & Project
[Tutorial][Github Repo]
I got seriously side tracked this week implementing a few ideas, and then de-implementing one or two of them (BSP dungeon generation turned out looking like crap, the ol' random rectangle & check for collision turned out to look much better)
ive been thinking of different ways to make my goblins less boring/stupid, and ive finally landed with a working solution that i like:
after spawning goblins and Items around the map, i then assign a random item to a random goblin, Repeat untill all goblins have been allocated an item.
Using breadth first search, a path is generated from the goblin to their designated item.
The goblin, the coordinates of their item, and the generated path is stored as a tuple, and then the tuple is stored in a vector.
i generated all the paths and stored them at the beginning so that i wouldnt have to run the BFS algorithm roughly 16 times each turn as that would slow the game down considerablly.
so now each time the player makes a move, and game state switches to monster turn, i have a function called dispatch() ( get it? like taxis..)
this function has a loop that loops through the vector of monster/item/path tuples
and moves each monster one step closer to their designated item.
This alone was pretty cool, but if they were all on a set path all the time it would be easy enough to avoid them, so before they each progress there one step, they scan theyre surroundings to see if the player is in FOV,
if they are: forget the path, time to attack!
i also created "value fields" around each item, so if the goblin is on his way to his assigned item and happens upon another item, he can detour towards that one before resuming his original path.
everytime a goblin reaches an item, there is a 30% chance they will pick it up, so you are now competing with the goblins for resources.
if you fight a goblin, and he has prieviously picked up an item, he drops it upon dying and you can then pick it up.
Once they reach their destination, they are assigned a new one, and it started all over again.
I finally have goblins that move with a purpose, dont act like they are in a world of their own, and dont appear to be completely F'ing retarded. I'm pretty happy with the results.
2
u/haveric Jul 28 '20
Tethered - [Play] [Repo]
This was a productive week as I finally got a live version running to test out co-op play. Had some fun learning about droplets and getting nginx and ssl certs setup. Having it live makes it possible to now test with two people to really see how it plays. Some of the takeaways were:
I feel like I've done a lot this last week, but a lot of that was spent fixing random bugs so there's still a long ways to go. I also skipped saving and loading for now as I'm not sure yet how I want to handle those in a multiplayer game (probable route I'm considering would be saving everything to the server and requiring a password to get back into rooms). Currently I have a debug room (Page Down to get there) that contains a couple floors that you can travel to. Players can currently be on different floors, but I'm planning on limiting players to a single "ship" and implementing a Baldur's Gate style "You must gather your party before venturing forth" mechanic. I'm hoping to add a player owned ship that will act as a permanent base and allow embarking to other randomly generated ships in the near future and then have a method for getting players back to their ship.
Some of the things I did this week besides getting it live:
I'm probably going to focus on getting the player ship created so I can get most of the main flow of the game working and then jump to the next parts to get some equipment implemented before working my way back to saving and loading
2
u/usami33 Aug 02 '20
I participated using Python Arcade Library
I still have a lot of bugs.
For now, I'm ready to switch equipment and call it done.
I will be slowly debugging and adding features until I can play it properly
1
u/theq629 Jul 29 '20
I haven't been posting since I haven't been in sync with the schedule, but I've been working through the Rust+RLTK tutorial and finished the main part last week. I haven't done anything interesting with it outside the tutorial yet, so hopefully I will have time to do something this week.
https://github.com/theq629/rust-rltk-roguelike-tutorial-2020
1
u/ArKeid0s Aug 06 '20
I am new to this reddit and just discovered these tutorials I wanted to know if the concepts can be followed using C# and unity ? I am not a huge fan of python I am a java developer . And I haven’t found any good tutorial on rogue like (old ones turn based not the rogue lite) for unity Thanks in advance I am very sorry if this question has already been answered please forgive me 😇
1
u/acss Aug 20 '20 edited Aug 21 '20
So, I've finally made it through the content of the code-along. I wanted to tie up some loose ends before I "called it" which took a bit longer. The last set of changes include:
I have some additional features I would like to add and some more decorations / room themes to add. Thanks for a great Summer project!
GitHub Repo - Play on Itch - Week 7 Image