r/roguelikedev • u/aaron_ds Robinson • Jul 17 '18
RoguelikeDev Does The Complete Roguelike Tutorial - Week 5
This week is all about setting up a the items and ranged attacks!
Part 8 - Items and Inventory
http://rogueliketutorials.com/libtcod/8
It's time for another staple of the roguelike genre: items!
Part 9 - Ranged Scrolls and Targeting
http://rogueliketutorials.com/libtcod/9
Add a few scrolls which will give the player a one-time ranged attack.
Of course, we also have FAQ Friday posts that relate to this week's material
- #7: Loot(revisited)
- #32: Combat Algorithms(revisited)
- #40: Inventory Management
- #60: Shops and Item Acquisition
Feel free to work out any problems, brainstorm ideas, share progress and and as usual enjoy tangential chatting. :)
26
Upvotes
10
u/Lokathor dwarf-term-rs Jul 17 '18
Lokathor is back at it again with Week 05 of the Roguelike In Rust Tutorial
This week we:
8
u/[deleted] Jul 17 '18
My TypeScript effort
Source code
Aside from following along with the tutorial, I spent some time over the last week getting the game working on touchscreen devices, so now if you play the game on a phone a 3x3 grid should pop up and touching different parts of it move the character in that direction. Clicking the center part of the grid pops up the inventory normally, unless you're standing on an item, in which case it picks up the item. To exit out of the inventory you tap the top left cell, and to drop an item you tap the top right cell.
I have diverged from the tutorial a little bit in that you can navigate the inventory with the up/down buttons and enter (or the center cells in the grid on touch), and when using an item that requires targeting you move a red tile around to aim instead of clicking to aim. I will probably add clicking/tapping to aim and choose items in the inventory at some point in the future since it's a bit more intuitive on touch devices, but on PC I prefer to play entirely on the keyboard.
I think next up I'm going to add some kind of help text/hints to make it clear what actions are possible, especially on touch where there is currently nothing in the game telling you that touching the top left and top right in the inventory does something.
7
u/Zireael07 Veins of the Earth Jul 17 '18
Haxe
https://github.com/Zireael07/roguelikedev-does-the-complete-roguelike-tutorial-2018
Part 8 is done (minus the inventory screen). I am not feeling that well (the usual monthly bane of my life has arrived) so I am not up to coding all the states necessary for the inventory. However the rest was very simple to make, just translating from Python to Haxe as I went with the tutorial.
The rest of part 8 and part 9 will probably get done next week, I intend to enjoy the time off :)
6
u/SickWillie Goblin Caves Jul 18 '18
Barbarian! - Github Repo
Using C++/SDL2
A lot of the past week was spent trying to figure out how I want to split up the Entity class and add the Fighter component for combat in part 6. In retrospect, I overthought a lot of what I was trying to do, and in the end the simplest solution ended up working perfectly. Adding combat and using the pathfinding algorithm I wrote last week was extremely satisfying - even though the combat system is really basic at the moment (it's identical to what's in the tutorial). Surprisingly, adding a message log and a (also very basic) UI was incredibly simple - all of the parts were already there and nothing really had to be tweaked!
I'm excited to expand on this later, and my list of things to work on after this tutorial challenge project is rapidly growing.
Here is a short gameplay video of what I have so far at the end of Part 7!
The most obvious fix I need to work on is the linewrap of the message log - it splits by character and should be splitting by words. I'll probably tackle that and try to make everything look a little cleaner before tackling Part 8 this week.
5
u/EsotericRogue Jul 17 '18
Sakes alive, it's week 5! 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.
This week a friend mentioned it's hard to read programming streams on his tablet. What can I say, the stream is a crisp 1080p! He should have it on the 70" in the living room!
Is making me consider the final product tho. Libtcod does have a fullscreen option so that the 80x50 char game itself would be readable, but having apps switch native resolutions feels so clunky these days. I'll have to see if libtcod does have scaling, or at worst resolution detection so I could write a routine for largest font possible.
... oops, sorry for rambling. I should save up my ramblings for when I go live.
5
u/dystheria Jul 17 '18
Newbie effort in C++2017 with MS Visual Studio
Repo can be found here
Parts 8 and 9 are available in the repository however no lesson write up at present. Unfortunately, this might be where my offshoot of the tutorial halts.
The reason for that somewhat dramatic statement is due to the complexity of serialization in C++. I'm currently battling with learning the concept and best practice implementations of serialization in C++ but it is most definitely not without its challenges, so until I manage to get a handle on implementing serialization with the use of libtcod and smart memory I am most likely going to fall behind in my progress.
I'll keep plugging away and any time I actually break ground I'll most likely drop a comment on the Saturday Sharing post.
5
u/[deleted] Jul 18 '18
GitHub repository -- Ruby/BearLibTerminal
I've added an inventory and a system for items which can be picked up, and the three kinds of items in the tutorial (healing potions and scrolls of fireball and lightning bolt)
One tweak I'm pretty happy with was making confused enemies show up as purple to make it clear when the status effect wears off.
I tried several ways to display the range of an effect, but they all looked rather bad. I ended up just having a green square under the mouse when the target is within range, and a red square otherwise.
This GIF shows most of the new features.
4
u/[deleted] Jul 19 '18
What's up guys, I've got my progress on my cyberpunk roguelike thing here. I've been told by /u/SickWillie that everything builds fine on Arch Linux, so it looks like my makefile works for at least Linux. In other news, I've found a project that uses Docker for cross-compilation, so for next week I might be able to provide builds for all platforms!
The one question I have is how do I ensure my compiler uses the local include and lib directories before the system directories? I haven't been able to figure that one out from looking at man pages/help output.
4
u/Inkwalker Jul 20 '18
Hello everyone!
I'm following using Unity. Here is my progress from last week:
Image
Source can be found here: GitHub
4
u/masterofallvillainy Jul 21 '18
this weekend i'll be catching up. I'm two and a half weeks behind. But here is a gif showing what little i've done so far.
https://imgur.com/gWT7mZA
4
u/CrocodileSpacePope Jul 22 '18
GitHub repository
Rust and tcod-rs
A I mentioned in last week's posting, I ran into some trouble with Rusts mutable and immutable borrows. Because of this, and because of a somewhat stressful personal time, I am a bit late to the party. Actually, I am still missing Part 9, but I don't have much more time this week, so this is what I have done!
[Part 6] (https://github.com/CroPo/roguelike-tutorial-2018/tree/master/part_6) was, where I ran into the issues. The cause was simple: The tutorial made one of their components interact with any other entities from the same list. This isn't directly possible in Rust if I need to change the values of some of these (as I need to do when performing an attack). It did cost me one week to slap together a somewhat usable ECS-like thing. Honestly, I wouldn't recommend anyone on doing this on their own, and I will surely use a ECS library for a game I do outside of the tutorial (or, maybe, I won't even use one at all). Tbh, I just made it by myself because I wanted to know how this could work. Just click the link to read my full journey.
[Part 7] (https://github.com/CroPo/roguelike-tutorial-2018/tree/master/part_7) took me about a day, mostly because it was late and I did run into some very weird value lifetime issues which held me back a few hours.
[Part 8] (https://github.com/CroPo/roguelike-tutorial-2018/tree/master/part_8) went pretty well, no big issues. I only needed to restructure my game state management a bit.
It's getting too late to really be able to work in the next part, so I will stop right here and try to finish Part 9 together with 10 & 11 on Tuesday.
As always, I am happy about any kind of feedback!
3
u/haveric Jul 23 '18
Python
Between another side project getting an api update and
being distracteddoing research with cataclysm dda over the weekend (Thanks Quill18), I am still working on the JavaScript version. Keeping up with the Python tutorial isn't too bad though. Hoping to find some time to catch back up this week, just not sure when.0
u/[deleted] Jul 17 '18
[deleted] — view deleted comment