February 7, 2008

EP 3.4: An alternative: Prince of Persia: The Sands of Time

by Noah Wardrip-Fruin · , 6:25 am

At the 2004 Game Developers Choice Awards, Knights of the Old Republic had some competition. Another nominee for Game of the Year, a game which won the awards for Excellence in Game Design and Excellence in Programming, was Prince of Persia: The Sands of Time (PoP).

PoP is a strong example of game fiction in its own right — which is no surprise, given that its main writer and designer was Jordan Mechner, a legend in the game design field for his pioneering games Karateka (1984), the original Prince of Persia (1989), and The Last Express (1997). Mechner is credited with bringing cinematic storytelling to computer games, pushing forward techniques from realistic modeling of human motion to the integration of an overall story into an action game structure. Mechner is also an accomplished independent filmmaker — writing, directing, and editing films such as Chàvez Ravine: A Los Angeles Story (2005), a documentary about a 1950s community evicted from land they were told would become a public housing project (where they would return to live) only to see Dodger Stadium constructed instead, through a process of greed, hypocrisy, and anticommunist hysteria.

Bearing this in mind, it should be no surprise that PoP is one of the strongest examples of an entirely different approach to game fiction from that of KotOR. Rather than attempt to make the game’s story a playable one (a story that changes shape depending on how play proceeds) PoP has a linear, semi-cinematic story, with a sense of inevitability artfully fused with a context for player struggle. The struggle, specifically, consists of innovative platforming action and acrobatic combat. For games such as PoP, the question is how to make this kind of combination, between audience-controlled gameplay and linear story, most productive.

The typical structure for such combinations, in the computer game industry, is simple alternation. The audience is given moments and spaces of play which, when completed, yield scripted sequences that tell the story.10 Because this model involves so little connection between story and gameplay, game writers are often employed only at the very end of game production. The game’s play mechanics, spaces, and even characters are designed before the writer arrives (Bateman, Boon, Buckley, Dansky, Despain, van Lierop, and Swallow, 2003). The writer’s task is to create a set of scripted sequences that will tie them together and provide an overall context. The results are often unsatisfying and can feel, for good reason, quite arbitrary. Mechner’s games — like those of other designer/writers such as Tim Schafer (creator of Grim Fandango (1998), Psychonauts (2005), and other well-regarded titles) — instead work to conceive the story and gameplay as integrated entities.

The story of Prince of Persia: The Sands of Time begins with a war of aggression fought for reasons of greed. The war’s booty includes a massive hourglass containing the Sands of Time. However, the possession of these sands turns out to be more curse than blessing.11 When the briefly-victorious Persian king seeks to enrich his friend with a present of the Sands, the result, instead, is to destroy the friend’s palace and turn nearly everyone into sand demons. The Prince’s dagger, looted from the same palace as the hourglass, is the key used to unleash the sands. Both of the game’s main NPCs — a woman, Farah, taken prisoner in the looted palace, and the Vizier who betrayed the palace’s owner and incited the unleashing of the sands — suggest that the dagger can also be used to improve things. But the Vizier has removed the hourglass to the highest tower of the ruined palace.

Mechner describes this as the result of simplifying the game’s story as much as possible. In terms of traditional story, it is certainly efficient, with only three characters: a hero, a sidekick/love interest, and a villain. It is also efficient in terms of gameplay. For platforming it provides a challenge (moving through a ruined palace) and a motivation (reaching the hourglass). For interacting with most NPCs it provides a motivation for combat and an explanation of why other modes of interaction are not available (they’re sand demons). In other words, it focuses attention on what games do well (movement in space, combat) and provides an explanation for avoiding what they don’t do well (interactions with characters) as well as a reason for moving forward. This is already better than most games, but PoP goes further in a number of ways.

Centrally, it creates connections between gameplay and story. The most obvious of these is the dagger. It is both a key item in the story and the focus of what is innovative about the gameplay. The dagger can store the Sands of Time, making it possible for the hero to use powers that make movement and combat easier (e.g., turning back time when mistakes are made). The dagger only holds a limited amount of sand, which is replenished by withdrawing it from vanquished sand demons (a requirement lest they rise again). Story and gameplay also connect through plot twists. PoP’s story employs twists — including one in which the dagger is lost — that also alter the experience of gameplay. Finally, as Mechner points out in his essay “The Sands of Time: Crafting a Video Game Story” (2007), PoP also works to give as many as possible of the key story moments to the player, in gameplay — as when the Prince must face his own father, now a sand demon.

PoP also makes choices at the level of process that are significantly different from games like KotOR. Obviously, given that there is only one, linear story strand, there is no complicated system of quest flags. There are also no dialogue trees. Instead, PoP uses what is sometimes called an “event based” dialogue system. In essence, conversation is removed from the playable elements of the game. Instead of players choosing to talk with particular NPCs, certain events trigger conversation and voice over. In most cases these are not presented as interruptions to gameplay — as happens in many games — but rather layered over it. The Prince may think to himself as the player causes him to run down a hallway or swing from a pole. Farah may make comments about the Prince’s progress (or failures) in moving through a particularly difficult area, as determined by the player’s actions. Or, in one case, the player may directly elicit a response from Farah — by moving the Prince into a first-person camera mode and “staring” at her.

PoP also shares one primary tool for NPC interaction with games like KotOR, as well as nearly every type of game that includes NPCs: the finite-state machine (FSM). While, on an abstract level, all computers could be described at FSMs, in computer game NPC logic FSMs tend to be used a particular way. Each of an NPC’s basic behaviors is defined as a “state” (e.g., patrol, attack, retreat) with particular rules for transitioning from the current state to other states. For example, an NPC could be designed to move through a patrol animation (a patrol state) until an enemy is noticed (transition to an attack state) and continue attacking until the enemy is defeated (transition to patrol state) or the NPC’s health is below a defined threshold (transition to a retreat state). There might be no rule allowing for direct transition from patrol to retreat — which would make sense generally, but not if the NPC is already badly wounded from previous combat. As with quest flags and dialogue trees, FSMs are simple to explain, easy to implement in software, low in their use of computational resources, and an authoring nightmare over a certain level of complexity. Luckily, they’re a perfect fit for the exceedingly simple behavior of sand demons who attack on sight and never retreat, as found in PoP.

The end result, for Prince of Persia: The Sands of Time, is an experience elegantly designed to compensate for the crippling limitations of the processes used to represent story and character in today’s computer games. Which opens the next question.

Notes

10These scripted sequences can be pre-rendered “cut scenes” (essentially, computer animation files played by the game system), in-engine cut scenes (scripted scenes rendered by the game engine, rather than another animation system, but still removed from player control), or scripted sequences that take place in the engine and during which the player can still control aspects of the game.

11The parallels with U.S. foreign policy at the time of the game’s production, before and during the 2003 invasion of Iraq, now seem prophetic. They are also unlikely to be accidental, given Mechner’s description of an “anti-war theme” that “underlies the whole tale” (2007, 115). Of course, the sands seized by the second Bush administration yeilded a less literal curse.