Devlog: April Update

Did you know code rots? If left unmaintained for a period of time, a codebase will degrade. You wouldn't think it possible. It's not like the source code can physically change without human intervention. And yet. The Private Dick codebase is falling apart. Well, this month I'm stopping the rot. [img]{STEAM_CLAN_IMAGE}/42879931/8bb26e090650b964558c004ba64820471b199ec6.png[/img] [h1]How does code rot?[/h1] There are two mechanisms of code rot. The first is essentially social (all the hardest problems are social). Officially speaking, Private Dick only has one developer touching the code base (it's me, Cisco, hi!) But in practice, there are at least three coders working at the same time. Cisco, Yesterday Cisco (what an asshole) and Tomorrow Cisco (who will be a genius if he ever shows up). And actually there's also Writer Cisco who keeps messing about with stuff without thinking things through, and sometimes Firefighter Cisco turns up with a quick fix and then fucks off, never to be seen. Many people working on a codebase can introduce as many problems as it fixes. But where I'm hurting now is that I'll make maybe one or two commits (code changes) a month. And usually with a very different hat on each time. So stuff gets half-assed, or forgotten about, or confused. Like, three weeks ago Cisco added a new function to make dialog easier. Will tomorrow Cisco remember to use that one, or the old one? When you only work on the codebase for a couple of hours per month, you start introducing lots of little inconsistencies. You don't finish stuff. You don't document it. You forget what you did. You break something unrelated and don't realise. When your time is limited and your context on the project is shallow, any fixes you make tend to introduce breakages at the same time. So, next time you sit down to work, something either doesn't work, or doesn't work like you think it did, or doesn't work like you think it should. The other problem is more environmental. Maybe your codebase doesn't change - but the rest of the world does. The libraries that your game depends on (often invisibly), the engine you make the game in, these things all change. If you wait long enough, even supported operating systems will vanish. One day you reinstall the game and a dependency has changed, and suddenly some functionality is broken. Without touching your code, your project is dead. [h1]Cataloging The Rot[/h1] In my case most of the problems come down to that saboteur Yesterday Cisco. Lots of little changes slowly degrading the quality of the codebase. It scares the shit out of me. I have code branches that I can't remember what they are - year old experiments and I have no idea whether they have value. I'm half-way through updating to the latest version of the game engine (RenPy 8). I think it works but I'm not certain. After reinstalling my OS a month ago, all Ren'Py games run slowly, with graphical glitches, and sending my CPU into overdrive. I have no idea why. My dialogue system is half-way through its third rewrite. The first two rewrites still have code in the game. It's chaos. I have animation tests scattered everywhere and I'm not sure how I'll ever find certain experiments when I pick the game up again. I have automated test suites which probably haven't been touched for 18 months. These would usually give me confidence that my code does what it should. Right now they feel like a liability. Oh, and I'm half-way through changes to the Notebook and Social Media screens (as seen in the ancient Kickstarter demo). They both sorta work but I'm not sure how. Any one of these things is an annoyance, another to-do for the wall. But the sum of them is an insurmountable barrier to development. When I'm not at my desk, I worry about the list of things that I'm not in control of, the little blockers that slow me down or stop me dead. When at my desk, I can't start working on one thing without another thing looming over me. [h1]Stopping The Rot[/h1] So, what are we do to about all this? 'Cause this game's gotta get made. Well, the major thing is to prioritise control of the codebase. For too long I've let things drift. Time to Take Control. Today I've already fixed a bunch of long standing issues, shit which has been seriously worrying me. I've updated to Ren'Py 8. I've fixed an issue on my new Ubuntu install which causes all Ren'Py games to run TERRIBLY (tl;dr for linux nerds - Wayland.) I've audited my source branches, deleted the crap, and planned how to boil everything into one branch (there was no good reason to create so many freaking feature branches) I've restored my unit tests, tidied them up, and settled on a plan for how to maintain them in the future. Amazing what you can get done in a day. I've still got a bunch of work to do fully take control, but I've made a really satisfying dent, and I'm not quite as scared of the code base as I have been. This will make it easier for me going forward to take an hour or two out of every day and get something useful done. That's just been impossible with the cognitive overhead of The Rot. [h1]This doesn't mean I'm a bad coder!![/h1] I posted this to Patreon a couple of days ago (the admin overhead of posting to [url=https://www.patreon.com/CiscoDonovan]Patreon[/url] is way lower than to Steam, so Patreon tends to get my posts first. It's totally free by the way!). And it occurred to me that it might make me look like a bad coder. The sorts of things listed above are quite a natural part of a development cycle and will affect any team. They're exacerbated in my case by the piecemeal nature of development over the last year. The fact that I'm tracking these things and standing up to them - rather than ignoring them and working around them - is actually a good thing for the project. The thing is, players will never notice whether a game's is well maintained and organised. But they'll sure as shit notice, sooner or later, if the codebase is a steaming pile. And I'm really trying to avoid that - despite a lack of time and resources right now, I'm trying to build solid. [h1]Signing Off[/h1] Well I know this is a super boring post. But this is what's on my mind right now and where my time is getting spent. So at least its honest. A final note, over the last couple of months I've taken a lot of personal and professional projects off my plate. I can finally commit more regular dev time. In a couple of weeks I should be back in command with a clean and tidy codebase. Not only this lift a burden from my soul, it'll make it easier for me to recruit a little help. Let's see how it goes.