I’ll admit that I’ve been violating Rule #7 of Software Development by not storing my project in a version control system. Actually, I’m storing it in my OneDrive folder, which means it synchronizes across multiple computers so, you know, I can work on it in multiple locations.
The other night I booted up the project at home, but I didn’t see my most recent changes. In fact, I did, but they were duplicate copies which had been renamed to refer to the other platform on which I’d last been using them. “Oh well,” I thought. “They’re just dupes.” So I deleted them. Hard deleted them.
Turns out those files were the most recent updates, and what I had left over were the older copies. I freaked out, to the point where I downloaded an app that supposedly allowed me to undelete files (which is scary when you see how many of your files you can undelete). But when I said I hard deleted them, I mean it, so good news is that Windows does a decent job of scrubbing things that your average off-the-shelf recovery software can’t find, if that matters to you, Mr Snowden.
Needless to say, I was pissed because one of the files was my core data management scripts that contained all of my loading and saving functions. Those functions comprised the one part of the game that I felt was “complete” in that it was generic enough that I wouldn’t need to touch it again even when adding elements that needed to be saved to the overall game itself. Nice, efficient, powerful. And gone.
I spent the next session re-writing the whole thing mostly from scratch. I still had a much older copy to serve as a reference, but was missing several key methods, like the one that managed the save game manifest file (the manifest holds info on all of the actual save game files, and is what is read when you click “Load Game” to allow you to select a saved game to load). The good news is that I had just enough of a memory (and some notes) to allow me to recreate the system, but better. I feel that this new iteration is more robust even than the original, which I was a big fan of. And once I’d completed the work, I zipped up the code and stashed it somewhere safe.
So I need to get this stuff into Github, which I’ll hopefully end up doing this weekend. That way, I can avoid future costly mistakes. Learn from my sorrow, kids: Always use source control.