r/roguelikedev • u/aaron_ds Robinson • Jul 31 '18
RoguelikeDev Does The Complete Roguelike Tutorial - Week 7
This week is all about adding game progression and equipment.
Part 12 - Monster and Item Progression
http://rogueliketutorials.com/libtcod/12
Deeper dungeon levels become increasingly more difficult! Here we create tools for dealing with chances and making them vary with level.
Part 13 - Adventure gear
http://rogueliketutorials.com/libtcod/13
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
- #44: Ability and Effect Systems
- #56: Mob Distribution
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. :)
14
u/Ganymede_Games Jul 31 '18
Unnamed Space Roguelike - Python 3.6, libtcod 1.5.2
Screenshots:
Title screen - https://i.myimg.io/XkpD.jpg
Personality and Physical Trait Generation
an orc who can’t reach me because I chopped off his leg
Book reading, medicine skill
I died of missing a head
the character screen
Finished the tutorial and began adding modifications. It is still unnamed as of now, but I am aiming for a sci-fi setting.
While futzing around with a combat system that incorporates broken and severed limbs, I discovered what I think may be my game’s core mechanic. Inspired by Dwarf Fortress combat and Fallout’s VATS.
You have a head, torso, and arms + legs (until you don’t). They each have a set of hit points, which once it reaches zero the part can be broken or severed. Broken bones cause you to lose your ability to attack with that hand or render you unable to move in the case of legs.
Broken bones can be splinted. This is where it gets interesting: if your limb is severed, you can surgically replace it with another. And limbs aren’t in short supply - they go flying around during the gore of combat. You can also use the severed limb as a blunt weapon. I once picked up my own severed arm and beat an orcs skull in. You will also be able to replace limbs with advanced combat boosting prosthetics.
I’m picturing a weird wacky game where you are constantly swapping out recovered limbs and prosthetics in a grotesque Frankenstein fashion.
Now that logic is out of the way, next steps are tidying up the ui.
11
u/Lokathor dwarf-term-rs Jul 31 '18
Hey we're basically done!
Week 07 Release and Week 07 Lesson
This week we add hit points to the kestrels the deeper you go, and we make equipment you can find sitting around.
I actually didn't make the equipment be anything but +0, oh well.
8
u/toptea Jul 31 '18
Python using Esper Entity Component System
In the previous weeks, I was trying vectorize everything using numpy. But now, I am swamped with for loops and generators when using esper library! Not sure I'm doing it "right" since there's not much examples to draw upon, so I'm just winging everything. Still have a lot to learn!
Game
Entity Component System
__slots__to component classes does not make any noticeable difference on the memory. But them again, I only have about 20 entities loaded in the game world at one given time.Performance
7
u/SickWillie Goblin Caves Jul 31 '18 edited Aug 01 '18
Barbarian! - Github Repo | Blog
Using C++/SDL2
Oh man this has been an exciting week! Caught back up with the group - well, I've got a few finishing touches on Part 11 from last week, but I'm mostly caught up. Here's a summary of all the fun things added to the project this week:
engine_draw_inventory.cppfile than lost somewhere in a thousand+ lines of engine code! Doing this made a lot of my work for parts 9,10 and 11 much easier.<shift>+lto look around, and certain scrolls will ask the player to select a target. The targeting function itself is pretty cool, it works as sort of a miniature main loop reusing theEngine::handleEvents()andEngine::draw(), and then returns to whatever function called it. That function can then get the position of the cursor the player positioned and do something (cast a spell there or tell the player what they see).Here's a video showing off the progress from the last week!
6
u/t_r_a_g_e_d_y Jul 31 '18
Are the message passing and game loop structure from this tutorial common patterns in game dev? I didn't have much interest in developing games before I started this but it's growing on me and I've started to extend my game beyond the tutorial and my game loop is growing to be out of hand.
5
u/[deleted] Aug 01 '18
My result
Repo
Aside from following along with the tutorial, I added icons to the touch interface to open the inventory and character panel. They can be a bit finicky to hit but hopefully not too bad. The center cell in the grid is still a shortcut for opening the inventory, picking up items and using stairs.
I didn't add the starting dagger weapon because I think it made the game a bit easy.
Adding the Equippable component type really pushed the current ECS system to the limits here as the Equippables in the player's Equipment component needed to be connected to the Entities in the player's Inventory component. I added an "ownerId" to the serialized components and an "id" to entities to connect them together. When I properly refactor this the components probably wont even contain an entity reference directly, probably just the ID + a getter to find the entity with that ID for convenience.
The tutorial has been great for getting me to actually do things even if they end up being very hacky and I have procrastinated way less than I usually do with projects like this. I hope I can keep up the pace now that I'm not following along with the tutorial any more.
I have started to form a picture of where I ultimately want to go with the game from here. After I refactor the ECS, the first thing on my list is to add an "overworld" with NPCs that you can buy and sell from. I think instead of letting you go back a floor when you interact with the staircase you came from, the stairs will give you an option of returning to the overworld, and then you can resume from there (or maybe there will be checkpoints every 5 floors or so) after you've done your business with the NPCs.
Though diving down the dungeon and leveling up is fun for a while it eventually gets boring, so adding an NPC who sells cool items for high prices hopefully will add a feeling that even if the grind starts to get boring it is helping you progress towards something cool that will make the grind more fun when you have it.
5
u/[deleted] Aug 01 '18
GitHub repository -- Ruby/BearLibTerminal
This week I finished up parts 11, 12, and 13. The player can now go down a level and up a level. It's fun watching all the pieces come together.
One thing I'm pretty happy with is adding some debug menus, which you can access by running the game with
ruby -d(for debug mode) and pressing CTRL-D, and use to spawn monsters and items.Next week will be a bunch of tweaking and bugfixing. There's an odd bug that's been around for a while with actors not seeming to recognize that there are other actors in their spaces, which has led to such strange things as monsters walking over other monsters and items dropped onto corpses not being accessible. And the system that keeps track of different types of monsters and items is really clunky and weird.
I've considered writing up a Ruby tutorial, but I doubt the current codebase is something I could use for a tutorial in good conscience.
4
u/EsotericRogue Jul 31 '18 edited Aug 01 '18
The livestream will be tonight at 8PM EDT (20:00 UTC-4). We're using Python 3.7 and Libtcod 1.7 on Windows 10. Here're links for the repository and video archive.
We are behind. Last week was bad for me. Starting into part 11 I found a bug I couldn't fix. At the same time, my personal archiver hadn't run in 4 days for some reason, and I don't know how to revert with git -- partially because I think I'm supposed to be forking it each week. Anyway, I have just now fixed both my archiver and the bug, but I have to start part 11 again. I think I'll stream that now, so maybe I'll be back on schedule for this evening's cast.
Edit: Okay, great I was able to finish everything so we'll be on schedule for tonight's livestream!
4
u/_velocicat Aug 01 '18
So I'm really not following along at this point with the tutorial! I followed Trystan's Java tutorial mostly, but didn't include certain things. I did his tutorial once before and really got lost. Now that I have a better understanding of Java I've been able to keep up. This week I've added a very simple stat screen and changed the menu system a bit from the tutorial. I still need to make the enemies more interesting and include different types. Once I get those things knocked out I'd like to see if I can add mouse support as well.
Cheers!
4
u/masterofallvillainy Aug 01 '18 edited Aug 02 '18
We've come to the end and I don't have anything to show for it right now. Being that Oubliette is graphical, I've had to come up with my own rendering. The method I was using was really inefficient and it lacked drawing the isometric walls and animations of the entities. In working on a new rendering method, I realized that the were some features I want to make sure I implement but how Oubliette was structured; I'd need to make drastic changes to both entities and the game map to do so. So I've decided on a rewrite. Currently I have the game map reconfigured and redesigned for a better map gen and am redesigning the renderer to reflect those changes as well as add in the new features. Walls are almost working correctly. Theses so much to do still but Oubliette will continue posting to r/roguelikedev with updates as they happen.
Update: well I spent the better part of last night and today after work implementing walls.... Only to discover that the method fails and produces errors. :( But while walking the dogs I thought of using entities as walls. I'll have to change the map gen again, but will be a lot easier to do actually.
3
u/Lovok Jul 31 '18
I've done the python 2.7 libtcod 2.6 tutorial; before starting my own game, should I move to python 3 with this tutorial?
3
u/CrocodileSpacePope Aug 05 '18 edited Aug 05 '18
Well, my Rust partitcipation won't be continued (for now). Three reasons:
It was a fun journey so far, I learned a lot, but I am simply not able to continue at the moment. Since the tutorial series is over, too, I will instead focus the time I can use on my real project.
The Repo can still be found here, it won't be removed or changed: https://github.com/CroPo/roguelike-tutorial-2018
3
u/haveric Aug 06 '18
Python (Tutorial) | JavaScript | JavaScript Demo | All Versions
The last couple weeks have been crazy (even lost a day this week due to a power outage), but I finally got caught up and added a couple extras that I had wanted to.
Thank you to everyone who put this together. It's been a lot of fun following along with everyone and seeing what others can accomplish in such a short time. I'm not entirely sure if I want to continue this as a full project, but I do plan on doing a bunch of refactoring and code cleanup so I could at least use parts of it in future projects.
The biggest challenge I ran into was having to refactor some of the code for saving/loading. I thought I could just JSON stringify everything and get away without needing any external libraries, but realized quickly that prototyped objects don't remain intact after stringifying them. Ended up using ResurrectJS, which worked spectacularly although I may have refactored too much before finding it. Everything else worked pretty well without relying on external libraries, just that a few things took a bit longer.
Things that I added:
Things I still want to add:
Again, thanks to everyone who put this together. This has been a good challenge for me and I look forward to future events where I hopefully can come into them a little more prepared.
2
u/GSnayff Not Quite Paradise Aug 11 '18 edited Aug 11 '18
I have been reading everyone's progress with the tutorials and it looks like people are getting on really well. Thank you to everyone for sharing their experiences.
I am going to start working through the tutorials today, in GameMaker Studio. I think a lot of refactoring will be necessary, but as a near total beginner I am sure that will be simple enough, right?
I notice I have missed the actual weekly but I will provide progress updates here nonetheless, for posterity and motivation! :)
Part 1
So GameMaker (GM) does a lot of the required work for us, particularly for rendering to screen and library initialisation. However, the work flow is completely different to the tutorial, requiring details to be spread all over - that or to have one monolithic script referring to all the other component parts.
I settled on 2 scripts for the input (one to interpret, one to handle outcomes) and rather than using a dictionary I converted the input to variables (bools) and then referred to those. I am trying to balance following along with preventing future rigmarole. I also bundled everything under one "MainController" object. This allowed me to add a single object to the room and then have everything else required, at this point only the player and InputController, created from there.
I had the biggest trouble with getting it to go fullscreen. For some reason the variable holding the current state of fullscreen worked in the IDE but not when run, errorring out. So I went for the less efficient method of querying the fullscreen state and using a switch against that. This worked fine. Also worth noting is that Alt+Enter is a default command in GM and doesnt need to be setup, so I switched the command to "F".
My thoughts coming out of Part 1 are around the level of deviation already in place, particularly not using a dictionary for actions. Let's see if the decision bites me later on down the line.