Developer Diary: Re-Animator
I’m working on eight-year-old code. Specifically, I’ve dug my hands into the barely-cold remains of our first commercial release, Home — and it’s been a while since I’ve been inside this twisting mass of awful code and panicked comments.
The deeper I slosh through Home’s innards, the more horrified I am. Did I really think that was a viable way to display a text box consistently? How could I have possibly made those door objects that convoluted?
But I must confront my past and what I’ve done. And somehow, Home keeps finding new customers, and there are new platforms out there. So if I’m going to keep this thing alive, it’d be a good idea to clean it up a little.
Here’s what I’d like to tidy up, by priority:
- How the game handles its title screens and cutscenes vs. the main gameplay (since the resolution of those screens is different)
- How the game scales/adjusts for different resolutions / ratios
- That the game uses a single, cleaner save/load system
I started by drawing little diagrams, just pencil on paper, as I go through the code, reminding myself how it works, so I can see it visually.
This week I started making new objects to handle the revised functions — luckily, I have similar ones from Worse Than Death that I can appropriate. I just import them, review for variables or other bits that don’t apply, and then make notes about stuff I’ll need to adjust/fix later. I have no shame in re-using code.
So far things are going well. But as I poke around more and more, I’m finding more and more weird issues that I want to fix. But that’s enough for now — it’s time to get this corpse up and walking again.