Skip to content

Prince of Persia

A prince animated from videotape of the designer's brother

Jordan Mechner's Apple II game of 1989, published by Brøderbund. The prince's running, climbing and falling were traced from videotape of Mechner's brother, the player had an hour to escape the dungeons and rescue a princess, and the game was converted to most computers and consoles of the next few years. Mechner published his development journals, and in 2012 recovered the game's 6502 source code from old floppy disks and put it on GitHub.

When Computer Gaming World reviewed Prince of Persia in December 1989, Charles Ardai spent most of his space on how the hero moved. “Errol”, as he nicknamed the nameless prince, “runs, he creeps, he leaps and ducks, he hangs by his fingertips — and he looks like a real person doing it.” The reason was simple and laborious. Jordan Mechner had videotaped his younger brother David running, jumping and climbing, traced the movements frame by frame and turned them into sprites on an Apple II. Ardai concluded that “Prince of Persia is the Star Wars of its field.”

The game took Mechner four years, from 1985 to 1989, written in 6502 assembly language on the Apple II and published by Brøderbund. It sold slowly at first, then was converted to almost every computer and console of the next few years. Its prince returned in sequels, a 3D reboot by Ubisoft and a Hollywood film. Mechner kept a journal the whole time and later published it. In 2012 he recovered the game’s source code from disks his father had come across while spring cleaning, and put it online.

Fast facts

  • Designer and programmer: Jordan Mechner, whose first game was Karateka (1984).
  • Publisher: Brøderbund, 1989, for the Apple II at $34.95. In Britain the Amiga and Atari ST versions came out at £24.99 in early 1991, the Amiga one through Domark.
  • Goal: escape the Sultan’s dungeons and reach the princess within 60 minutes of real time.
  • Animation: rotoscoped from videotape of David Mechner.
  • Source code: 6502 assembly language, recovered in 2012 and published on GitHub.

Tracing a prince from videotape

Mechner had used rotoscoping before, on Karateka, for which he filmed his karate teacher and his father on Super 8 film. For Prince of Persia he switched to a VHS camcorder, which let him see a take straight away and record it again if it was wrong. He described the process to Wireframe in 2020. David, dressed in white, ran, jumped and climbed in front of the camera. Mechner played the tape back on a VHS machine with a clean freeze-frame and photographed the television screen with a 35mm camera, one picture for every third frame of video. When the prints came back from the photo lab, he painted each one with a black marker and white paint so that the figure stood out as a silhouette, and taped eight to twelve of them onto a sheet. A digitiser card, which he said came from a company in England, turned each sheet into an Apple II picture, and he cleaned the frames up pixel by pixel.

He wanted the weight to show. Animation drawn without a filmed reference had always looked wrong to him: “You could see that they had no weight and they never quite looked right.” His aim was “a character who felt fluid and lifelike so that players would feel suspense, knowing if they moved too far, they could fall into spikes and that it would really hurt.”

Reviewers noticed the details. Amiga Format pointed out in 1991 that when the prince stops running, “as he comes to an abrupt halt his torso will be thrown back”, and that when he climbs onto a ledge “you really push your elbows out to pull yourself up”.

An hour in the palace

The story came from films. Mechner told Retro Gamer that the first ten minutes of Raiders of the Lost Ark were an inspiration, and told Wireframe of his love for the 1940 fantasy The Thief of Bagdad. The Sultan is away at war. His Grand Vizier, Jaffar, has seized power and given the Sultan’s daughter an hour to marry him or die, and the player, her imprisoned lover, has that hour to get from the dungeons to the top of the palace. The time limit does not reset. As Ardai put it, “An hour is an hour is an hour.”

Each level is built from flick screens of platforms and drops, with loose floor tiles that give way, beds of spikes, blades that slice across doorways, and gates opened by pressure plates, some of them only for a few seconds. Guards with swords wait along the way, and the prince has to find a sword of his own before he can fight them. Mechner also took ideas from Lode Runner, a puzzle-platform game he admired but in which “you didn’t feel a sense of jeopardy”.

He did not give the player lives. “I felt limiting lives would be too mean to the player, but that infinite lives would lose the tension,” he told Wireframe. Instead the prince has a strength meter, topped up by potions scattered through the levels. Not every potion helps: The One warned that they “should be drunk or avoided”. When the prince dies, a keypress brings him back as often as needed, but the hour keeps running.

The strangest moment comes on the fourth level, where a mirror blocks the way. The game’s source code shows that a running jump through the mirror creates the prince’s shadow, a double that turns up again on later levels. On the final level, the code’s comments note, “Shadow steals sword”, and the prince and his shadow have to be reunited.

Mechner built the levels with his own editor. He had meant to include it on the disk, as Lode Runner had done. That did not happen, but it let him rebuild almost everything at the end: “Most of the final twelve levels that everybody knows were built or rebuilt in the last couple of months before the game shipped.”

Slow sales, then everywhere

The reviews were enthusiastic. Ardai wrote that “Playing Prince of Persia will simply spoil you for any game whose designers couldn’t be bothered to put this much effort into their product.” Sales were not. Mechner told Wireframe that the Apple II version sold only about 7,000 copies in its first eight months or so. As word spread and the game was converted to other machines, he said, sales “increased hugely”. The One gave the Atari ST version 93% in January 1991, when the PC version was already on sale at £29.99. In March 1991 Amiga Format called the Amiga version “maddeningly irritating and very, very addictive” and “an instant classic”.

Retro Gamer’s list of versions shows how far the game travelled: the Apple II, Macintosh, PC, Amiga, Atari ST, Amstrad CPC, ZX Spectrum and SAM Coupé among computers, and the NES, SNES, Mega Drive, Master System, Game Gear, Mega-CD, Game Boy, Game Boy Color and TurboDuo among consoles. By 1999 PC Zone put the game’s sales at “over two million copies”.

Its influence

Other developers took notice. In 1991 The One reported that Paul Cuisset, artistic director of the French company Delphine Software, had been so excited by Prince of Persia that he developed a new graphics routine for Delphine’s Cruise for a Corpse. Edge later described Cuisset’s Flashback as “strongly influenced by Another World and Prince of Persia”. Eric Chahi said that Mechner’s Karateka had strongly influenced the visual style of his Another World, which also used rotoscoping. When Tomb Raider came out, Cyrille Fontaine of Kalisto called it a “3D Prince of Persia”.

Sequels, a reboot and a film

Mechner was creative director of Prince of Persia 2: The Shadow and the Flame (1993), which had a team of programmer, sound designer and artists, and a 75-minute time limit. He consulted only briefly on Prince of Persia 3D (1999), published under The Learning Company’s Red Orb label. PC Zone‘s review of it was damning: “what was revolutionary in the Eighties is Nineties’ bread and butter”.

In the early 2000s Ubisoft approached Mechner about rebooting the series. Prince of Persia: The Sands of Time (2003), a 3D game on which he was credited as game designer, writer and creative consultant, revived it. It was followed by Warrior Within and The Two Thrones (2005). Mechner pitched a film to the producer Jerry Bruckheimer and wrote its first screenplay. Prince of Persia: The Sands of Time, directed by Mike Newell with Jake Gyllenhaal as the prince, came out in 2010 and, according to Wireframe, took more than $336 million. The series returned to side-on platforming with Prince of Persia: The Lost Crown, from Ubisoft Montpellier, released on 18 January 2024.

The journals and the source code

Mechner kept a journal throughout development. “I’ve kept a journal since I was in college,” he told Wireframe, “and I find it very helpful to work through ideas.” In 1985 he wondered in it whether there would “even be a computer games market two years from now”, and whether he should be writing screenplays instead. He published the journals from 1985 to 1993 as The Making of Prince of Persia, first as a self-published e-book and later as an annotated, illustrated edition from Stripe Press. In 2023 he told the story again, with his family’s history, in a graphic novel, Replay.

The source code was nearly lost. The disks holding it had been missing for more than a decade. Then, in 2012, Mechner’s father found a box of odds and ends while spring cleaning and sent it to his son. Among them were three 3.5-inch floppy disks with the Apple II source. Jason Scott of the Internet Archive and the late Apple II collector Tony Diaz read the 22-year-old disks, a job that, Mechner wrote, “took most of a long day and night”. In April 2012 Mechner posted the code on GitHub. He also made available a technical document he had put together in October 1989 for the teams converting the game to other machines.

The repository holds the game’s 6502 source, its disk routines and its copy protection. It carries no open-source licence. Mechner’s statement in it reads: “As the author and copyright holder of this source code, I personally have no problem with anyone studying it, modifying it, attempting to run it, etc. Please understand that this does NOT constitute a grant of rights of any kind in Prince of Persia, which is an ongoing Ubisoft game franchise.” For other games whose code has been published or recovered, see game preservation.

Sources

  • Charles Ardai, “Good Knight, Sweet Prince”, Computer Gaming World issue 66, December 1989, pp. 46–48 and 64: the Apple II version, price, story, time limit, “hundreds of movie clips”, and the quotes.
  • “Turning back time”, Wireframe issue 37, April 2020, pp. 18–23: Mechner on rotoscoping for Karateka and Prince of Persia, the VHS process, the digitiser, Lode Runner, lives and potions, the level editor, sales of the Apple II version, his journals and The Making of Prince of Persia, the sequels, The Sands of Time and the film.
  • David Crookes, “The making of Prince of Persia”, Retro Gamer issue 32, 2006: the release in 1989, David Mechner as the model, Raiders of the Lost Ark, and the list of formats.
  • Gary Whitta, review of Prince of Persia, The One issue 28, January 1991: Atari ST version (Brøderbund, £24.99, 93%), PC version (£29.99), potions.
  • Andy Ide, review of Prince of Persia, Amiga Format issue 20, March 1991, p. 77: Amiga version (Brøderbund through Domark, £24.99) and the quotes.
  • The One issue 34, July 1991, news: Paul Cuisset and the new graphics routine for Cruise for a Corpse.
  • Edge issue 163, June 2006, making of Flashback: “strongly influenced by Another World and Prince of Persia”.
  • Retro Gamer Collection volume 1, 2007, Another World feature: Chahi on Karateka and rotoscoping.
  • Edge issue 44, April 1997: Cyrille Fontaine of Kalisto on Tomb Raider as a “3D Prince of Persia”.
  • PC Zone issue 83, December 1999: review of Prince of Persia 3D (Red Orb, a Learning Company label), and the original’s sales.
  • Edge issue 214, May 2010: preview of Prince of Persia: The Forgotten Sands, with the film then coming out.
  • CU Amiga, February 1992: Mechner “filmed his younger brother”.
  • Edge issue 156, December 2005: Prince of Persia: The Two Thrones, following The Sands of Time and Warrior Within.
  • Ubisoft News, “Prince of Persia: The Lost Crown Release Date Revealed” (web, secondary): release on 18 January 2024, Ubisoft Montpellier. https://news.ubisoft.com/en-us/article/6JaimYMaCUOBlHy98z1unG/prince-of-persia-the-lost-crown-release-date-revealed
  • Jordan Mechner, Prince of Persia Apple II source code, files COLL.S (the mirror) and AUTO.S (the shadow on levels 4 and 12, and the reunion), GitHub (source code). https://github.com/jmechner/Prince-of-Persia-Apple-II
  • Jordan Mechner, “Prince of Persia Apple II” repository README, first published April 2012 and updated September 2024 (web, secondary): 1985–89, the recovery with Jason Scott and Tony Diaz, the 1989 technical document, Replay, and the licence statement.
  • Jordan Mechner, “Journals” page, jordanmechner.com (web, secondary): The Making of Prince of Persia, journals 1985–1993, and its editions. https://jordanmechner.com/en/books/journals
  • Eric Caoili, “Prince of Persia’s once-lost source code released”, Gamasutra, 17 April 2012, and Kelly Hodgkins, “Original source code for Prince of Persia posted to GitHub”, Engadget, 17 April 2012 (web, secondary): the disks found by Mechner’s father, the three 3.5-inch floppy disks, and their loss for more than a decade. https://www.gamedeveloper.com/business/-em-prince-of-persia-em-s-once-lost-source-code-released and https://www.engadget.com/2012-04-17-original-source-code-for-prince-of-persia-posted-to-github.html

See also

Checked. Verified against primary sources and signed off by a person.