Yesterday I finished The Making of Prince of Persia — Journals 1985–1993 by Jordan Mechner. It was an awesome read and I whipped through it in no time. I don’t know what I expected, but the book was much more to me than just a developer’s journal. Maybe it’s because Jordan’s 1980s self was as old as I am today. The book made me think about career choices, free time, family, and friendship.
Fancy words, I know. Also, this post is not about that.
It is rather about a neat little yet ingenious technical thing that I am trying to reproduce. A retro experiment, if you will. I caught myself smiling when I stumbled upon this line in the book:
Sure, these worries are part of the old game development days that are long gone. But it makes me appreciate games from back then even more. I mean, where is the challenge in game programming today? Sometimes I wish for the romantic of computer technology in the eighties, to be frank.
Back to my little experiment. Jordan found a solution for his dilemma:
It is ridiculous how his idea is simple and brilliant at the same time. Use XOR and everything is going to be fine, no big deal. I wanted to try it out anyways. Say ‘Hi’ to the Prince and his 1-pixel-shifted friend!
I used imagemagick and Seashore to do exactly what Jordan suggested: I took the two images and XORed them together. The result looks magically familiar:
You may say the outcome has been obvious all along. However, I felt great as I witnessed the Shadow Man coming to life on my computer—25 years after his first appearance!
Shadow Man might be a bit misleading, since the Prince’s antagonist is really his own reflection in the mirror. Spoiler: Before you approach Jaffar, the final opponent who captured the princess, you reunite with your evil twin to regain your full strength.
It doesn’t matter… From now on I will always refer to him as Shadow Man. Simply because I can picture Tomi Pierce, who coined this name, with eyes wide open, a huge smile on her face, and all filled up with excitement.
Just like me, when my dad introduced me to Prince of Persia.
- I do find the rise of computer games fascinating and stunning. But I also think that they are stagnating. Fortunately, I have the feeling that HTML5 games might have set the stage for some true innovations and new pioneers.
- The characters in this article are from the DOS version of the game. Here you can find a nice screenshot collection of the different versions.
- This is a perfect analogy for the underlying math: Iff a xor b = c, then c xor b = a (the last equation is also true if you switch a and b). Beautiful!
- Shit… When I googled for her last name, I found out that she died of ALS 4 years ago. Based on Jordan’s obituary, it seems Tomi was a wonderful person. May she never be forgotten!