In 2010, after the animation studio Illumination Entertainment's first film, "Despicable Me," became a surprise hit, its makers faced a quandary.

"Despicable Me" derived much of its appeal from the character of a curmudgeonly supervillain named Felonious Gru, voiced by Steve Carell, who begins the movie wanting to steal the moon and ends it by hanging up his shrink ray and adopting three orphans.

"Despicable Me" grossed more than $500 million worldwide, to the astonishment of Illumination founder and Chief Executive Chris Meledandri and the delight of distributor Universal Pictures, which promptly wanted a sequel. "What is a sequel going to look like, when you have this guy whose life has been about villainy, and you've taken him out of the role of active villain?" Meledandri wondered, when he and his directors, Pierre Coffin and Chris Renaud, started working on a follow-up.

That question of how much a sequel can stray from the original without losing its essence was a constant concern in the making of "Despicable Me 2," which opened Wednesday. And it's a common quandary around Hollywood, which has 11 other sequels out this summer, from "The Smurfs 2" to "Iron Man 3" to "Fast & Furious 6."

There's a special craft to the sequel, and all sequels are not created equal. The best — "The Godfather: Part II," "Terminator 2: Judgment Day" — build on the strengths of the previous films. The worst — "The Godfather: Part III," "Terminator 3: Rise of the Machines" — forget what audiences liked about those movies in the first place.

For many artistic people in Hollywood, the idea of making a sequel is unappealing; it can feel at best uninspired and at worst craven. Yet sequels are a cultural staple going back to the ancient Greeks — "The Odyssey," after all, is really "The Iliad 2: Journey After the Sacking." Some sequels this summer manage to improve on the prior films in both critical reviews and box office — "Fast & Furious 6," for instance, has a 76% Rotten Tomatoes rating and $682.7 million at the global box office, while the original 2001 film earned a 63% fresh rating and $207.3 million.

But with sequels ever more popular among studios looking for a sure bet, many get greenlighted before they have a script or any clear creative raison d'etre — the recent "The Hangover: Part III," which saw its party boy protagonists return to the Las Vegas setting of the first film, had a CNN critic musing, "If only what happened in Vegas had stayed in Vegas." After the opening weekend, theater audiences largely stayed away too.

"It's more often that somebody fails at a sequel than they succeed," said Andrew Stanton, who is directing his first sequel, "Finding Dory," a follow-up to his 2003 film, "Finding Nemo," for Pixar. "You don't want it to be derivative or redundant."

At Pixar, which released the prequel "Monsters University" this summer, sequels have been a source of debate. Although Pixar's parent company, Disney, is voracious for them, many at the animation studio, such as Stanton, have mixed feelings about making them.

"Finding Nemo," the studio's highest-grossing original film, seemed eminently franchise-able from a business standpoint.

"There was polite inquiry from Disney [about a 'Finding Nemo' sequel]," said Stanton, also a vice president at Pixar. "I was always 'No sequels, no sequels.' But I had to get on board from a VP standpoint. [Sequels] are part of the necessity of our staying afloat, but we don't want to have to go there for those reasons. We want to go there creatively, so we said [to Disney], 'Can you give us the timeline about when we release them? Because we'd like to release something we actually want to make, and we might not come up with it the year you want it.'"

In the case of "Finding Dory," the sequel will come after a long wait — 12 years — and explore the family background of Dory, a forgetful blue fish voiced by Ellen DeGeneres who was a sidekick in "Finding Nemo."

Part of the art and craft of making sequels is knowing how to hold onto the original's audience while inviting in new people.

In the case of the "Fast & Furious" franchise, which has grossed $2.3 billion worldwide and has a seventh film due next July, that has meant pleasing its base — street racing fans — while drawing in women, Latinos and families.

"Some audiences may have dismissed the earlier films as being underground movies for people who love cars," said Adam Fogelson, chairman of Universal, the studio behind "Fast" and "Despicable Me" as well as the "Bourne," "Mummy" and "American Pie" franchises. "You want to broaden the audience from people who may have known about the first movie but may not have known it was a movie for them."

With the "Fast" movies, Universal has increased the budgets to allow for more crowd-pleasing set pieces, but the franchise's directors have kept cars a central part of the action. In "Fast 6," former street racer Dom (Vin Diesel), now working for the U.S. government, drives his car through the nose cone of a plane. The most recent installment went out on a limb and revived a favorite character among the series' female and Latino fans, Letty (Michelle Rodriguez), who had been killed off in a previous film.

"Street racing, while it still is carefully acknowledged, has moved into the background," Fogelson said.

Each franchise establishes its own rules — of time period, character and setting. How faithfully to follow them can be tricky. Adhere too closely and you may rule out your best story ideas. Go too far astray, and you'll irk hard-core fans.

In the case of "Monsters University," a prequel in which Mike and Sulley, the middle-aged monsters from the 2001 movie "Monsters, Inc.," are introduced at college, director Dan Scanlon decided to toss a key detail from the original.

"[In the first film], Mike says to Sulley, 'You've been jealous of my good looks since the fourth grade,'" Scanlon said. "We tried to respect that line by showing Mike and Sulley meeting at the beginning of the movie as kids and then jumping ahead to college, but after a while we realized you missed the whole point of the movie or we needed to make 'Monsters Elementary,' and you couldn't tell the kind of more adult relationship story we wanted to do."

Ultimately, Scanlon decided, with the blessing of "Monsters, Inc." director Pete Docter, to disregard that bit of character background and have Mike and Sulley meet at college. "The spirit of the line in the original was just to suggest that they've known each other for a long time," Scanlon said.

The makers of "Despicable Me 2" arrived at a similar solution to their problem — opting to retain the cantankerous heart of Gru the villain, even as he spends the new film working for the Anti-Villain League and engaging in good-guy Dad tasks such as hosting a princess-themed birthday party for his daughters. When an oblivious neighbor at the party irritates him, Gru accidentally sprays her with a garden hose. And then accidentally sprays her again.

"He can't disguise the malicious intent," Meledandri said. "That personality wasn't going to transform just because his profession transformed. He was still a guy who was prone to be a curmudgeon and was unsocialized. Had we lost our way on that, I don't think the sequel would have worked."

Much of the marketing of "Despicable Me 2" has focused on Gru's transformation as a family man; one trailer shows his reaction to his daughter texting with someone named Avery — possibly a boy.

"We didn't choose it because it's the biggest joke in the movie," Fogelson said. "We chose it because it's an immediate indication that the movie's about 'How does Gru deal with the girls getting older?'"

The rest of the marketing campaign has been devoted to the audience for the first movie's favorite characters — Gru's little yellow minions, which have been ubiquitous on buses and billboards for the last two weeks.

"In an original film, you're working hard to create awareness," Fogelson said. "In the case of a sequel, you're assuming some version of the core audience already knows what it is and you're answering the question, 'Why should I go back and see that again?'"

HARRISBURG — The State Supreme Court has rejected Attorney General Kathleen Kane's attempt to throw out a grand jury investigation into whether she or someone in her office leaked investigative secrets to a newspaper to discredit critics.