A three-week jump this time, due to a lack of time on devblog day. There are some developments that I’m excited about.
Skipped a week because I didn’t have time in the window to do the devblog. Let’s see how we’re going.
It’s starting to look “like a bought one”, as they say.
Who says that? They do. You know, them. Heck, I just did, so me too.
There’s a lot to cover, so I’ll try to be brief. I will likely fail.
My, what a productive week it has been! Many bugs fixed, and many new bugs created (and also fixed).
If we were just working off bugs-fixed, this would have been a banner week, indeed, since I was briefly creating them as fast as I resolved them. However, there was a whole lot more going on.
Due to Easter and other such complications, I didn’t end up posting a development update last week. It’s been a great fortnight, though.
Let me rummage through my notes and see what we’ve got.
I walked into the kitchen, and put the kettle on, and put the fixings for coffee into my mug. The cat was bugging me for milk, so I gave him some.
He wouldn’t touch it, but just stared at me.
I petted his head and rubbed his back. Then he got into the milk. He needs the full dining experience.
I went to the back door, started rolling a cigarette and half-way through a nagging something in my head tried to get my attention.
“Oh, bugger,” I said out loud.
I’d found a bug in my mouse-interaction code. It was code that I hadn’t touched, or even looked at since maybe August last-year, when I wrote it initially. A nine-line function that turned mouse-clicks into proper UI-widget interactions.
Suddenly, the shape of that code was floating in my head, and it was the wrong shape. It didn’t … fit.
The code had never misbehaved, or done anything wrong, but that wasn’t the point. I knew it was wrong, and I had a feel for how it would misbehave. Even if I couldn’t remember the exact lines of code.
My instinct was telling me that mouse-clicks might pass through non-reactive UI elements and trigger reactive elements underneath. That had never happened, to my knowledge, but I was suddenly certain that it would.
So, I aborted making coffee, and my cigarette and went and looked at the code.
I was right. It was wrong. It would behave in exactly the wrong way that I had envisioned, if the circumstances ever came to pass (and they would!).
So, I fixed it. New code. New shape. It settles in more comfortably now.
This, though, is how I find bugs. 90% of the bugs I find aren’t because something goes wrong. In fact, the game behaves perfectly. It does everything it should, exactly as it should. I’ve seen no sign that there’s an issue, and nothing’s been reported.
But I’m in the bathroom, or having a cigarette, or trying to sleep, and there it is. I suddenly know that a bit of the code isn’t right, and in what way it isn’t right. There’s a kind of synaesthesia at work – the codebase exists in my head as a collection of shapes that aren’t shapes, and colours that aren’t colours.
Whatever I’m doing, or wherever I am, some part of my brain is walking over that model, looking for anomalies. And finding them wherever they are.
It would, perhaps, be nice if it could announce them right away, while I am actually writing the code, for example, but no. It chugs away in its own good time doing a whole-program analysis, and then bugging me about it when my attention is on other things.
At four-thirty in the morning, some noise sets the dog barking, which wakes me up in turn, and then that synaesthestic model is hanging in my head, focused on a rendering function, or caching algorithm, that’s working but is invisibly buggy. And I know what’s wrong. I can fix it in five minutes. If I got up.
Getting back to sleep again – or maintaining any kind of task-focus on anything else – is pretty hard when you’ve got one of these things dangling in your forebrain, insisting on being fixed.
Finding bugs the way regular people do (when things just plain break or misbehave) seems like a lot less trouble.
Last night, I tried to write a simple function. It should have taken me about a minute to write, and eight lines of code.
I got it wrong. Very wrong. Astonishingly wrong.
I got it wrong in every possible way you could get it wrong, and in a few entirely new impossible ways, apparently artisinally-crafted just for the occasion.
In short, I screwed it all sideways, and sixty seconds of code turned into somewhere North of two hours of swearing and debugging.
Today, it’s all genius again. Less than a dozen lines of code adds optional mouseover logic to my widgets, which gives them a delicious, customisable, tactile feedback. Great code. Elegant, concise, and correct.
I revisited last night’s code and fixing it was trivial and obvious.
Look, it doesn’t matter how good you are. You may be smart, skilled, and experienced. You can know your language inside-out. You can thrive on it like some cyborg supercomputer hybrid. You can be a genius among geniuses.
Sometimes you are just going to be unable to sit down and do the thing without completely bollixing the whole thing up, and bollixing it worse when you try to fix it.
You will have times like this. Fifteen minutes. An hour. Two hours. Maybe a whole day. It will happen.
Own it, because it’s going to get you now and again. Sometimes you will screw up the simplest arithmetic. Sometimes you can’t get something right even though you’ve done it a thousand times, like a champ.
If you can’t do the thing, do something else. Have coffee. Play a game. Help another team-member. Get lunch. Take a nap. Ask someone else to do it. Sit in the garden and sob inconsolably – whatever works for you. Just walk the hell away from what you’re screwing up and come back to it when your head is back in order.
An even more important lesson here is to help others deal with it when it happens to them, too. Because it will, and dissing them about it makes you an arse.
Screwing up is less important than properly dealing with it.
I should have closed my editor at least an hour sooner than I did, and done something else. Instead, I kept burning time in The Pit of Fail.
Don’t do that. Do something else. Do anything else.
I missed last week’s development blog post due to the pressure of other things, so I’ve got two weeks to cover.
On the narrative side, I’m nearing a long-awaited story milestone. The prologues are complete for each of the eleven protagonists, and all but two of them are written through to the end of the rather dense and complicated first day of the story proper. Once those last two characters are written through, that will represent a major milestone.
That brings us to (today), 88 scenes and 232,814 words. That’s more than Dune (the book), or Neverwinter Nights (the game) [This isn’t a competition!], but we’re not really into the full swing of things yet. That will be in the second Act, which is where the bulk of the narrative technology should start to shine (I hope!).
Almost let the day get away from me without writing the update for Week 19. Project board says I’ve got 147 commits for the last 7 days, and closed all of my bugs (though a couple cosmetic ones turned up near the end of it).
Mostly this was an engine-work week again, so mostly working on Argus, rather than SNAFU, but SNAFU got some time as well.
Coming out of the tangled and awkward mess that constitutes the usual (and I use the term advisedly), “festive season”, I’ve had my head down with a fairly major overhaul of the game-engine.
Once I started, it was hard to stop – particularly, since once I started, the engine was pretty much broken until I was mostly done. The primary work was converting to SDL (version 2, in case you’re wondering). I spent a couple hours figuring SDL out, then dove into the conversion.
The secondary work was just as interesting, as I started doing the necessary portability work to get the engine to build and run on other platforms.