BURBANK, Calif. — It was when he cast Bowser, the fire-breathing turtle from Nintendo's Super Mario Bros. games, that Rich Moore first grasped the magnitude of the job he was undertaking.

“That was the huge one,” he said at Walt Disney Studios' Burbank headquarters this month. “That's the moment where it felt like, ‘Oh, my God, I'm working with Olivier.'”

With “Wreck-It Ralph,” an animated feature that opens Friday, Moore is attempting a feat that has stumped other directors for more than 20 years: making a video game movie that appeals both tothe notoriously persnickety crowd of hard-core gamers and to mainstream family audiences.

“Wreck-It Ralph” follows Ralph (voiced by John C. Reilly), the burly villain of an old-school, 8-bit arcade game called “Fix-It Felix,” as he attempts to break out of his bad-guy role by traveling to other games in the arcade where he lives. In addition to Bowser, who appears at a 12-step meeting for recovering villains called Bad-Anon, Moore populated his film with characters from the likes of “Pac-Man,” “Sonic the Hedgehog” and “Street Fighter” in a bid to draw modern gamers and spark the nostalgia of adults who dropped quarters into arcade machines way back in the 1980s and '90s.

It shouldn't be hard to beat the high score in this genre; movies based on video games have a dismal history among critics and at the box office. The long list of failures dates back to 1993's “Super Mario Bros.” (Bowser's last appearance on the big screen) and includes such not-so-fondly remembered adaptations as “Street Fighter,” “Doom,” “Max Payne” and “Prince of Persia.”

Most suffered from the same problem: It's difficult to adapt a property in which playability and interactivity matter more than character and story.

“Video game movies get a bad rap, and deservedly so,” said Kirk Hamilton, a features editor at the video game blog “Kotaku.” “The problem we keep running into is that the things that make games great don't translate across media.”

The idea of a movie set in the world of video games, but not based on any one in particular, percolated at Disney Animation Studios for more than a decade under the title “Joe Jump” but never got beyond the development stage before Moore, a veteran director of grown-up-friendly cartoons like “The Simpsons” and “Futurama,” joined the company in 2008. Asked to revive the idea with a new approach, Moore, a first-time feature director but an experienced gamer, racked his brain for an interesting conceit.

“Video game characters do the same job every day. I don't know how you could tell a story about that,” Moore recalled thinking. “And then it kind of hit me. … What if the main character did not like his job? If you had a character who is actually wondering: Is this all there is to life?”

Moore's pitch charmed Disney Animation Studios chief creative officer John Lasseter, who saw in it the potential to create multiple settings set in different video games.

“Wreck-It Ralph” has three fictional video game worlds, all of them derived from recognizable types: “Fix-It Felix,” a 1980s-style “platformer” similar to “Donkey Kong” in which players jump to avoid obstacles; “Hero's Duty,” a first-person shooter akin to “Call of Duty” and “Halo”; and “Sugar Rush,” a cartoony racing game that resembles “Mario Kart” and the popular Korean title “KartRider.”

To help design the worlds, Moore relied on Disney Animation staffers with both artistic and video game backgrounds. Evoking the primitive animation of 1980s games in “Fix-It Felix” presented a particular challenge. to.

“Everyone working at the studio is trained so deeply for naturalistic movement,” Lasseter said. “I kept saying, ‘Make it less good!'”

When it came to casting real video game characters in the movie, Lasseter was able to guide the filmmakers based on his own experience. For 1995's “Toy Story,” he had struggled to persuade toymakers to lend their characters to Pixar Animation Studios' first feature film. After it became a hit, and helped spur sales of Mr. Potato Head, toy companies embraced the sequels, with original holdout Barbie becoming a star in the sequels.

Procuring recognizable video game characters was a formidable task, however: Some came with a labyrinthine trail of rights and others belonged to companies with very clear ideas about how their intellectual property should be used.

Moore and producer Clark Spencer met with representatives from Japanese game companies, including Nintendo, Capcom, Sega and Namco Bandai, while they visited Los Angeles for the annual E3 industry conference and pitched them the movie using storyboard panels.

The filmmakers didn't get every character they wanted. Mario from Nintendo's “Super Mario Bros.,” for instance, proved too costly to license. But they managed to snare other characters by being flexible with the rights holders.

“From the beginning we said we want to be true to your characters, so we'll build a model and send it to you, and you can give us notes,” Spencer said. “You can say if we've chosen the right color palette, the right skin tone.”

Nintendo offered copious notes on Bowser's design, down to how he holds his coffee cup at the Bad-Anon meeting. Then came a controversy over the relative sizes of Bowser and “Street Fighter's” muscle-bound Russian wrestler Zangief.

“It started with, ‘Well, Bowser's bigger than that,'” Moore said. “So we made Bowser a little bigger. Then the ‘Street Fighter' people said, ‘Oh, no, Zangief's much bigger.' ... That was a delicate act in getting it to, ‘OK, is everyone happy with how big their characters are?'”

Originally, Fix-It Felix himself was going to be the film's protagonist, while Ralph (first conceived as “part boar, part dog, part baboon and pure failure,” according to co-writer Phil Johnson) was his enemy. But the filmmakers came to see Ralph as an outsider in the video game's small town to whom audiences would relate. “Early on we realized that we like the guy who lives in garbage and throws things at people,” Johnson said.

Other metaphors that play off of video game tropes followed. For instance, Vanellope von Schweetz, a tart-tongued aspiring “Sugar Rush” racer voiced by Sarah Silverman, has a technological malfunction that occasionally makes her disappear. “The glitch is a physical manifestation of the insecurity she and Ralph both feel,” said co-writer Jennifer Lee.

With huge box-office ambitions for the picture, Disney has spent aggressively on its marketing campaign, including commercials during the Summer Olympics. It has gone after men with ads during sporting events and girls with ones that feature Vanellope.

Some material is aimed squarely at young male gamers, who are usually the least likely demographic to attend a Disney animated film.

A trio of viral videos feature fake ads for Litwak's Arcade, where the movie takes place, from 1982, 1997 and 2012, the years when “Felix,” “Sugar Rush” and “Hero's Duty” are said to have debuted. And Disney has been courting video game bloggers beginning with a “Fix-It Felix” arcade cabinet at E3 in June and ending with an Oct. 17 screening for them in San Francisco.

“I love that video games are used as a vivid backdrop rather than a centerpiece,” said Ludwig Kietzmann, editor in chief of the blog Joystiq, who attended the screening. “The only thing that's hard to believe is it takes place in an arcade that's still open.”

Mainstream ads don't hide the film's gaming roots. The “Wreck-It Ralph” logo is made from 8-bit graphics, and billboards show Ralph surrounded not by his freshly created supporting characters but by Sonic, Clyde and Q*bert.

“We didn't know until about six months ago when the first trailer came out that people were very receptive to the nostalgia of old-school games,” Moore said. “It awoke the sleeping gamer in everyone.”

Several of the creative team's favorite ideas didn't make the 93-minute final cut, including a fourth game world called “Extreme Easy Living 2” that Moore described as a cross between “The Sims” and “Grand Theft Auto.”

But just as video games spawn endless sequels set in new venues — can anyone even count how many times Mario has rescued the princess? — Ralph might travel to more destinations in Litwak's Arcade.

“John Lasseter told us that in ‘Toy Story' they had so many ideas from the first one they had to shelve, but they all came back for ‘2' and ‘3,'” Moore said. “So if we're lucky and able to do a sequel with more stories in this universe, we can just pull those ideas back out."