r/roguelikedev • u/aaron_ds Robinson • Jul 24 '18
RoguelikeDev Does The Complete Roguelike Tutorial - Week 6
This week is all about save files and leveling up!
Part 10 -Saving and Loading
http://rogueliketutorials.com/libtcod/10
By the end of this chapter, our game will be able to save and load one file to the disk.
Part 11 - Leveling Up
http://rogueliketutorials.com/libtcod/11
We'll allow the player to go down a level, and we'll put a very basic leveling up system in place.
Of course, we also have FAQ Friday posts that relate to this week's material
- #20: Saving(revisited)
- #21: Morgue Files(revisited)
- #36: Character Progression
Feel free to work out any problems, brainstorm ideas, share progress and and as usual enjoy tangential chatting. :)
11
u/Lokathor dwarf-term-rs Jul 24 '18
What up it's Lokathor again with a Week 06 Release and a Week 06 Lesson.
This week was pretty short, no two ways about it. We introduce our second dependency to the code: serde. It's a crate so good you don't want to pass it up. Automatically does all the serialization and de-serialization for you. We also learn to delve deeper into the depths of the world.
8
u/t_r_a_g_e_d_y Jul 25 '18 edited Jul 25 '18
Just thought I'd mention that
shelveis part of the standard library but Part 10 says to install it with pip. Might lead to frustration trying to find or use the wrong package from pip.7
u/EsotericRogue Jul 24 '18 edited Jul 24 '18
The livestream will be tonight at 8PM EDT (20:00 UTC-4). We're using Python3 and Libtcod 1.7 on Windows 10. Here're links for the repository and video archive.
That was another vary long double session. I do have two issues, 1) is that I have more fov_recomputes than the tutorial itself, and 2) I was unable to the problem with a status message being chopped. I'll look at those before we move on to part 10 tonight, but I'm a little worried I won't find a resolution yet.
Oh, we can probably count on me not being able to do both 10 & 11 in one sitting o,O
7
u/brianbruggeman Jul 24 '18
Kelte
Github
Weeks 04, 05, 06:
gallery
Life has gotten in the way (my three year old and infant, birthdays, travel, holidays, work deadlines... 😱), and so my productivity on Kelte has taken a major dip. At the moment, Kelte is in a mostly broken state, so no release at this point.
Highlights from the past couple of weeks:
TODO:
That's all for now. Thanks for reading!
6
u/SickWillie Goblin Caves Jul 25 '18
Barbarian! - Github Repo | Blog
Using C++/SDL2
Well, I officially fell behind - but it seems I'm not the only one! Part 8 was actually not that bad to figure out - once I actually sat down and started working on it. I found yet another cool use for the linked list class I wrote... The inventory component started life as a
std::vector<Entity>, but I quickly realized that you can't randomly move, sort, or remove things out of that container - and all of those things are completely necessary for an effective, clean inventory. The linked list class does all those things super easily though!I also switched to using a 9x14 font, instead of a 12x12 - I think it makes a huge difference in readability, and looks pretty darn nice. I'll start Part 9 tonight, and probably finish by the weekend. Parts 10 and 11 shouldn't be too difficult - I've been planning for both of them for the entirety of this project.
Here's a video with this week's progress!
6
u/Rakaneth Jul 25 '18
I am much farther behind than I want to be - for work reasons, but also because of some refactoring.
game.jsno longer depends onfactory.js, so I can now use functions fromgame.jsinfactory.jswithout causing a circular dependency. This allows me to query the gamestate in my mixins.There is also a rudimentary event system in place to allow objects to communicate with each other, as well as a message log.
The refactoring did not go well at first, as I had to also refactor how commands worked. I've fixed everything to have a running game again, so now I can get back to catching up - I have a semi-free weekend coming up, and I hope to get caught up then.
6
u/[deleted] Jul 25 '18
My progress
Repo
I have been slacking off way too much this week. I didn't get anything done except the bare minimum for the tutorial basically. The only thing that diverged from the tutorial is that for now you can go back up stairs after going down. I'm not sure I'll keep that around but I thought it felt consistent to have a set of stairs under the player when they spawned on a new floor.
Saving and loading was painful and has some hackery going on around it, but that was to be expected. The current implementation of most object types don't lend themselves well to serializing because you need to recreate all the object instances when deserializing to get all the methods set up and such. In a perfect world, deserializing would simply be a "JSON.parse" call and not much more.
With that in mind I designed the Level component a bit differently so that it wouldn't have any instance methods. Instead the methods are static functions taking the Level object as a parameter. It's still not perfect but ultimately I would want the components to just be "POD" types that don't contain any logic of their own, in a more "pure ECS" style.
The touch screen interface has fallen way behind so there is right now no way to save+quit or open the character info screen or pass a turn on touch screen devices. That's going to be my focus tomorrow.
6
u/CrocodileSpacePope Jul 26 '18
GitHub Repository - Rust with tcod-rs
Because I don't know if I will have enough spare time to finish more this week, I will show what I have already done:
This week was really fun so far. I had no real problems in implementing that stuff, and it just works. Too bad I have not that much time, because I really would like to implement a spell casting system based on MP, and not only on scrolls. Maybe later - I mean I need something to fool around after the tutorial is over, too.
Somehow, both my Game State and ECS stuff work better than I ever had hoped for. Not that both of these are perfect in any way, but they work, and I am really happy about that.
If I can finish more before next Tuesday, I will edit this post.
And as always: I appreciate any form of constructive feedback! Just drop me a note
5
u/masterofallvillainy Jul 25 '18
Oubliette is still behind. but rapidly working to catch up. Implementing A* in pygame was difficult. I spent nearly 3 days working on it. but now it works perfectly. For whatever reason, implementing the Enum for RenderOrder results in my entities being rendered in the reverse order from what they ought to be. not sure why that is, but i'm just using the reverse() function to get the desired results. I'm currently working on the font and text system i'll use to display messages in game. and once I have that I'll remove all prints to the console. heres a gif of whats been implemented so far.
https://imgur.com/gallery/GUMXdlX
5
u/[deleted] Jul 25 '18
GitHub repository -- Ruby/BearLibTerminal
Got as far as part 10.
Ruby has a built-in module, Marshal, for serializing and deserializing objects, so the save and load part was relatively simple.
The main menu ended up taking a while, though. I wanted to make the inventory use an instance of the
Menuclass instead of being its own unrelated thing, and I had written up some menu-related code a while back for another (abandoned) project, so I decided to dig it up, dust off the cobwebs, and see if it could be used.Several interesting bugs later, I've added a system for three kinds of menus -- ones where you can select by clicking an item, ones which you can scroll through with the arrow keys, and ones where each option is keyed to a letter of the alphabet (like traditional roguelike inventory menus). Both the inventory and the main menu use this class.
I've also started up a TODO.md.
There's no GIF of the game per se this week, because it doesn't look all that different, but here's a sample menu.
4
u/[deleted] Jul 24 '18
Right now I don’t have much to show, apart from officially having migrated from using make to CMake! I feel like this is a big deal because I’ve been intimidated by CMake for a long time now, and it’s incredibly exciting to be able to produce build files for whatever platform I need. I know for sure I will be getting my old Windows laptop out and getting Ubuntu on it so I can build for the all PC platforms. I’ll be editing this post once I’ve gotten the save file stuff done.
4
u/Inkwalker Jul 27 '18
I don't have much progress this week. Managed to finish items and inventory. Here is how it looks:
Inventory
Repo is here
4
u/Yaygrrs Jul 28 '18 edited Jul 28 '18
I noticed the note in part 11 of the tutorial.
A fix for this:
Instead of
We can instead poll
key.vkto see if it is of the formlibtcod.KEY_TEXT:4
u/Zireael07 Veins of the Earth Jul 29 '18
Haxe
https://github.com/Zireael07/roguelikedev-does-the-complete-roguelike-tutorial-2018
I am now halfway through week 6 (and unlikely to get much more done due to the heatwave here which is supposed to last through the next calendar week).
I finished the inventory screen, but I skipped the activable items (i.e. part 9) and went straight to save/load, which was made easier by the framework (I could save just the entity positions instead of serializing the whole Entity class). For a larger game, however, serializing will be necessary at some point (luckily Haxe has built in serialization support, it's just waay too hot for me to grok it right now).
I also implemented descending dungeon levels (part 11), but due to the heat I'm seriously considering skipping the leveling up character part (I also think I skipped it last year because I already had a levelless mechanic in mind for Veins).
4
u/_velocicat Jul 29 '18
whew! Not a lot of time lately. I'm definitely off the rails tutorial track, but I'm making some progress implementing a few features that I've wanted to add. I worked up a simple sound engine to play a few sounds. I also implemented an effects engine to handle a simple blood splatter mechanic as well as a knock back effect similar to DRL when using the shotguns.
I still need to add a few things, such as a simple stats display. I also need to make the enemies more interesting. Currently they can only execute melee attacks. I was able to get them to chase the player on sight. I also only have one type of enemy, so I'd like to implement a few others.
Lastly, I'd like to come up with a basic theme to move the action along.
Cheers!
6
u/DerreckValentine Jul 24 '18 edited Jul 25 '18
Noooooooo I knew this was coming! I'm officially behind! I got really far ahead week 1 or 2 and then have only been able to program in 10 minute spurts. Stupid life stuff.
I'll hopefully have some time to work the next 2 days late at night. I'll post a progress gif then.
Edit: Here's an update. At least I'm making progress!
https://imgur.com/a/ZsV6vKv
3
u/t_r_a_g_e_d_y Jul 28 '18 edited Jul 28 '18
I made a nice main menu https://i.imgur.com/TUHtCoV.png The white flecks are supposed to be stars inside the pyramid. I don't know if that comes across.
And I made my own print frame function because I don't like how tcod's
console_print_frameleaves a block on the top if you leave thefmtargument empty. Made some meters to try it out: https://gfycat.com/AcrobaticGrandAfricanwildcat1
u/Lukestep11 Jul 31 '18
Where can I find the other weeks? Very interesting btw!
0
u/[deleted] Jul 25 '18
[deleted] — view deleted comment