The Sands of Time: Crafting a Video Game Story

The Sands of Time: Crafting a Video Game Story

2008-02-22

Jordan Mechner explains how the team developing of Prince of Persia: The Sands of Time incorporated a number of cinematic techniques such as flashback and voice over (which do not usually figure into video games) while also working within the practical restrictions of a commercial production schedule.

Ben Underwood:

The phrase “sadder but wiser” alludes to Samuel Taylor Coleridge’s narrator of “The Rime of the Anicient Mariner.” In the poem, the cursed, albatross-killing sailor tells his story to a wedding guest, and the final stanza of the poem describes the effect of the story on the listener: “He went like one that hath been stunned, / And is of sense forlorn: / A sadder and a wiser man, / He rose the morrow morn.”

2008-02-15

In 2001, a small team within Ubisoft’s Montreal studio led by producer Yannis Mallat began concept development on the project that would become Prince of Persia: The Sands of Time. Initially a consultant, I later joined the team as writer and game designer. Being part of this project was a great experience and I’m glad to revisit it for this book.

By its nature, video game writing is inextricably bound up with game design, level design, and the other aspects of production. A film screenplay is a clean, written blueprint that serves as a starting point and reference for the director, actors, and the rest of the creative team. It’s also a document that film scholars and critics can later read and discuss as a work distinct from the film itself. Video games have no such blueprint. The game design script created at the start of a production is often quickly rendered obsolete, its functions assumed by new tools created to fit the project’s specific needs.

In this chapter I’ll try to shed some light on the creative and technical decision-making processes that went into crafting the story and narrative elements of Prince of Persia: The Sands of Time (POP for short). The team’s approach was practical, not literary; our challenge was to find the right story for a mass-market action video game. In the rapidly changing game industry, each project is unique and presents its own demands and opportunities, according to current technology and the nature of the particular game. What works for one game might not work for another.

Storytelling is, of course, just one aspect of game design. For those interested in reading more about the overall production process on POP, I recommend Yannis Mallat’s postmortem article (Mallat 2004).

Rule #1: Do It, Don’t View It.

What kind of story does a video game need?

The traditional way to tell a story in a video game is to create a series of cinematic cutscenes that serve as “rewards” - transitions between gameplay levels. However, the cool way to tell a story in a video game is to eliminate or reduce the canned cutscenes as much as possible, and instead construct the game so that the most powerful and exciting moments of the story will occur within the gameplay itself.

The screenwriting maxim “actions speak louder than words” applies to video games as well as films, but in a different way. Video games, unlike movies, are interactive. Whereas in a film it’s better to show than to tell, in a video game it’s better to do than to watch. Give the story’s best moments to the player, and he’ll never forget them. Put them in a cutscene, and he’ll yawn.

Philosophically, the POP team was pretty much united in our lack of enthusiasm for cutscenes. If we could have eliminated them altogether, we would have done so with pleasure. On the other hand, our mandate was to make a successful mainstream action-adventure game on a relatively tight budget and schedule. The game concept already called for pushing the envelope in a number of ways; an overambitious approach to storytelling could have sunk the ship.

Given that cutscenes were a realistic and efficient option, at least we could make them more palatable by observing a few do’s and don’ts:

Good Cutscenes:

• Are brief (30-60 seconds), well-written, and tightly edited.

• Are visually consistent with the gameplay (ideally, using the same character models, environments, and graphic engine as the game itself).

• Contain the same kind of action as the gameplay.

• Flow naturally out of the preceding gameplay action and into the following action.

• Tell a strong, simple story.

Bad Cutscenes:

• Are several times longer than they need to be.

• Are so visually splendid that they seem to belong to a different world from the rest of the game.

• Are dialogue-heavy and exposition-heavy. Characters who are taciturn throughout the game suddenly open up and become blabbermouths.

• Inadvertently call attention to the game design’s limitations (e.g., if the hero can survive that jump, why couldn’t he hop over a three-foot-high wall three levels back?).

• Tell a story that has nothing to do with the game.

Close observers of POP may notice that we ended up breaking at least one of these guidelines: Several key cinematic cutscenes, including the opening and ending sequences, were pre-rendered in full motion video instead of using the real-time gameplay engine. The production, marketing, and other considerations that went into this decision are beyond the scope of this article. I mention it as a reminder that whatever theoretical game-design ideals we start out with are always subject to the actual, real-life production process. The design needs to be robust enough to withstand compromises and still make a good game.

Rule #2: Story Is Not King.

As the previous list of dos and don’ts suggests, many games hurt themselves by using (abusing?) cinematic cutscenes to try to tell a story that doesn’t match the game. If the core component of the gameplay is “shoot every spaceship you see,” is the game truly enhanced by weaving an epic tale of galactic political strife, interpersonal rivalry, and romantic subplots?

In film, story is king. Stunning cinematography and amazing action set pieces may help sell the movie - but if they’re not working in the service of the story, the film will fall flat with viewers. Not so in video games. The gameplay isn’t there to serve the story; it’s the other way around. The purpose of the story is to support and enhance the gameplay.

POP’s core gameplay is very simple. There is only one playable character (the Prince). The gameplay is a combination of acrobatic exploration (getting from point A to point B) and combat (killing everyone you meet), plus one cool, original feature: You can turn back time to undo your mistakes. The challenge for the writer is to invent a story that will fit this gameplay, making the most of its strengths without highlighting its limitations.

At first, the team started with a great title and core concept - the “Sands of Time.” Unfortunately, the first pass at a game script succumbed to many of the “don’ts” listed above. It had a proliferation of characters representing various political factions, a hero whose goal was not always clear, and long, exposition-burdened dialogue scenes. The complex story setup failed to provide compelling answers to two key questions:

1. What is Point B and why do I need to get there?

2. Why do I need to kill everyone I meet?

Making the decision to scrap the existing storyline and start fresh from the “Sands of Time” concept gave the team the freedom to create a new story that would yield more bang for the buck. We took our new direction from the core features of the gameplay itself:

Unity of time and place: The action unfolds over the course of a single day and night, all within the grounds and gardens of the Palace of Azad.

Acrobatics: Much of the fun of the game lies in the Prince’s extraordinary agility. For him to walk down hallways and open doors like a normal person wouldn’t take advantage of what makes him special. So let’s set the game in a destroyed palace - one that’s been hit by a terrible cataclysm that has collapsed staircases and buried passageways under rubble, forcing the player to improvise new ways to get from point A to point B.

Combat: The game interface is designed for fight/flight - not for engaging other characters in conversation. So let’s populate our palace with monsters, not people. Monsters so implacably determined to kill the Prince that the only meaningful ways he can interact with them are to kill them or run away.

Rewind: We want to make the player work for this cool ability to turn back time. The Sands of Time must function first of all as a reward, a substance that the player can collect, hoard, and spend.

Rule #3: Maximize Efficiency.

Programming and screenwriting have at least one thing in common: Efficiency is a cardinal virtue. Whenever you can achieve the desired effect with the fewest moving parts, it yields all manner of benefits down the line. So, the Sands of Time became not only the valuable substance that the Prince spends his time collecting, but also the cause of the cataclysm that destroys the palace and creates the monsters. The Prince commits the terrible mistake of opening Pandora’s Box, unleashing the plague of the Sands of Time on an unsuspecting world. His mission: Collect the Sands, put them back into Pandora’s Box, and set the world right again.

The Dagger of Time is at once a weapon, a receptacle, and a MacGuffin: The Prince can fight the sand monsters with his sword, but like the undead zombies they are, they keep getting back up again and again - until he uses his magic dagger to suck the sand that runs in their veins in place of blood. In so doing, he both dispatches the monsters for good, and conveniently fills his dagger with sand. Which he can then use to rewind time.

I can’t overstate the importance of simplifying the story as much as possible, especially in the beginning. Video game writers and designers are often tempted to start embroidering and elaborating on their ideas too early in the process. The reason this is a trap is that production resources are finite. Every character, object, and environment that can be eliminated at an early stage will increase the resources and opportunities available to enrich the characters, objects, and environments that remain.

Rule #4: Know Who’s on the Box.

Once the bones of the POP story felt solid, the next step was to flesh it out with a setup and a cast of characters. Notice the order of priorities: first gameplay, then story, then characters.

There is, however, one exception: The hero. The guy on the box. The Prince of Persia. Not every game needs a memorable main character, or even a main character at all (think Civilization) - but ours did. The gameplay and the character of the Prince were inseparable. Together, they constituted our “hook.” A weak hook - one that players don’t get excited about - can doom an otherwise excellent, well-reviewed, heavily marketed game to the bargain bin.

You might not think the character of the Prince needed much work. He was, after all, our franchise character, our brand name, the reason the project existed. We couldn’t afford to take that attitude. Most of the design team were old enough to have played the original 1989 side-scrolling computer game, but a sizable portion of our target audience would be encountering the Prince for the first time. We needed to reinvent the Prince of Persia as if he had never existed before.

If the purpose of the story is to reveal the gameplay in its best light, then the purpose of the cast of characters is to reveal the hero in his best light. In building a cast of characters for POP, the question for the writer was: Who do we need?

The original draft of the story had nine characters, including two love interests, two villains, and two helper/mentor characters. We scrapped them all and started fresh with the simplest possible (remember Rule #3) configuration of characters: A hero, a villain, and a girl. The needs of the story helped us flesh out the three characters’ roles:

The hero: The young Prince who accidentally unleashes Armageddon through the sort of innocent mistake that could happen to anyone.

The villain: The Vizier who manipulates the hero into opening Pandora’s Box (the giant hourglass that contains the Sands of Time) for his own nefarious ends. Having done this, he whisks the hourglass off to the top of the palace’s most inaccessible tower, thus providing the player with a physical destination and goal to justify all the getting from Point A to Point B.

The girl: Farah is at once a love interest, an action sidekick, and the character who stands for what is good and right. As the only human survivor besides the villain, she becomes the Prince’s companion in adversity. Of course their relationship is fraught with mistrust, because she and the hero are both after the same thing (the dagger).

Present in the story - but not in the gameplay - are two additional characters: the hero’s father (the King of Persia), and his friend, the Sultan, in whose palace the action takes place. Benign authority figures, both are transformed into sand monsters in the opening cutscene, adding to the hero’s grief and guilt without complicating the game design.

As to why our three main characters survive the cataclysm while everyone else is turned into sand zombies, we decided that each of them (for different reasons) possesses a special artifact that offers protection from the Sands of Time: the Prince, his dagger; the Vizier, his staff; and Farah, her medallion.

Rule #5: Build a Playground for Your Hero.

In the original story, the action took place in the Prince’s home palace, and the Dagger of Time was an old family treasure. For the new story, it seemed more useful to make the palace of Azad neutral ground, a place that both the Prince and Farah would be encountering for the first time. So we created a prologue in which the dagger and the Sands of Time are “liberated” by the Prince’s victorious army from a conquered Indian palace.

The player’s first goal in the game is to steal the dagger from the well-protected treasure vault - a setup modeled on the classic tomb-raiding opening sequence of Raiders of the Lost Ark. That movie was a primary inspiration for the original Prince of Persia game fifteen years earlier, so it seemed forgivable to draw on it yet again for the Prince’s rebirth.

The prologue serves several important functions. It sets up the world of the game, the three main characters, and what they want. It showcases the Prince’s character and abilities (a daredevil who races ahead of the attacking army in order to gain “honor and glory” by being the first to steal a valuable trophy of war). It establishes the two main artifacts, the hourglass and the dagger, and explains how they come into the hero’s possession. It offers the player a manageable environment in which to practice the Prince’s acrobatic and swordfighting abilities. Finally, it lays the groundwork for the anti-war theme that, though never stated outright, underlies the whole tale.

Rule #6: Break as Many Rules as You Can Get Away With.

It should be noted that the hero’s goals and actions in the prologue are, by most standards, wrong. The Prince’s army attacks the Indian palace for no good reason other than greed and conquest. This point raised some concern during development: Might players not resist identification with such a hero? For whatever reason, I always liked this aspect of the story and felt confident it would not bother players in the least.

Remember the scene in Psycho where Anthony Perkins has to clean up the evidence of the horrific murder we’ve just seen “Mother” commit? The victim is Janet Leigh, the heroine of the movie. We liked her. Yet no sooner is she dead than we shift our allegiance and start rooting for Perkins to succeed in covering up the evidence of the crime. Watching someone attempt to accomplish something difficult and dangerous usually causes us to empathize with them - even if we disagree morally with what they’re doing. I felt sure this principle would apply to video games as well as movies. Because we control the Prince’s actions and thus his fate, we’re even more inclined to identify with him, and less inclined to judge him, than if it were a movie.

Later in POP, the player is asked to follow the elaborate verbal instructions of an exhausted, freaked-out guard to activate the palace’s defense system. It’s a long and challenging puzzle, and when he finally succeeds, what happens? A ghastly array of blades, slicers, and other traps spring out from the walls - causing the player to realize that (a) the guard was probably insane, come to think of it, and (b) now he has to spend the rest of the game evading these very traps. If you want to talk about mistakes committed by the hero, this one takes the prize. Unlike the big “Pandora’s Box” mistake, which occurs in a cutscene (thus, one could argue, relieving the player of responsibility for the Prince’s actions), this one occurs in the game. The game actually requires the player to accomplish a goal that will make things harder for him going forward. Logically, it should make him want to rip the CD out of the drive. But as a game/story twist, does it work? It seems to.

The great thing about video game writing is that as an industry, we’re still in the process of figuring out what works and what doesn’t. In studio film screenwriting, experimenting with the time-tested rules of dramatic construction is a lot harder to justify and get away with. Every video game project offers the writer opportunities to break new ground, even if only in small ways; it would be a shame if we didn’t try.

Rule #7: Combine Previously Uncombined Genres.

One of the classiest aspects of the 1940 Thief of Baghdad (another source of inspiration for the original Prince of Persia) is that it starts out with the hero telling his story to a mysterious woman in flashback. As he finishes his tale, we realize that the villain has been listening behind a curtain the whole time. Nesting stories within stories in this fashion is a signature device of the 1001 Nights - the collection of medieval Islamic folk tales that is the ur-source material for Thief of Baghdad and Prince of Persia.

To our knowledge, voice-over narration as a framing device had yet to be tried in a video game. We decided to push the device to its limit by making the entire game a flashback, narrated by the hero in the past tense.

It was by no means clear that this would work. Voice-over narration has ruined more movies than it’s helped. Dozens of good films, from Blade Runner to Age of Innocence, have (for me) been seriously marred by clunky or unnecessary voice-overs.

One could also argue that the idea itself is a contradiction in terms. The essence of a video game is that the action happens in the present tense, reacting to the player’s improvisations from one moment to the next. Wouldn’t a past-tense narration cheat the player of the feeling that he is shaping his own destiny?

Again, my memories as a filmgoer gave me confidence that it could work. Two of my favorite Hollywood noir films, Double Indemnity and Sunset Boulevard (both directed by Billy Wilder), are narrated by a hero who is fatally wounded or dead. Knowing the story will end badly doesn’t seem to harm the sense of empathy or suspense we feel along the way. I felt that by using film noir as a model for an action-adventure video game set in ninth-century Persia, we would be getting away with something.

So, we open the game with the Prince telling his story, in flashback, to a person we don’t see. Only at the end of the game is it revealed who this person is. The narration had to be crafted to work on two levels: It must make sense both the first time through the game, and then in retrospect, when the player knows who the Prince is actually telling his story to and why.

Finding the right tone for the narration was essential. The Prince telling his story in retrospect is a more mature and reflective character than the gung-ho Prince the player sees at the beginning of the game. His experience has made him sadder but wiser. We sought ways to express the Prince’s evolution gradually throughout the game as well, in his physical appearance and movements. At the moment, near the end of the game, when the on-screen action catches up with the narration, the player should finally understand the full impact of the tragedy the Prince has suffered.

The voice-over narrations during the game play (as opposed to during cinematics) were among the most rewarding to implement. Some of them were purposefully added as guidance to clue the player in to what his next goal should be:

And there it lay, just out of reach: The Dagger of Time. There was a treasure I could carry with pride as a trophy of our victory. If I could only get there.

(Hint: Notice, gentle player, that dagger on the far side of the room.)

Try as I might, I could not break that crumbling stone wall. Perhaps a warrior with the strength of Rustam might have smashed through it; but I had not strength enough in my arm….Nor in my sword. It was as if a magic charm protected it.

(Hint: There’s a more powerful magic sword to be found somewhere around here. And when you find it, come back and try it on that section of the wall.)

Other voice-overs were added purely for atmosphere, to deepen the player’s experience and add emotional layers to what would otherwise have been straight-ahead action:

The fabled menagerie of Azad… . The Sultan’s pride and joy. It had been one of the wonders of the world. As a child I had dreamed of it, and longed to see it with my own eyes. Now it was a place of terror, an abandoned ruin, laid waste by the Sands of Time.

You think me mad. I can see it by the look in your eyes; you think my story is impossible. Perhaps I am mad. Who would not be driven mad by horrors such as I have lived? But I assure you, every word is true.

The tone of the narration obviously owes less to Billy Wilder than to Edgar Allan Poe (or maybe Vincent Price). For by this point it had become clear to us that, although POP was officially a “swashbuckling acrobatic action-adventure,” we were, in fact, making a game in the “survival horror” genre.

This might sound like cause for concern, but it’s a good thing. (Just be careful who you tell. Definitely don’t mention it to the marketing department.) Many great successes - movies, video games, novels, whatever - result from the covert fusion of two hitherto separate genres. Alien looks like sci-fi but is really a horror movie. The Sixth Sense looks like a horror film but is actually a family tearjerker. And so on. On POP, we figured that if we did our job right, nobody would notice that it was a survival-horror game - not the game-playing public, and not the marketing department.

Anyway, the narration worked great. So satisfied were we with its effect that we went back and recorded additional dialogue for new situations, extending it even into the menu interface. For example, when the player presses pause, the Prince says in voice-over:

Shall I go on with my story?

When the player presses resume:

Now, where was I?

And when the Prince, as video game heroes are apt to do, is killed during gameplay, he hastily corrects himself:

Wait, what did I just say? That didn’t happen. Let me back up a bit.

And the “story” resumes from the last save point.

Rule #8: A Memorable Character Is One You Can Play With.

By far the greatest storytelling challenge in POP was the relationship between the Prince and the female NPC-sidekick/romantic interest, Farah. (Game designers are fond of acronyms. This one refers to neither the National Press Club nor the National Petroleum Council, but to a “non-playable character” - one that engages with the player’s character during the in-game action, but whom the player does not control.)

This relationship lies at the heart of the story. The cinematic cutscenes might be as well written, acted, and animated as we could make them, but they would never be enough to sell the relationship between Farah and the Prince - unless it was present in the gameplay as well. Any emotional resonance our story managed to achieve would be, in large part, a function of how believable, likable, and well-developed a character Farah was.

We had to walk a fine line. On the one hand, we were aiming for a romantic-comedy-adventure structure like Romancing the Stone or It Happened One Night, where the hero and heroine get off on the wrong foot and proceed to argue and bicker their way through the movie, each too proud to be the first to suggest that they are falling in love. On the other hand, we were doing a video game, not a movie. A video game sidekick’s primary role is to help the player win - by providing clues, opening doors he can’t, fighting at his side. Farah needed to be a real help to the Prince; otherwise she’d be just a pain in the neck.

One of the places where it was important to strike the right balance is the cooperative combat system. When a gang of sand monsters attacks, Farah draws her bow and starts shooting. Usually, it’s an advantage to have Farah on your side. If it should happen that you’re down to your last hit point, at the mercy of a sand monster’s raised axe, and Farah saves your life with a well-placed arrow - at that moment, you positively love her. (This is known as a “solid foundation for a relationship.”) However, Farah’s not perfect, and it can also happen that the Prince accidentally steps into her line of fire and catches an arrow in the buttocks. At which point he yells “Ow!” and Farah replies “Sorry!” (or variation thereof). We could, of course, have just as easily programmed Farah to be a perfect archery machine who never misses and never makes a mistake. But that wouldn’t have been as much fun.

If you like the way Farah turned out in the game, that’s great. Just know that she is about 20% of what was originally envisioned. Ultimately, having a well-developed secondary non-playable character took a back seat to having a playable game that we could ship for Christmas. Otherwise we’d still be working on her.

Rule #9: Dialogue Is Not Precious.

Early on, we made the somewhat unorthodox decision that we would never interrupt the game to play in-game dialogue. The gameplay is paramount, and if the player doesn’t want to listen to the dialogue, it shouldn’t be forced on him. So, for example, if Farah starts talking to the Prince, there’s nothing to stop him from running away and missing the rest of whatever she was saying.

We also decided that the dialogue should be treated as just another element of the soundtrack, so that if the Prince and Farah were far apart, their dialogue would be heard at a very faint level. This meant that in the recording session, the actors had to really yell for their dialogue to be audible when played back in the context of the game. A person shouting at the top of her lungs sounds totally different from a person speaking normally, even if the dialogues are equalized to play back at the same dB level.

Here’s a partial sample of the spreadsheet we used to record the character dialogues: Table1

Note that these dialogues are mutually exclusive. Only the final three are a series to be played in sequence (as indicated by asterisks on the left-hand side): Farah speaks, the Prince responds, then Farah again. The rest are alternative, stand-alone dialogues, each triggered by a different gameplay situation.

In all, we recorded nearly a thousand lines of dialogue. Less than half of them ended up in the game. That’s OK. Dialogue is one of the cheapest elements in the game (assuming the actors are paid union scale) because creating it requires only a few people’s time. Programming, by contrast, is one of the most expensive - not because programmers get paid so much, but because a programming delay takes everyone’s time.

All eight of the lines listed here were recorded, implemented, and turned out great. The last three were cut from the game in the final stages for lack of RAM and other considerations. Don’t think we mourned the lost dialogue - we mourned the precious time the programmer had taken to implement them in the first place.

Rule #10: Create the Tools You Need.

Everyone knows what a film screenplay looks like. The film screenwriter thus has the benefit (and the constraint) of filling a well-defined role. Not so the video game writer. Depending on the nature of the game and the organization of the team, the writer’s role can be vastly different in nature and scope from one project to another.

What does a video game screenplay look like? On POP, the screenplay for the cinematic cutscenes looks a lot like a film screenplay:

EXT. RAMPARTS - DAY

As the Prince runs, the stone floor starts to crumble beneath his feet.

He turns, runs back. Too late. Falling, he tries to grab the crumbling ledge. It breaks away.

He plunges into the darkness of a stone shaft. A rain of rocks accompanies him. Falling past a ledge, he tries to grab it; his fingers slide off.

INT. DUNGEON - DAY

WHAM! The Prince hits the stone floor. As he is getting up, a ROCK falls on his back, knocking him flat.

Handy though it is for cutscenes, screenplay format is of limited use in describing in-game situations. The bulk of the writing work on POP involved not the screenplay, but other communication tools - most of which were created or improvised according to the demands of the production sand might not work at all for a different game.

One such tool was the dialogue recording spreadsheet excerpted above. Another was the stack of “NPC Gameplay Design Documents” specifying when and in what circumstances the dialogues are to be played.

Here’s an example from GP35 (Gameplay Unit 35, otherwise known as “The Harem”): Table2

The NPC design documents are written in “pseudo-code” - less precise than actual computer code, less poetic than a screenplay - for the AI programmer, who will use it as a sort of blueprint to write the actual code that will make the characters move and speak in the game.

Looking Back

Overall, I’m delighted with the way POP turned out and the various ways we succeeded in weaving the story into the gameplay. I’m particularly happy with the voice-over narration and story-within-a-story; they offer a special satisfaction and reward for those who play the game all the way through.

Because the storytelling innovations in POP were subtle, they attracted less attention than the game’s more obvious “wow” features. The story quietly underlies the gameplay experience, enhancing without distracting from it, just as we hoped.

The techniques we tried out in Prince of Persia: The Sands of Time remain rich with unexplored potential. They offer intriguing possibilities that cry out to be pushed further. Perhaps in another game.

References: Literature

Mallat, Yannis (2004). “Postmortem: Ubisoft’s Prince of Persia: The Sands of Time.” Game Developer (April 2004).

References: Games

Prince of Persia. Jordan Mechner; Broderbund. 1989.

Prince of Persia: The Sands of Time. Ubisoft. 2003.