r/roguelikedev • u/KelseyFrog • Aug 20 '24
RoguelikeDev Does The Complete Roguelike Tutorial - Week 7
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.
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! :)
6
u/HexDecimal libtcod maintainer | mastodon.gamedev.place/@HexDecimal Aug 21 '24
GitHub repo - Python 3.12 - Using python-tcod & tcod-ecs
I'll need to record my thoughts better since I had more to say before I started writing this.
My changes to part 12 have been pretty minor, such as refactoring the
get_max_value_for_floorfunction to use Python'sbisectlibrary, and refactoringget_entities_at_randomto return a parameters dict to be unpacked intorandom.choicesinstead of calling the function directly. The biggest improvement came from moving the spawn weights into the monster and item templates.I had to split my
IsActortag into more specificIsAliveandIsBlockingtags to so that I could implement the template entities better. Without any save migration my saved worlds were loaded in some very interesting states until I started a new game.I took the path of least resistance with part 13 as well. Items say which equipment slot they use and equipping an item will remove any equipped items which share that slot, rather than there being slots which directly hold items.
Completing part 13 means I've actually completed the event for real which is a first for me. Hopefully I'll spend the rest of the week performing polish as there's still a lot of issues with this code and there's nothing more from the tutorial that I'll have to account for.
Finishing the tutorial and play testing it also reveals how broken the balance is. It's way too easy to become immune to damage with this stat progression.
5
u/LeoMartius1 Aug 20 '24
Y.A.R.C. or Yet Another Rogue Clone | Python 3.12 + python-tcod | GitHub repo | CC0 | screenshots
It does exactly what it says on the tin! Now with source code!
For part 12, I added a few higher-difficulty monsters that appear as the player goes deeper into the dungeon. I haven't implemented any monsters with special attacks yet, which are arguably the main source of difficulty going forward (along with item identification, which is also missing), so the game is still quite easy after the first few levels.
Item placement doesn't change with level, but gold piles do get richer on lower levels.
For part 13, I added a couple of melee weapons and suits of armor, along with all the necessary mechanics to equip and unequip them, including armor class, weapon bonuses, etc.
I also took some time to clean up my code, so I finally feel confident enough to share it with the world.
Looking forward to post-tutorial development!
5
u/TechniMan Aug 20 '24
Oo, 'eck! We're here already?! I finished part 9, then things happened and I've not been able to catch up. I want to, though! I'll try and get some more progress done this week.
Well done to everyone who kept it up this whole time and got to the end! I'll have a look through the threads on this post as they come in. One day, hopefully soon, I will join you.
Do we get stats for things like distributions of implementation language/tools/engine? E.g. 10 used Godot, 5 used Python, etc (I made those numbers up, of course). I think it would be interesting to see the distribution, but also the change each year, similar to how the annual Stack Exchange survey shows trends in language popularity.
5
u/KCEHOBYTE bedivere Aug 20 '24 edited Aug 20 '24
Rust + tcod | GitHub
I was two weeks behind because "reasons" so I'm simply happy to catch up - just finished week 6! Made sure I have enough snacks for the weekend and just pushed through https://imgur.com/a/pir3W54
1500 lines of code in one file reached, one final stretch ahead. I mean... even going through the vanilla tutorial is surprisingly time-consuming, see you on the other side.
5
u/systemchalk Aug 21 '24
Vanilla run through the tutorial: Python + python-tcod | GitHub Repo | YouTube Video for this week
This week left me quite eager to start implementing things past the tutorial, but still best to focus on this week's work. As it is, there weren't too many questions as 12 was one of the shorter tutorials compared to the last couple of weeks, and 13 was fairly straightforward once I thought about a couple stumbles I had.
One objective I've had with the tutorial now that ruff is working is to go through all the warnings generated by the very wide net cast by the default and either articulate why it was okay to suppress or otherwise address it. I have a few here which are going to be more Python questions (indeed, even ruff specific) than specific tutorial ones.
5
u/DerHeiligste Aug 22 '24
Hard Times | Python 3.12 TCOD | GitHub Repo
I added "up stairs" that appear under the player when a new dungeon floor is generated.
I also added "quest givers" that have a background, a motivation, and a need. They have an AI that tracks the player down and then announces the quest, "I am a {background}. I want to {motivation}, so I need {need}. Can you help me?"
I haven't implemented any actual quest mechanics yet, or even done anything to make the background/motivation/need in any way coherent.
Anyway, this project has been a lot of fun, and I've really enjoyed reading about everyone's progress!
3
u/SelinaDev Aug 21 '24
Couch-coop Roguelike
Engine: Godot 4.3 (Using GDScript)
Repo: https://github.com/SelinaDev/Roguelikedev-Tutorial-Tuesday-2024 Playable Build: https://selinadev.itch.io/roguelikedev-tutorial-tuesday-2024
Wow, final week came faster than I thought.
So, part 12 was rather easy. I created a custom resource with entity keys and associated weights that I have an array of as part of my map config resource (I have one of those for each level of depth of the dungeon). The release of Godot 4.3 was also pretty neat, because that introduced a new `rand_weighted` function that made including this in the generator especially easy.
Every time I did the tutorial I kind of dislike the rudementary nature of equipment in part 13. I get it, just using the inventory menu is an easy way to get it going, but still. I would have preferred to create a dedicated invertory screen, but at this point I wanted to be done. I was again amazed by the system of propagating messages through the components of an entity, because it made eqiupment effects just as flexible and decoupled as any other effect. Whenever damage is calculated, the message passes through the entity twice, and in the first pass (the calculation pass), any equipment simply appends their bonus to the calculation. I do the same thing when calculating stats to show in the character screen, so there is no bookkeeping for equipping/unequipping.
That brings me to where to go from here. The flexibility I just mentioned is something I really like about this project. There is a lot of potential to extend this. Even more, I had my partner try out this little prototype together with me, and they enjoyed it. I can't know if I'll stay motivated enough, or what else will happen in life, but right now I have started making plans on how to take this project further to an actual game. There's a lot of things that can be polished a bit, lots of stuff I can add, and lots of stuff I want to try out. If I do indeed make any progress on this I'll be sure to let you all now in case you are interested (even if that means I'd have to tackle what's one of the hardest parts of developing a game for me: deciding on a name).
3
u/IndieAidan Aug 23 '24
Untitled Godot 4 Roguelike - Repo
Hello, it is me again, the guy that only talks about light and is not on track at all to finish the tutorial in time. I had about two hours to work on the project on night and, you guessed it, I worked on how I want the light to work.
I am doing the general point light 2D in Godot with circular tile shapes made in Aseprite, and that works fine. I had thought of doing just three stacked on top to go out to the low light sections, but it'll make more sense to just have one and I can gradient down the White of the tiles the further out it goes. And is fun and neat with the light occlusion. But that is just normal light stuff in Godot.
I want to have a "light" value for the various entities, and I have been doing that with similarly overlapping Areas that check the "has_method" for changing light level to detect relevant entities, and then use a raycast to make sure there is no light occlusion in the way, so "light" actually hits the entity. Can you have a raycast detect a light occlusion layer? I had to just make a collision layer than mimic'd the same areas as the occlusion layer, but that seems to not be a great idea.
Then the light source adds 1 to the light level upon entering the area, and then subtracts 1 once it leaves. It's still a bit finicky.
But the plan is to only display enemies etc. that match the light level of the vision of the player (and vice versa). So it could be an ability or class etc. has a low light vision and can see enemies more easily. Or some enemies may gain boons for being in the shadows, or a plant enemy might get benefits from extra light etc. It's also how I want to handle abilities etc. checking for targets, so it should help beyond that in long run. I'm also thinking a similar approach for sound levels and detecting. Some creatures may have echolocation and similarly use sound level to "see" the player etc.
Not a ton of fast progress, but it does feel good to be making some progress.
It was also helpful to be learning git better for this tutorial version, as I hadn't been actually pushing my commits until tonight. Again, it is truly a mess in the repo, so I do not recommend it as an example to anyone!
2
u/EquivalentFroyo3381 Aug 24 '24
Python-RL: https://github.com/jossse69/Python-RL
today i added amor, kinfes, and making the game get harder as you get deeper! i dont have much to talk about but i will be happy to spread a build to the public! anyways cheers!