Prince of Persia (1989 video game)

Prince of Persia is a 1989 cinematic platform game developed and published by Broderbund for the Apple II. It was designed and implemented by Jordan Mechner. Taking place in medieval Persia, players control an unnamed protagonist who must venture through a series of dungeons to defeat the evil Grand Vizier Jaffar and save an imprisoned princess.

Much like Karateka, Mechner's first video game, Prince of Persia used rotoscoping for its fluid and realistic animation. For this process, Mechner used as reference for the characters' movements videos of his brother doing acrobatic stunts in white clothes and swashbuckler films such as The Adventures of Robin Hood.

The game was critically acclaimed and, while not an immediate commercial success, sold many copies as it was ported to a wide range of platforms after the original Apple II release. It is believed to have been the first cinematic platformer and inspired many games in this subgenre, such as Another World. Its success launched the Prince of Persia franchise, consisting of two sequels, Prince of Persia 2: The Shadow and the Flame (1993) and Prince of Persia 3D (1999), and two reboots: Prince of Persia: The Sands of Time (2003), which was followed by three sequels of its own, and Prince of Persia (2008).

Gameplay
The main objective of the player is to lead the unnamed protagonist out of dungeons and into a fortress tower before time runs out. This cannot be done without bypassing traps and fighting hostile swordsmen. The game consists of twelve levels (though some console versions have more). However, a game session may be saved and resumed at a later time only after level 2.

The player has a health indicator that consists of a series of small red triangles. The player starts with three. Each time the protagonist is damaged (cut by sword, fallen from two floors of heights, or hit by a falling rock), the player loses one of these indicators. There are small jars containing potions of several colours and sizes. The red potions scattered throughout the game restore one health indicator. The blue potions are poisonous, and they take one life indicator as damage. There are also large jars of red potion that increase the maximum number of health indicators by one, and large jars of green potion that grants a temporary ability to hover. If the player's health is reduced to zero, the protagonist dies. Subsequently, the game is restarted from the beginning of the stage in which the protagonist died but the timer will not reset to that point, effectively constituting a time penalty. There is no counter for the number of lives, but if time runs out, the princess will be gone and the game will be over, subject to variations per console versions:
 * The DOS version allows the player already in the very late part of Level 12 to continue after time is out with no extra life, so:
 * 1) Restarting the level by pressing appropriate buttons is not death, thus not failing the game yet.
 * 2) Any player's death, including having killed Jaffar then falling from excessive floors of heights, also fails the game in which case the Princess is also gone.
 * 3) Only defeating Jaffar and exiting Level 12 alive will still save the Princess, with a negative time score in the hall of fame.
 * The Macintosh port will not give the player a game over once they reach the final area of Level 12 (stored in data as Level 13), provided they make it there on time. The player must cross the magic bridge and make a screen-transition to a room with falling tiles to be 'safe'; once there, they will always be allowed to continue, regardless of deaths or time expiration. Running out of time at any point before the screen-transition, including the bridge, will result in game over as usual.
 * The Super NES remake allows the players to save themselves after time is out, to get the game over at the end without the princess saved.

There are three types of traps that the player must bypass: spike traps, deep pits (three or more levels deep) and guillotines. Getting caught or falling into each results in the instant death of the protagonist. In addition, there are gates that can be raised for a short period of time by having the protagonist stand on the activation trigger. The player must pass through the gates while they are still open, avoiding locking triggers. Sometimes, there are various traps between an unlock trigger and a gate.

Hostile swordsmen (Jaffar and his guards) are yet another obstacle. The player obtains a sword in the first stage, which they can use to fight these adversaries. The protagonist's sword maneuvers are as follows: advance, back off, slash, parry, or a combined parry-then-slash attack. Enemy swordsmen also have a health indicator similar to that of the protagonist. Killing them involves slashing them until their health indicator is depleted or by pushing them into traps while fighting.

In stage three a skeletal swordsman comes to life and does battle with the protagonist. The skeleton cannot be killed with the sword, but it can be defeated by being dropped into one of the pits.

A unique trap encountered in stage four, which serves as a plot device, is a magic mirror, whose appearance is followed by an ominous leitmotif. The protagonist is forced to jump through this mirror upon which his doppelganger emerges from the other side, draining the protagonist's health to one. This apparition later hinders the protagonist by stealing a potion and throwing him into a dungeon. The protagonist cannot kill this apparition as they share lives; any damage inflicted upon one also hurts the other. Therefore, the protagonist must merge with his doppelganger.

In stage eight, the protagonist becomes trapped behind a gate before he can reach the exit. In this stage the Princess sends a white mouse to trigger the gate open again, allowing him to proceed to the next level.

In stage twelve protagonist faces his shadow doppelgänger. Once they have merged, the player can run across an invisible bridge to a new area, where they battle Jaffar (once the final checkpoint is reached, the player will no longer get a game over screen even if time runs out, except if the player dies after the timeout). Once Jaffar is defeated, his spell is broken and the Princess can be saved. In addition, the in-game timer is stopped at the moment of Jaffar's death, and the time remaining will appear on the high scores.

Plot
The game is set in medieval Persia. While the sultan is fighting a war in a foreign land, his vizier Jaffar, a wizard, seizes power. His only obstacle to the throne is the Sultan's daughter. Jaffar locks her in a tower and orders her to become his wife, or she would die within 60 minutes (extended to 120 minutes in the Super NES version, which has longer and harder levels). The game's unnamed protagonist, whom the Princess loves, is thrown prisoner into the palace dungeons. In order to free her, he must escape the dungeons, get to the palace tower and defeat Jaffar before time runs out. In addition to guards, various traps and dungeons, the protagonist is further hindered by his own doppelgänger, conjured out of a magic mirror.

Development
Development for the game began in 1985, the year Jordan Mechner graduated from Yale University. At that time, Mechner had already developed one game, Karateka, for distributor Broderbund. Despite expecting a sequel to Karateka, the distributor gave Mechner creative freedom to create an original game. The game drew from sources of inspiration including video games such as The Castles of Dr. Creep and Lode Runner, literature such as the Arabian Nights stories, and films such as Raiders of the Lost Ark and The Adventures of Robin Hood.

Prince of Persia was programmed in 6502 assembly, a low-level programming language. Mechner used an animation technique called rotoscoping, with which he used footage to animate the characters' sprites and movements. To create the protagonist's platforming motions, Mechner traced video footage of his younger brother running and jumping in white clothes. To create the game's sword fighting sprites, Mechner rotoscoped the final duel scene between Errol Flynn and Basil Rathbone in The Adventures of Robin Hood. Though the use of rotoscoping was regarded as a pioneering move, Mechner later recalled that "when we made that decision with Prince of Persia, I wasn't thinking about being cutting edge — we did it essentially because I'm not that good at drawing or animation, and it was the only way I could think of to get lifelike movement." Also unusual was the method of combat: protagonist and enemies fought with swords, not projectile weapons, as was the case in most contemporary games. Mechner has said that when he started programming, the first ten minutes of the film Raiders of the Lost Ark had been one of the main inspirations for the character's acrobatic responses in a dangerous environment.

During development, the Prince was meant to be a nonviolent character, so the game did not initially include combat. However, due to finding the gameplay to be dull and after incessant demand from Tomi Pierce, a colleague of his, Mechner added sword fighting to the game and created Shadow Man, the Prince's doppelgänger. Guards were later added when Mechner managed to make use of an additional 12K of the Apple II's memory.

Mechner was offended by the cover art for the Sega Genesis version, which depicts the prince as a Luke Skywalker lookalike about to cut down a helpless black guard, but by the time he made his objections it was already being printed.

For the Japanese computer ports, Arsys Software and Riverhillsoft enhanced the visuals and redesigned the Prince's appearance, introducing the classic turban and vest look. This version became the basis for the Macintosh version and later Prince of Persia ports and games by Broderbund. Riverhillsoft's FM Towns version also added a Red Book CD audio soundtrack.

The Amiga version of the game was developed by Dan Gorlin. Tommy Tallarico worked on the audio for the Game Boy port of the game, and it was the first game he worked on. He originally started as a playtester for Virgin Interactive.

Reception
Prince of Persia received a positive critical reception, but was initially a commercial failure in North America, where it had sold only 7,000 units each on the Apple II and IBM PC by July 1990. It was when the game was released in Japan and Europe that year that it became a commercial success. In July 1990, the NEC PC-9801 version sold 10,000 units as soon as it was released in Japan. It was then ported to various different home computers and video game consoles, eventually selling 2 million units worldwide by the time its sequel Prince of Persia 2: The Shadow and the Flame (1993) was in production.

Charles Ardai of Computer Gaming World wrote that the game package's claim that it "breaks new ground with animation so uncannily human it must be seen to be believed" was true. He wrote that Prince of Persia "succeeds at being more than a running-jumping game (in other words, a gussied-up Nintendo game)" because it "captures the feel of those great old adventure films", citing Thief of Baghdad, Frankenstein, and Dracula. Ardai concluded that it was "a tremendous achievement" in games comparable to that of Star Wars in film.

In 1991, the game was ranked the 12th best Amiga game of all time by Amiga Power. In 1992, The New York Times described the Macintosh version as having "brilliant" graphics and "excellent" sound. Reviewing the Genesis version, GamePro praised the "extremely fluid" animation of the player character and commented that the controls are difficult to master but nonetheless very effective. Comparing it to the Super NES version, they summarized that "the Genesis version has better graphics, and the SNES has better music. Otherwise, the two are identical in almost every way ..." Electronic Gaming Monthly (EGM) likewise assessed the Genesis version as "an excellent conversion of the classic action game", and added that the game's challenging strategy and technique give it high longevity. EGM's panel of four reviewers each gave it a rating of 8 out of 10, adding up to an overall score of 32 out of 40.

In 1991, PC Format named Prince of Persia one of the 50 best computer games ever, highlighting its "unbelievably good animation". In 1996, Computer Gaming World named Prince of Persia the 84th best game ever, with the editors calling it "an acrobatic platformer with amazingly fluid action". In 1995, Flux ranked the game 42nd on their Top 100 Video Games.

Legacy
Prince of Persia influenced cinematic platformers such as Another World and Flashback as well as action-adventure games such as Tomb Raider, which used a similar control scheme. A few DOS games were created using exactly the same game mechanics of the DOS version of Prince of Persia. Makh-Shevet created Cruel World in 1993 and Capstone Software created Zorro in 1995.

Prince of Persia was remade and ported by Gameloft. The remake, titled Prince of Persia Classic, was released on June 13, 2007, to the Xbox Live Arcade, and on October 23, 2008, on the PlayStation Network. It features the same level design and general premise but contained 3D-rendered graphics, more fluid movements, and Sands of Time aesthetics. The gameplay and controls were slightly adjusted to include a wall-jump move and different swordplay. New game modes were also added, such as "Time Attack" and "Survival". The game has also been released on Android.

Reverse engineering efforts by fans of the original game have resulted in detailed documentation of the file formats of the MS-DOS version. Various level editors have been created that can be used to modify the level files of the game. With these editors and other software, over 60 mods have been created.

In April 2012, Jordan Mechner established a GitHub repository containing the long-thought-lost original Apple II source code for Prince of Persia. A technical document describing the operation of this source code is available on Mechner's website.

In April 2020, Mechner did an AMA on Reddit where he stated that he would be releasing his journals from the development of the game as a book and users could ask any questions that they may have about the game to him.