Around 2008, however, the brain trust at Knoxville and Tremaine's Dickhouse Productions arrived at a novel conceit on which to hang the "Bad Grandpa" plot line: a travelogue loosely modeled on the 1973 movie "Paper Moon," starring father-daughter tandem Ryan and Tatum O'Neal on a cross-country odyssey as Ryan's con-man character attempts to deliver a 9-year-old girl to relatives.

By 2011, Dickhouse's stable of writers, including Tremaine, Knoxville and Jonze, had sold Paramount on a script and landed a $20-million budget. From there, the production spent nearly 10 months of stop-start filming across six cities in three states the following year, during which Knoxville endured a daily four-hour regimen of hair and makeup to make Irving look persuasively decrepit.

"When you're planning pranks, you have to prepare for at least eight to 12 days," explains Knoxville. "You gotta find locations, the marks. It's a lot of work."

SNEAKS: Movie trailers, full coverage

According to Jonze, the shoot was more like an "experimental film" than a studio production. "We'd shoot, then edit and write for a couple weeks and shoot again," says Jonze. "We were sort of making it up as we were going along."

"You have the stupidest ideas and then you have everybody putting everything into making sure that the stupid idea gets executed properly," Tremaine says. "The logistics were complicated."

In "Bad Grandpa," Knoxville's old man, newly emancipated by the death of his wife, Ellie (a synthetic molding of Oscar-nominated actress Catherine Keener), spews crude but cryptic come-ons to every female within earshot. "I may be too old to stir the gravy," Irving's fond of saying. "But I can still lick the spoon."

He's the type of unreconstructed old salt to post up on a park bench and share a six-pack of beer with his 8-year-old grandson, Billy. A dirty old man given to public bouts of explosive farting, he's the kind of guy who accidentally — excruciatingly — gets his "jim dog" stuck in the coin slot of a soda vending machine.

But when Irving's daughter is jailed on crack-cocaine charges, the scabrous senior is reluctantly compelled to drive Billy (Jackson Nicoll) from Columbus, Ohio, to Raleigh, N.C., into the custody of the boy's deadbeat dad. Their grandpa-grandson camaraderie evolves thanks to some "Jackass"-flavored bonding exercises: Irving pitching through a plate-glass window on a coin-operated children's ride and the old man entering Billy — in drag — into a beauty pageant for preteen girls. The boy scandalizes the other contestants with a bump-and-grind striptease to the tune of Warrant's cheese-metal 1990 hit "Cherry Pie."

PHOTOS: Billion-dollar movie club

"One guy did not like my stripper routine," Nicoll recalls. "He was mad at Johnny. They were pushing each other, I think. And he was saying, 'It's child abuse!'"

The 9-year-old New Hampshire native — with whom Knoxville first worked on the 2012 teen comedy "Fun Size" — waits a beat before adding his unequivocal view of "Bad Grandpa's" moviemaking M.O. "I think it was child fun!" he exclaims.

"We had a tiny story and funny ideas. What we pitched the studio really changed over the course of shooting to what you see now," Knoxville says. "The gags, the story, the original tone — we just came out of the gates writing horrible stuff. Naughty, dirty stuff. The pranks were pretty insane. Then we brought it down to a more real place."

Besides the superfluous raunch, additional footage featuring Jonze in senior prosthetic drag as an 86-year-old woman named "Gloria" was jettisoned, as were flashbacks featuring Keener's Ellie character (the deleted scenes will be featured on the "Bad Grandpa" DVD release).

As recently as September, Jonze was still helping edit the movie — pulling double duty while completing post-production on his critically acclaimed romantic-dramedy "Her," which will see its theatrical release in December. "I'd edit my movie in the day and go over there at night," says Jonze. "That was my night job."

According to those who have seen pre-release audience surveys, "Bad Grandpa" is on track for a strong opening and could take in more than its budget — as much as $35 million — in its first three days.

"When I was doing those bits for Big Brother, I always had hopes. But you can't imagine this type of thing happening from such humble, idiotic beginnings," says Knoxville, breaking into a laugh. "I don't get caught up in all that stuff, though. I'm just trying to make it through the day."

chris.lee@latimes.com