#libtcod tutorials
Explore tagged Tumblr posts
sensualcoder-dev · 11 months ago
Text
Project Updates - Aug 6, 2024
Back at it again! I'm hoping to get these devlogs up to at least once a month, if possible, assuming I can keep up this kind of pace with coding. Updates under the cut~
SWN GM Tool
When I decided to update my project list, I said I was moving my old SWN GM Tool down to a sort of backburner status. It felt a bit like the end of an era; the GM tool was my first real personal project that I had started after college and had been poking at it for the last ten years or so, so officially putting it on hold with a desire to come back to it one day was a little interesting.
Especially since I started working on it again that very same week.
I decided to start the whole project over, essentially, and use this as an opportunity to learn to use Godot more at the same time. Within a few days, I had made a simple Faction creation widget as well as a list of factions. In a week, I had a mechanism for saving that faction list to a file and loading it back up as well. All in a simple application made with Godot UI nodes!
I haven't touched the project again in a little over a month, now, but I'm feeling very good about returning and working more on it. Next steps are to make a Faction View scene that shows the stats and assets of the faction, and allows adding and removing assets. Once I feel like I have a good enough user experience for it - something that's not really my specialty - I'll probably upload it to itch.io with just the Faction and asset tracking. After that, I'd like to include a simple map and then a way to run the Faction Turn.
Libtcod Tutorials
Over a year after I received feedback from r/roguelikedev about my attempt at making a C++ tutorial for libtcod, I have begun making a concerted effort to continue working on the codebase again!
After the whole effort of getting a simple eventing system using double-dispatch in place, I took a pretty good break before returning. I decided to make sure the code was working on both Linux and Windows, and updated to the C++23 standard at the same time, which introduced some issues. At first I thought it was a problem with MSVC, but was able to replicate it with Clang as well. It turns out that the way I was doing virtual inheritance for the event handlers worked perfectly fine in C++20, but broke in C++23. Getting that figured out took a few days, but after that I confirmed it worked on GCC, Clang, and MSVC :D
Next I'm going to continue working on the actual tutorial code before I return to writing the tutorials for C++ again, to make sure that there's not more optimizations or architectural changes I'll want to do down the line that would be better to backport again.
3 notes · View notes
stealthcoder · 7 years ago
Text
Side-stuff updates
I haven’t posted since Christmas for the mandatory Ludum Dare spam, but that doesn’t mean I’ve been idle. On the one hand, I joined a project at work using Cocos-2dX, so I started a smaller project at home to implement a first pass on RTS mechanics using a top-down 2D view using that library. My reference is Castle Fight, a relatively well known mod for Warcraft 3 (Fun fact: if you think about it some of the most successful games right now both on mobile or PC (most MOBAs, Clash Royale, etc) can be traced to a mod of WC3/SC, or a variation). Progress is slow because life (and to be honest, Arena of Valor -_-). I’m trying to keep over-engineering under control, and I’ve started coding some construction logic. Hopefully soon I’ll be able to show something better than this.
Tumblr media
Besides, this week began the #7DRL challenge. I’ve used the opportunity to check TDL, a Python-3 upgrade of sorts to libtcod, a c++/python library that has lots of useful functionality to code a roguelike. However, I don’t have any clear idea for a game that could use it, so for the time being I’m basically refactoring a tutorial. Hopefully I’ll come up with something. On the gif you can see how the player moves around on a map. FOV is provided  almost for free by TDL.
Tumblr media
I tried to extend the tunnelling algorithm to support diagonal corridors with some old code for a C++ roguelike project using PDCurses. The corridors are built just fine, but I need to review how surrounding walls are built to avoid overlaps. And last, I also managed to shortly revisit Roblike. I had to upgrade it to Unity 2017, which broke the alpha blending shader. While I was fixing that I also managed to replace a custom masking material with Unity’s new and shiny SpriteMask. Then I thought that replacing my custom tilemap logic with Unity tools could be an interesting excuse to resurrect the project in the not-too-distant future.
1 note · View note
sensualcoder-dev · 2 years ago
Text
Woo, it's online! Tutorial 1 for the #cpp libtcod #roguelike #programming tutorial series is finally up.
Please check it out if you like, and let me know what you think! It's my first time creating anything like this, so feedback of any kind is appreciated 😊
8 notes · View notes
sensualcoder-dev · 2 years ago
Text
Project Updates - 10/7/23
It seems like every time I make progress on something and put it out there for people to see, my motivation to continue just tanks and I forget to work on it for a while 😅 (Plus day job stress and other general life things working against me too lol) That said! I have been doing a bit of rework on my libtcob tutorials following some good feedback from the r/roguelikedev Sharing Saturday thread I posted in a few months ago. I worked on getting the project to build using vcpkg on Linux and Windows, which actually wasn't too difficult to get set up. Originally I wanted to stay away from using package managers and really any other libraries and things besides what was absolutely necessary for getting the tutorials up and running, but my system wasn't exactly the most straightforward either, so I think the vcpkg solution works. I also updated the code to use the newer libtcod system of contexts for rendering, which was also fairly simple to implement. Now I just need to rework the tutorial text, hopefully I can find time to work on that this weekend!
Additionally, I messed around some with Ogre3D the last couple days and got a minimal setup running to evaluate using it for OpenHomeworld. Initially I thought about using a more bare-bones setup and building it out from scratch for a more bespoke engine using something like raylib, but I think getting something running first with a robust and full-featured library like Ogre is probably a better way to go about things. If I can keep the code modular enough, I can always go back and start replacing the Ogre code if needed, but I think that Ogre will end up being the main rendering framework that the project will use anyway. No need to reinvent the wheel and all.
Speaking of bespoke systems and raylib, I am tinkering around with a little project that's been in my mind for a little while, a little RPG project based on some mostly obscure JRPGs. At this point I'm not sure if I want to take the time building a full game engine from scratch or if I should learn Godot instead. Maybe I can do a small scale implementation in libtcod even, and then port some of it to Godot. Lots of options here, but mostly still in the basic design stage.
All in all, I have a lot of ideas for things and finally have energy and motivation to try to work on them! :) It's an exciting time, and I hope that I can continue to make updates like these, too!
1 note · View note
sensualcoder-dev · 2 years ago
Text
I'm back
The recent Unity kerfuffle got me thinking about implementing a game engine again and reinvigorated me to work on the libtcod tutorials. Ended up reworking the first tutorial code to use the newer Contexts that libtcod has moved to, and even refactored my second tutorial code as well!
The actual tutorial text will hopefully come later this week sometime, though I did diagnose a weird issue with the CSS I was using on my pages so that it doesn't show a white bar on the side of the code blocks while in dark mode :D
Getting excited to be in C++ programming land working on engine stuff again!
1 note · View note
sensualcoder-dev · 1 year ago
Text
Project Updates - 5/7/24
Looks like it's time for my bi-yearly "remember this blog exists and post an update"! 😄It's been another few months of off and on work due to my day job and other life things going on, but still trying to chip away at things.
More on the individual projects under the cut~
libtcod tutorials
Since my first crack at writing up the C++ tutorials for libtcod, I've mostly been trying to decide what I want to show for them. Part of the feedback I received on the first tutorial was that it didn't have a clear audience, whether it was for beginners to programming or to more advanced developers. I've gone back and forth on this, and I think I've settled on making it more accessible to newer programmers, though that does mean I have some reworking to do. On the upside, I was able to fairly easily change the code on the early tutorials to account for newer versions of libtcod.
I have also been working through reimplementing later tutorials. Most recently worked on the fourth tutorial, where I decided to introduce an event handling system using double dispatch (specifically using the way outlined in this blog post). This approach is a bit complex to implement and describe since it uses certain template patterns, but overall it should allow for the rest of the tutorials to easily add functionality by simply adding events and new event handlers. Actually implementing it took a couple of days of trial and error due to a lot of factors (mostly trying to understand how it all worked myself), but now it's in a good state and pretty easily extendable! Explaining it in the tutorial, however, will be a different story 😅
OpenHomeworld
This is mostly still in the rough design phase still. Most of the tinkering I've done has been around loading and listing the Bigfile contents, and optimizations around that. I'm tempted to start working on a GUI archive tool to display items as well as insert and extract files from the Bigfile, though I'm not sure if I want to make something in Qt or try my hand at making a plugin for Godot. The Qt tool would probably end up being pretty simple and just show a list of files like how 7zip or WinRAR work, which itself would be just a UI around a command line tool, really. If I tried creating a Godot plugin, I'd also want to handle viewing and editing the files extracted from the Bigfile, too, and that would probably also require implementing the way to handle the Homeworld texture, mesh, script, and other files that have their own format internally. The Godot option is tempting, since I would want to have some sort of editor for the project at some point, but I'll probably keep is simple at this point and just make some small command line utilities. Options, though!
At the same time, I've been playing with the source port of the original game and trying my hand at updating the build system to CMake. This has gone mostly smoothly, except for one snag that I have yet to figure out a good way to handle. You see, the old Homeworld source code is written in C, but the game levels were created in a scripting language that the Relic devs used called KAS (which I think stands for Kick-Ass Scripts lol). Essentially these KAS files would get converted into C code and compiled into the main game executable, and the way the game is built with Makefiles makes it pretty easy to hook in calls to the utility programs to convert these files. In all my messing around, though, I have not been able to successfully replicate that process using CMake. I might need to specify all of the mission files explicitly to have them build and link properly, but I worry I'll end up running into a situation where the build will fail due to things being run out of order in multi-threaded builds (which is already a problem with the source port process though). Analysis continues...
Metal Max Redux - GBC game project
In my last devlog, I mentioned that I was interested in making a game based on a series of obscure JRPGs. The Metal Max/Metal Saga games are ones that I found last year and fell in love with, so much so that I wanted to create a game based off them. The first game in the series was an NES game that was never released in North America, but has a wonderful fan translation patch that I was playing through, but have not actually completed quite yet. It's a fun little RPG where you can drive tanks around a post-apocalyptic world fighting monsters, and has a pretty open structure to it, not unlike the first Dragon Quest or Final Fantasy.
Last year I also came across GB Studio, a free and open source all-included editor for creating GameBoy and GameBoy Color games from scratch, and this gave me a great idea: since I was a huge fan of the GBC port of Dragon Quest I+II, I thought I would make a similar port of Metal Max. So Metal Max Redux was born!
I'm still mostly in the beginning stages with this project still, but I've created a basic mock-up of overworld movement and triggering random battles. The random battle system took a while to puzzle out, and at one point I thought I was going to have to extend the engine that GB Studio uses, but I was able to make it work using a step counter attached to an invisible player object that seems to work well enough. Next steps will probably be analyzing how the NES battle code worked, so I'll be looking at lots of assembly. Fun times! 😄
Free City-States - lewd city management game
Finally, a project to earn my screenname 😄 I really enjoy city builder and management games like the Caesar series and Dwarf Fortress, and within the last few years games like Crusader Kings and Stellaris.
A while back, I was starting to help out with a project called Free Cities Reborn, itself a reimagining of an HTML game called Free Cities, a lewd management game with some city building aspects. I couldn't continue with FCR after a while due to some growing reservations about the content and focus of the game which extends somewhat to the original too, since its core gameplay is around the raising, training, and sale of sex slaves. It's a fun indulgence, if somewhat of a guilty pleasure, and it's certainly not the first game that's concerned with the subject matter, but I still felt weird contributing to a project where it was so focused on that. But at the same time I started to think about creating my own spin on the core ideas, and creating my own lewd game in general.
So that's how Free City-States came to be envisioned. The core game concept in my mind is more akin to Crusader Kings and Stellaris than to Caesar and Dwarf Fortress, but focused on the management of a fantasy city-state. I've created a small mock-up in Godot as my first real foray into that game engine so far, and hoping to continue chipping away at it as the concept becomes more fleshed out 😊
Wow, this ended up way longer than I thought it would, and this doesn't even cover all the small ideas and tinkerings I've been working on! Putting it down into words, I guess I really did do a lot between the last post and this one 😅 Hopefully future posts will be a little shorter, but this was a fun way to reflect on the things that I'm working on. I think I'll try to make fortnightly updates if I can, going forward.
0 notes
sensualcoder-dev · 2 years ago
Text
Libtcod Tutorials Update
Been a little bit since my last post about the tutorials, so here's an update!
I haven't finished the code for the tutorial 8 yet, instead I've been going back and refactoring some of the older code and consolidating some things.
Besides that, I've been slowly working on doing the writeups for the tutorials themselves, and currently have the basic setup as well as the website hosting the tutorials through Gitlab. Check it out here!
I'm hoping to have more code and writeups soon, definitely want to finish them up for this year so I can start on tutorials for the newer implementation of libtcod! :D
3 notes · View notes
sensualcoder-dev · 3 years ago
Text
Finally have been making more progress with the libtcod tutorials. The last time I worked through the older C++ tutorials I got a little stuck at tutorial 6, and figured I needed to do some more reading on architecture concepts. Now, I have gotten through #7 and am on my way into #8.
This time, I am working off of the Python tutorials that HexDecimal made a couple years ago though, which are better broken out in general so it's a bit easier to work through and convert to C++. Though there are still some architecture and best practices work to be done for modern C++ and general software engineering. I started reading the Gang of Four software engineering book recently, so I did a pass through of the code so far to check through the code architecture to see if there was anything that could be improved, and it felt good to put some of the theory I've read into practice.
At some point I'll still have to write up the actual tutorial part of it so others can actually follow along, but I'm overall a lot happier with how it's all turned out so far!
0 notes