Sometimes they just turn out to be trashy summer popcorn flicks that fail to capture even a bit of the magic that made their inspirations so memorable. Often they are unbelievable piles of cinematic garbage.

Walt Disney Pictures believes it’s about to buck the trend. On May 28, the studio will release Prince of Persia: The Sands of Time, based on the 2003 installment of the videogame series created by Jordan Mechner. At WonderCon in San Francisco last weekend, the studio cranked up the hype machine to full blast, bringing out Mechner, producer Jerry Bruckheimer (Pirates of the Caribbean), director Mike Newell and leading man Jake Gyllenhaal to plug the film.

Is all this Hollywood talent the key to breaking the curse of the videogame movie?

A Prince With Humble Origins

Long before Jake Gyllenhaal took on the role, the first Prince of Persia was Jordan Mechner’s brother David.

“I was right out of college, spending a summer at home,” Mechner says. “I had an Apple II, so I took my brother out into the parking lot of our old high school and made him run, jump and climb, and that video was the basis for the game.”

The date was Oct. 20, 1985. We know this because the 21-year-old Mechner kept an astonishingly comprehensive journal, which he has since posted online. While he was still an undergraduate at Yale, Mechner was already earning royalties off a best-selling action game that he had created, called Karateka. He wanted his next game to have the same essential story elements — a youthful hero, a princess in danger, an evil lord — but on a grander scale, like a “Disney movie,” as he wrote at the time.

Nearly four years later, the original Prince of Persia game was released for the Apple II. Mechner’s rotoscoped animation, based on his brother’s acrobatics, was smoother and more lifelike than anything gamers had experienced before. The 1989 game became a smash hit, ported to nearly every operating system and game console at the time. And Mechner began pitching the idea of a Prince of Persia feature film.

Bruckheimer’s production company hired Mechner to write the screenplay, keeping the series’ creator intimately involved with the making of the film. (Three other scribes share writing credits on the final version of the script.)

Mechner “came up with a good story and worked really hard on it,” says Bruckheimer.

Years later, Mechner arrived in Ouarzazate, in the deserts of Morocco, where the movie was being filmed. “I saw hundreds of extras and camels and horses out on a ridge, and realized that all these thousands of people had come to the desert in August because of this little Apple II game that I made 20 years ago,” he says.

Jake Gyllenhaal played the Prince of Persia: The Sands of Time game during lunch breaks while shooting the film, coming up with new ideas for his performance.Photo: Jim Merithew/Wired.com

Prince of Parkour

The videogame movie curse isn’t lost on the star of Prince of Persia.

“The risk of trying to do a videogame movie well is intriguing,” says Jake Gyllenhaal.

In his San Francisco hotel suite overlooking the Moscone Center where WonderCon takes place, the Brokeback Mountain star perches on a window ledge and ruminates about his time in the desert.

“There are movies and genres of movies that are made over and over again that are guaranteed to be somewhat successful, that people are going to see them. Whereas with videogames, there’s a lot of resistance because people are so intimately involved. There have been so many failures that I think people are putting them off to the side and saying, that’s not possible,” he says.

To prepare for his role as the prince, Gyllenhaal built muscle mass and learned parkour, the French sport of running, jumping and negotiating obstacles that’s about as close to being in a videogame as you can get in the real world. But he also spent a good deal of time playing Sands of Time, focusing on the main character.

“What I liked about him is that he had this attitude in the game,” Gyllenhall says. “Not that he was a complainer, but he never really liked to fall. It was always a pain in the ass for him. If he got cut, he’d be like, ‘Argh, God!’ The fact that he put that spin on it: ‘Really? You just cut my fuckin’ arm off?’ I like that attitude. Eye-rolling when something doesn’t go your way, but not in an obnoxious way.”

In the film, as in the game, the prince comes across the Dagger of Time, which allows him to control the flow of time. He has to work together with Princess Tamina (played by Gemma Arterton) to gain control of the all-powerful Sands of Time.

“In the games, you have the prince fighting with the woman, and you have this natural sense of romance,” he says. “Both are always abrasive with each other, which is in the movie. That tit-for-tat, she’s-a-bad-ass-and-he-can’t-deal-with-it, that sexual tension is the same.”

But mostly, Gyllenhaal was playing the game to get inspiration for the many stunts he performs: The Sands of Time movie is filled with gamelike moments like wall climbing and high-flying jumps.

“When I was in the middle of shooting at lunchtime, I’d play that game, figure out the moves that he could do and try to incorporate them into the stunts that we were doing,” he says. “I would bring the stunt guys into the trailer and be like, ‘Can we do this? Can we pull this off?’ And they’d be like, ‘Yeah, we could try it.’ And then like a week-and-a-half later, I’d be up on a harness, and be like, ‘What the fuck is this?’ And they’d be like, ‘You asked, man!'”

Gyllenhaal performed many of the stunts himself, which he says caused no end of distress to the people around him.

“Whenever there wasn’t a wire, they were very worried,” he says. “Not that I wouldn’t make it, but the landing is scary.” The “father of parkour,” David Belle, was on hand to work with Gyllenhaal.

Although Bruckheimer says that Gyllenhaal’s eagerness to perform daring feats made the editing process much easier, he was careful to not let him go too far. “I didn’t want him to get hurt,” Bruckheimer says. “You have an actor who is very physical and does a terrific job, but he’s still got to come back to work the next day. A stuntman, unfortunately, if he gets hurt, you can put another one in there. But you can’t replace Jake.”

Prince of Persia director Mike Newell knows all about pleasing fans of a franchise. He's the director of Harry Potter and the Goblet of Fire.Photo: Jim Merithew/Wired.com

Character Drama

“The little guy in the game is not really a character,” says director Mike Newell. “He’s got to be made a character for the feature.”

The director of Prince of Persia is not a gamer, as illustrated by the fact that he is a member of the dwindling group of people who still refer to videogame protagonists as “the little man on the screen.” But the 68-year-old director of Harry Potter and the Goblet of Fire knows something about living up to the expectations of millions of hard-core fans, without sacrificing the integrity of the final product.

“What I did with the Harry Potter is I chucked out about two-fifths of it. I didn’t do whole swaths of it,” he says. Warner Bros. was mulling the idea of splitting the mammoth book up into two movies, but Newell says he knew that the story was only enough for a single, shortened, film.

“I felt easier in some senses with [Persia] than I did with Harry,” Newell says. “The character in the game was much, much less fleshed out. In Potter, it was a straight translation from novel to screen. With Prince of Persia you had to make it absolutely new because you weren’t going to put that little kind of action-man character on the screen. It would be disastrous if you did. There wouldn’t be enough to support the audience’s interest,” he says.

“You’ve got to do enough action, enough running on walls and falling in the knives and that kind of stuff, but that’s not why you’re making the movie. You’re making the movie because there’s a terrific story, and because the characters are compelling,” he says, rapping the table in front of him for emphasis on that last point: If the characters are weak, nobody will care about all the fancy parkour.

While the film is filled with moments that deliberately recall the high-flying, heart-stopping action that is central to the videogames, it’s Newell’s job to make sure that they come across as real, not campy.

“As soon as there are moments where somebody does something, and turns, as it were, and winks at the camera — gone. You’ve broken all suspension of disbelief,” he says. “There were moments like that, and we vigorously attacked them during shooting. If it creeps in, then you’ve got to cut it out in the edit. You must not have that sort of smartass nudge-wink at the camera.”

If the Prince of Persia movie does turn out well, a great deal of it will be thanks to Jordan Mechner’s passion for games and movies — including classic swashbuckling, Arabian Nights films.

“The Prince of Persia has always been a swashbuckling hero in a tradition that goes back to Indiana Jones, Errol Flynn,” Mechner says. “He’s not just a warrior, he’s an underdog. He fights with a sword but lives by his wits. He’s got a vulnerable quality, and I think Jake really captures that.”

I have just one last question for Mechner: If Sands of Time takes off like a certain series of movies based on a theme-park ride, could a Karateka film be far behind?