4 Hugues Ross - Blog: 01/01/2017 - 02/01/2017
Hugues Ross

1/30/17

Let's Make a Roguelike: Back Again!

It's done!

If you've been watching the blog, you'll know that I've had some fun these past few weeks. That's been dealt with, and I can finally release the next part of my tutorial series. You can read it here.

For those of you who don't care for tutorials, but are curious about the demo that I was making, here are some links:

Windows build
Source code

It may look a tad underwhelming, but being able to distribute builds to platforms other than my own is an important first step. Now that that's been dealt with, I think things will be going much more smoothly from here on out. Keep watching this space for more updates as they come!

1/24/17

The Delay Continues, and I Explain it

As the title implies, I'm pushing last week's tutorial back another week. I realize that all of these unexplained delays make me look a bit lazy, so I'm going to give you a proper explanation of why this one "almost finished" tutorial segment is taking so long to be released, and why I've spent the last few days pulling my hair out.

Last Monday, I was mostly done with the tutorial. To demonstrate various features of curses, I made a nice little demo application. The code was still a little bit messy, but I figured that as long as I could compile a Windows version of the demo, I wouldn't have any problems.

Unfortunately, there was a small problem. I'm not sure if I've mentioned it here, but I started using Meson for builds instead of writing makefiles. This is good, because Meson works very well. However, I'd never actually tried cross-compiling code with it before, and I was having issues setting it up. In light of this, I pushed the tutorial back so that I would have some time to fix the issue and clean up the code.

Fast-forward to this weekend, when I finally have the time to sit down and figure out my problem. I got the Windows version to compile through Meson, but it would just crash immediately. I spent almost the entirety of my weekend trying various versions of PDCurses and messing with the code, until I finally tried making a stripped-down "hello world" and moving it over to my Windows machine for testing. I should also mention that due to certain circumstances, moving things to my Windows machine takes 5-10 minutes. It's a pain, but I'm working to resolve this over the next week or so.

Anyway, it's at this point that I realize that the PDCurses library really hates cross-compiling. The code is fine, and I manage to get it working by compiling it on my Windows machine. (This seems to be an issue specific to PDCurses. I've had tons of issues like this, but only when using that specific library)

On Monday (yesterday), I've figured out the problem but I still don't actually have a Windows build of the demo. Monday afternoon (after work), I realize that at some point, my fiddling has broken the demo completely on my PC, and it won't work on Linux anymore! Fixing this bug took 3 hours, because it was caused by an innocuous-looking include statement in a random header file.

After dinner I finally transfer my code over to make a Windows build. I set everything up in Code::Blocks for building, get a compiler error, open the relevant file, and Code::Blocks crashes. When I reopen the project, everything is gone. I repeat that song and dance a couple times, and it finally works. Still, the editor is stuttering a ton and making my life a pain.

I finally get the code to build, run it, and...it doesn't work. Fast-forward another 15-30 minutes, and I figure out that the window isn't resizing to fit the content, which screws everything up. When I shrink the content as a test, I come to the horrible realization that my program isn't drawing to an SDL window, it's drawing to the Windows command prompt! I HAD THE WRONG VERSION OF PDCURSES INSTALLED THE WHOLE TIME!

It's 11:00 PM at this point. I now have a Windows build, but it looks like this:

For reference, the build is supposed to look something like this, more or less:
It's at this point that I finally decide to cut my losses and delay things again. It's super late, I'm exhausted, I still don't have an acceptable Windows port, and the code is still not cleaned up, thanks to all of the delays.

So, that's the end of my tale. I'm pretty sure a less stubborn programmer would've simply given up at this point, but that's not my style. I'm going to try and get things sorted out for next week, and I think it'll be fine now that I'm aware of the issues. However, if I can't finish next week, delay again, and still can't finish it by February 6th, I'm putting the project back on hiatus and making a different tutorial series. I've lost a ton of time to some really silly and unexpected issues, and I can't afford to keep slamming my face into a wall forever.

In unrelated news, my personal projects have all been approved. You can expect some more posts about those once this stupid thing is dealt with.

1/16/17

A Small Delay

I've just about finished writing this week's tutorial, but I'm delaying its release until next Monday. While the text and most of the code is done, I'm having some issues getting the build to work nicely in a cross-platform manner. This is mostly due to my inexperience with Meson and some recent factors that temporarily reduced my free time.

Personally, I think it's more important to have this tutorial feel polished and complete than to hit every single deadline perfectly. It's still unfortunate that I have to push things back (especially this early on), but I think this is better than just throwing out something half-baked.

On the upside, once these issues are dealt with I'm unlikely to have to deal with them again, even in future projects and tutorials. I'm still in the process of feeling things out, as far as tutorials are concerned, so figuring things like this out early on is good. With that said, I'm probably going to try to complete future tutorial series before I start posting them, just to ensure that they don't get delayed.

1/2/17

Let's Make a Roguelike - Prep Work

Two weeks after uploading the first part, I've managed to keep to my schedule with a new one. With any luck, I'll keep this up!

This part started out as a lightly-edited version of the old part 1. However, I wasn't happy with it. Today, I sat down and rewrote the whole thing, and I'm very happy with the result. It's likely that I'll be deviating from the old tutorial quite a bit going forward.

So, what can I say about this new part? I mostly shifted the subject away from the limitations of curses, and more towards an explanation of the options that are available and what I plan to cover. I think the result is well-structured, and has a much better flow than the old part 1. It still has no images, since there isn't much to show, but I've got plans for part 2 that I'm hoping will help out a bit.

The other major change affects the tutorial series overall. I'm moving the tutorials away from ncurses, and focusing on the SDL version of PDCurses. I'm hoping that the narrow scope combined with better cross-platform support will make this series much more helpful. Using Meson for builds will likely help as well.