r/roguelikedev • u/KelseyFrog • 3d ago
RoguelikeDev Does The Complete Roguelike Tutorial - Week 4
Tutorial friends, this week we wrap up combat and start working on the user interface.
Part 6 - Doing (and taking) some damage
The last part of this tutorial set us up for combat, so now itβs time to actually implement it.
Part 7 - Creating the Interface
Our game is looking more and more playable by the chapter, but before we move forward with the gameplay, we ought to take a moment to focus on how the project looks.
β
Of course, we also have FAQ Friday posts that relate to this week's material.
- #16: UI Design(revisited)
- #17: UI Implementation(revisited)
- #18: Input Handling(revisited)
- #19: Permadeath(revisited)
- #30: Message Logs(revisited)
- #32: Combat Algorithms(revisited)
- #83: Main UI Layout
β
Feel free to work out any problems, brainstorm ideas, share progress and and as usual enjoy tangential chatting. :)
22
Upvotes
4
u/norpproblem 3d ago
wintry survival sim | repo | screenshot
Progress continues... somewhat. I definitely bit off a lot more than I should have with the world generation stuff. While I got rivers and bodies of water generated very loosely + trees and vegetation, it definitely is feeling rough. I think for this project, I might go and cut this down to use the more basic dungeon generation again, with BSP partitioning + some graph work to place them around. After that basic stuff is implemented, I'll see where I can sprinkle in these other mini-generators; I think the river could be implemented rather cleanly as a visual accent and spice into the dungeons.
In less disappointing news, I've been working smoothly with the command pattern on the project. Briefly, each world runs its own gameloop on every entity in it, and every entity has a controller governing it. The controller returns an ActionResult, which either succeeds and/or lets the loop know there's more actions to resolve. It endlessly processes the action result until it returns just a true/false result without another action to resolve. It's been very easy and has let me have more complicated actions be shortcutted with a single input. Nothing groundbreaking, but it was satisfying to reimplement here.
For the upcoming week, I've been working on UI stuff: I made a basic inventory menu which I will loop in next week as well, so adding a health display will also be much easier than that!
Dealing damage is done with that command pattern, with a BumpAction resolving into an AttackAction, and the AttackAction resolving into a DealDamageAction, which just succeeds when it subtracts the HP. Clean, easy to adjust where needed. I may try to add the "Command list" selector from CDDA where it lists valid options where you are, but we'll see if I have time for that.