Resurrecting a Lost Game 5 Years Later
I lost my game's source code in 2021. It came back from my own itch.io page. Coding agents handled most of the port to C. I chose the architecture and reviewed the result.
In 2021 I entered a game jam and built a small puzzle game called Longo Doggo. You steer a dog through grid rooms, push boxes into holes, step on buttons to open doors, and the spacebar makes him bark.
I made it in GameMaker Studio 2, and I had never heard of version control. Git, GitHub, none of it registered. When that computer's data was lost, the project files went with it.
For five years I assumed that was the end of the story. The game was still available on itch.io, but I thought I'd lost the code I needed to keep working on it.
This month I recovered the code from that public download, ported the game to C, and shipped version 2 with features I'd been thinking about since 2021.
The only copy was public
My itch.io page still hosted the zip from the jam. I downloaded my own game like any visitor would and unpacked data.win, the GameMaker data file holding its sprites, sounds and rooms.
Then came the luck. Mine was a VM build, so the file also held the scripts as bytecode that a decompiler could turn back into readable code. The dog's brain was still in there.
I opened it with UndertaleModTool, a tool made for digging through GameMaker data files, and got the game's code back as 108 GML scripts, plus 112 sprite frames, seven sounds and a manifest of eleven rooms, including a level editor I'd built and forgotten. Suddenly I could read my own code again.
Reading it was one thing. I expected hand-porting it to take weeks of spare time I didn't have.
A fresh engine
Rebuilding a GameMaker project around the recovered assets would probably have been quicker. I have fond memories of toying around with it, but this time I wanted direct control over the full project and also, being a small game, using a game engine felt like an overkill.
The new Longo Doggo uses C99, with raylib handling graphics and audio. I can follow the game's tick order in one function. One codebase builds for Windows, Linux, macOS and the browser.
What the agents actually did
Coding agents worked from the decompiled GML. I used two prompts for the main port, followed by cleanup. The first asked them to match the original code as closely as possible.
The result reproduced much of GameMaker's behavior in C, with my game logic translated almost line for line. It played like the original, apart from some minor bugs. The port was possible, but it carried too much engine machinery.
The second prompt asked for a refactor. I directed the agents toward code grouped by object, a shared collision map, and an explicit tick order in a single function. That gave me code I could follow and improve.
There was still cleanup after those two prompts, fixing leftover bugs and removing dead features and unnecessary code. The agents made this manageable as a small weekend project.
Actually reading the code
Once the game worked, it was tempting to stop there. But I wanted to understand the code I was about to open-source. Reading it turned up things I wouldn't have noticed from playing.
One function processed an entire bitmap font even though the game only used a few digits. It worked, but it did more than the game needed. That was the kind of excess I was looking for during review.
The agents got the port running. I still had to decide which parts belonged in this game and understand what I was publishing. That's what keeping ownership meant here.
The features I'd been carrying for five years
Once the port matched the original, the backlog in my head finally had somewhere to go. Two wishes had been on it since I published it.
The first was undo. Getting stuck used to mean restarting the room. A puzzle game shouldn't penalize you for experimenting. Now the Z key rewinds one step at a time.
The second was a browser version, so people could play right there on the itch page instead of downloading a zip. Version 2 runs in the browser and on desktop.
The source is safe this time
The project I lost now lives on GitHub.
Someone asked for more levels on itch.io in 2021. Five years later, I can finally make them.