Making Games
Answers to your questions about the art, craft and business of game development.
Prince of Persia Source Code — Posted!
My Apple II-unaware friend Jamie walked into my office this morning, surveyed the detritus of yesterday’s marathon source-code extraction, and asked “Good Lord, what happened here?!”
I explained that the original Prince of Persia source code had just turned up after being lost for 22 years, and that two stalwart companions and I had dedicated most of the previous day and night to extracting it and posting it on github.Jamie — who knows the term “source code” primarily as the title of the movie Jake Gyllenhaal did after Prince of Persia — digested my explanation; then, looking as confused as before, asked “Why?!?”
It was such a simple question, it stumped me for a moment. Why would I spend a whole day trying to recover data from some ancient floppy disks?
I said: “Because if we didn’t, it might have disappeared forever.”
Why source code?
Non-programming analogy: Video game source code is a bit like the sheet music to a piano sonata that’s already been performed and recorded. One might reasonably ask: If you have the recording, what do you need the sheet music for?You don’t, if all you want is to listen and enjoy the music. But to a pianist performing the piece, or a composer who wants to study it or arrange it for different instruments, the original score is valuable.
It’s possible, up to a point, to reverse-engineer new source code from a published video game, much as a capable musician can transcribe a musical score from listening to a performance. But in both cases, there’s no substitute for the original document as a direct line to the creator’s intentions and work process. As such, it has both practical and historical value, to the small subset of the game-playing/music-listening community that cares.
This is why I was so sorry to have lost the Prince of Persia source code, and happy to find it again.
Lost and found (Geek quotient = 9)
If you’ve read my 1980s game dev journals, you know that by the time Prince of Persia shipped in 1989, I was burned out on coding and seriously eager for the next chapter of my life to start. So I did what most programmers would do: I backed up my Apple II source code onto 3.5″ floppies, stuck it in a box, and promptly forgot about it.
Thirteen years later, when I looked for that box of source code again, I couldn’t find it. I was in Montreal with an amazing team making Prince of Persia: The Sands of Time. Lead programmers Dominic Couture and Claude Langlais had volunteered to port the original POP to the PlayStation 2, and slip it into our new game as an easter egg. (This was their idea of a fun respite from crunch time.) All they needed was the source code. But as much as we searched — from my garage to Broderbund’s archives to Doug Carlston’s basement — it was nowhere to be found.
Finally we tracked down Scott Shumway, who’d done the 1992 Mac port of POP. He didn’t have the Apple II source code either, but he did have the Mac source code. Dom and Claude made short work of porting it to the PS2, and Sands of Time got its easter egg. Everyone was happy.
On my return to LA, I dug deeper, and turned up a whole shoebox full of Apple II floppies, some dating back to high school. The source code to all my early games was in there: Deathbounce, Karateka. But no POP.
I didn’t need the source code for anything; and it wasn’t as if POP had been lost to history — vintage Apple II POP copies (and their disk images) were widely available — but still, it bothered me to think that something I’d spent years working on was just gone. I felt dumb for not having kept a copy.
This was eight years ago. I gave up the search and forgot about it.
Until two weeks ago, when my Dad shipped me a carton of my stuff he’d found cleaning out the closets of his New York apartment. Inside was the source code archive I’d mislaid in 1990.
Paper is forever
Here’s the thing about digital backups and magnetic storage media: They don’t last very long.
Try popping your old 1980s VHS and Hi-8 home movies into a player (if you can find one). Odds are at least some of them will be visibly degraded or downwright unplayable. Digital photos I burned onto DVD or backed up onto Zip disks or external hard drives just ten years ago are hit and miss — assuming I still have the hardware to read them.
Whereas my parents’ Super 8 home movies from the 1960s, and my grandparents’ photos from the 1930s, are still completely usable and will probably remain so fifty years from now.
Pretty much anything on paper or film, if you pop it in a cardboard box and forget about for a few decades, the people of the future will still be able to figure out what it is, or was. Not so with digital media. Operating systems and data formats change every few years, along with the size and shape of the thingy and the thing you need to plug it into. Skip a few updates in a row, and you’re quickly in the territory where special equipment and expertise are needed to recover your data. Add to that the fact that magnetic media degrade with time, a single hard knock or scratch can render a hard drive or floppy disk unreadable, and suddenly the analog media of the past start to look remarkably durable.
This is why, when I posted about finding the POP source code, digital archivist Jason Scott, Apple II collector Tony Diaz, Derek Moore, and the technical teams behind the DiscFerret and Kryoflux disk readers volunteered their time and effort to give us the best possible shot at a successful extraction.

Let me begin to count the ways I’ve been lucky with this: The box was found. The disks were intact. Prince of Persia and I happened to have a high enough public profile that people of Jason and Tony’s caliber (and dozens of others who contributed their expertise via IRC, skype and twitter from around the world) cared.
In the bigger picture, our timing was lucky. The 1980s and the Apple II are long enough ago to be of historical interest, yet recent enough that the people who put the data on the disks are still with us, and young enough to kind of remember how we did it. Roland Gustafsson, author of the special 18-sector RWTS routines that had made our disks super-efficient in 1988 (and unreadable to anyone but us), was able to get on IRC in 2012 and explain what he’d done to Discferret kids who weren’t born then.
For all these lucky reasons, our archaeological expedition was crowned with success.
From a preservationist point of view, the POP source code slipped through a window that is rapidly closing. Anyone who turns up a 1980s disk archive 20 or 30 years from now may be out of luck. Even if it’s something valuable that the world really cares about and is willing to invest time and money into extracting, it will probably be too late.
This is why it’s awesome that there are people out there working on digital preservation. Because now is the time.
Back up your backups
Jason suggests the following rule of thumb: If you have data you want to keep for posterity, follow the Russian doll approach. Back up your old 20GB hard drives into a folder on your new 200GB hard drive. Next year, back up your 200GB hard drive into a folder on your new 1TB hard drive. And so on into the future.
As for me, the past 48 hours have been a fun walk down memory lane. And have given me a renewed appreciation for paper, celluloid, and stone tablets.
(Postscript: For 6502 assembly-language aficionados, the Prince of Persia source code is now up on github, along with a README file that answers some frequently asked questions. I’ve been amazed and moved by the outpouring of interest in the #popsource saga — it literally crashed this website for several hours today.)
Now, I really need to get back to my day job of making up new stuff. I can only hope to have the same lucky, glorious headache of trying to recover some of it 20 years from now.
Further reading:
“Making of Prince of Persia” game development journal
Deathbounce Kickstarter: Fully Funded!
In my PAX keynote yesterday, I mentioned that although Karateka is the game that launched my career, I actually had just as high hopes for the Apple II game I made right before it, as a 17-year-old freshman in college: Deathbounce, which I submitted to Broderbund Software founder Doug Carlston but he declined to publish.
A clamor immediately arose in the audience, offering to support a Kickstarter campaign for an iOS/Android version of Deathbounce.
I tried to discourage this, pointing out that Doug’s judgment that Deathbounce was unlikely to set the gaming world on fire was well founded even in 1982. Nevertheless, ever since yesterday, people have been coming up to me at PAX and trying to give me money.
It turns out I actually have a disk image of Deathbounce on my MacBook Air. Continue Reading
Prince of Persia Source Code — Found!
(Warning: Geek Quotient of today’s post = 11)
My Dad (yep, the same guy who composed the music for the original Karateka and Prince of Persia) called from New York to tell me he was doing some spring cleaning and had shipped me a carton of old games and other stuff of mine he’d found in the back of a closet.
The carton arrived yesterday. My jaw dropped when I saw what was inside.
No, I don’t mean the stacks of Spanish Drosoft versions of POP and Karateka (though those are cool too, especially if you have an Amstrad computer with a cassette player). I mean those three little plastic 3.5″ disk boxes nestled among them… which appear to contain the ORIGINAL APPLE II SOURCE CODE OF PRINCE OF PERSIA that I’ve been searching for, off and on, for the past ten years, pestering everyone from Doug Carlston to Danny Gorlin and everyone who ever worked at Broderbund, and finally gave up hope of ever finding.
I KNEW it wasn’t like me to throw stuff out!
So, for all fifteen of you 6502 assembly-language coders out there who might care… including the hardy soul who ported POP to the Commodore 64 from an Apple II memory dump… I will now begin working with a digital-archeology-minded friend to attempt to figure out how to transfer 3.5″ Apple ProDOS disks onto a MacBook Air and into some kind of 21st-century-readable format. (Yuri Lowenthal, you can guess who I’m talking about.)
This is a crazy busy time (in a good way) with too many projects, so it might take a little while. I’ll document our progress via the twitter and facebook feeds, and I promise, as soon as we can extract something usable, I’ll post it here.
Karateka Fan Letter from John Romero
When I was 17 years old and dreaming of a career making games, my role models — the people who created the games I admired — were known to me only as names on Apple II title screens. I couldn’t look up their bios, read interviews, or check out their websites, because the internet didn’t exist yet. I didn’t know what they looked like, what countries they lived in, or if their names were even real (“Lord British“?).
There was one way, though. You could send a letter to the publisher (the old way, with postage stamps) and hope that it might get to the game creator who might actually read it.
At 17, I didn’t have the chutzpah to think of that — but another enterprising kid named John Romero did. John informed me of this when we finally met, in an elevator at GDC, years after he’d fulfilled his childhood dreams and become one of the best-known game designers on the planet, thanks to Wolfenstein 3D, Doom, and Quake.
John’s first words to me were: “I wrote you a letter. In 1985.”
When I got home, I dug it out of storage. Indeed he had. It was one of the first three or four fan letters I ever got — forwarded by Karateka’s publisher Broderbund Software to my Yale Station post office box, where I was a 20-year-old senior in college. John himself was “17 going on 18,” as he was careful to specify in his letter, perhaps figuring the extra year might cause me to take him more seriously.
John assures me that he has my answer in storage somewhere. I don’t remember what I wrote, but you can read his original letter here. Thanks, John!
I couldn’t resist posting this now, because I’ll be seeing John again next week at GDC. We’ll be on a panel with Tim Sweeney (Epic) and young whippersnappers Adam Saltsman (Canabalt) and Notch Persson (Minecraft), moderated by Jane Pinckard, on the topic of “Back to the Garage: The Return of Indie Development.” Hope to see some of you there!
Announcing Karateka
One big difference between the movie and video game industries is the way they handle news about upcoming projects.
Movies are announced early, and often. When a writer sells a pitch, when a director is attached, when a role is cast — all of these stages leading up to making the movie are freely reported and commented on. Even though there’s no guarantee when, or if, an actual movie will ever get made. (See Fathom.) And studios are fine with it.
Video game studios, on the other hand, guard their game development plans like military secrets. It’s not just that they don’t want work-in-progress visuals getting out and giving a less-than-ideal impression of the game. Often, they won’t even confirm that a project EXISTS until it’s almost done, with tens of millions of dollars already spent and the end in sight.
A side effect of this is that, when game developers rub elbows at conferences like GDC, if A should ask B in a moment of drunken camaraderie “What are you working on?” the accepted answer is a big cagey grin and a tease: “Nothing I can talk about!” This is true even if B is the lead designer of Mass Metal Destruction 1 and 2 and remains employed by the same studio. It shouldn’t really surprise anyone that, MMD2 having made half a billion dollars the year before, someone has thought of doing a MMD3. But some things are not to be spoken out loud.
So it’s an exquisite frustration particular to game developers that we spend our time talking (and blogging, and being interviewed) about every aspect of our work EXCEPT what we’re actually working on and are most excited to talk about.
And for me, today, it’s an exquisite joy to finally be able to say this in print:
For the past year, I’ve been working with a small team to develop a new, updated remake of Karateka — the game that began my career 27 years ago.
(If you didn’t happen to encounter Karateka in the early 1980s, you can read its backstory here.)
A New Karateka
Eight years is a long time between games, even for me. Since Prince of Persia: The Sands of Time shipped in 2003, I’ve been busy writing movies, TV, graphic novels, and other non-game projects. It feels great to be hands-on making a game again, and I can’t wait for you to be able to play it.
It’ll be a downloadable game for Xbox 360 and PlayStation 3, out this year. We’re looking at bringing it to other platforms too. I’ll update with more details in the coming months, as we get closer to release.
How different is the new Karateka from the original? It’s closer than the 2003 POP:SOT was to the original, side-scrolling Prince of Persia. But it’s a more radical reinvention than, say, the 2007 XBLA Prince of Persia Classic. The new Karateka is much more than a port; it’s both a remake and a re-imagining of the original game for today’s consoles.
For me as creative director, it’s been an exciting chance to experiment with new gameplay mechanics and ideas that on previous console generations (and on the Apple II) I could only have dreamed about.
Why downloadable and why indie? For a lot of reasons, downloadable just feels right for Karateka. The original was a simple, compact, pick-up-and-play game that didn’t require a lot of tutorial to understand what you had to do. Beating the game was hard, but even little kids could have fun playing it from the first moments. I wanted to honor that simplicity. Jumping from the Atari 400 to a huge triple-A retail console title felt like it would have been too big a leap.
I want to show that a game can be simple fun while also telling a human story in a way that’s emotional, atmospheric, and beautiful. I’ve been encouraged to see gamers embrace downloadable titles like Limbo and Braid — games that stand out because of their design integrity and strong artistic choices, although they were made on modest budgets and don’t represent technological breakthroughs. The industry is changing fast. It’s an exciting time for indie.
And it doesn’t get much more indie than programming a game on a 48K Apple II in my college dorm room, mailing it to a publisher on a 5.25″ floppy disk, and crossing my fingers — which is how Karateka began.
Back to GDC
In a couple of weeks at San Francisco GDC (Game Developers Conference), I’ll be doing a panel with Tim Sweeney (Epic), Adam Saltsman (Canabalt), Notch Persson (Minecraft), and John Romero (Doom) discussing “Back to the Garage: The Return of Indie.” I hope to see some of you there.
After that, it’ll be time to put my head down, get back to work, and get back to not answering questions for the next couple of months.
But now you know at least one of the things I’m working on.
Many thanks to everyone who’s taken the time to comment, or post on twitter or facebook, asking for a new Karateka or sharing your memories of playing the original game. Your encouragement means a lot to me and has helped to get this project off the ground. I truly hope you’ll like the result.
Watch this blog and the Karateka page for updates.
It’s a Book!
I’m happy to announce that in response to numerous reader requests, The Making of Prince of Persia is now available in two additional formats: in .epub format, and (drum roll…) paperback!
The paper book comes from CreateSpace, a really cool self-publishing service for authors. Basically, we sent them a print-ready PDF and they did the rest. The book weighs in at 323 pages, and looks and feels like a good-quality trade paperback. We’ve priced it at $16.99 (the difference from the ebook versions reflects the printing cost).
You can purchase the book here.
To anyone who’s previously paid for another version of the ebook and would like to have the .epub version for convenience, let us know and we’ll email it to you. Like the PDF, it’s non-DRMed.
Once the dust has settled, I’ll post (and Aaron, Dave and Danica may guest-post) about the results of our grand ebook/self-publishing experiment, and what we’ve learned. Short answer: It was more work than we anticipated — but now that we know how, the next book should be a lot easier. I think.
Also: For readers curious about who some of the people referred to in the journals are, or what became of them, I’ve posted a “who’s who” of players in the making-of-Prince of Persia saga, here.
Many thanks to everyone who’s read the book and reviewed, posted or tweeted about it. The response has been fantastic, and makes it all worth it.


