From left, Natalie Portman, Danny McBride, James Franco and Zooey Deschanel in a scene from "Your Highness."  IN the 15 or so years it took them to get from Winston-Salem to Hollywood, Danny McBride and David Gordon Green found ways to pass the time. Since meeting as undergraduates at the North Carolina School of the Arts, Mr. McBride, who plays the mullet-haired, showboating pitcher Kenny Powers on HBO’s “Eastbound & Down,” and Mr. Green, the director whose films include the stoner comedy “Pineapple Express,” have established a tradition of brainstorming preposterous titles for hypothetical film and television projects, then inventing premises to fit those titles.  Recalling a bygone example, Mr. McBride said, “It’s called ‘The Face of Danger,’ so Steve Danger is a plastic surgeon, and he solves crimes by changing his face with plastic surgery.”  It was during one such alcohol-fueled session, while they worked on Mr. Green’s 2003 feature “All the Real Girls,” that a similarly ridiculous reverie came to them.  “It was going to be called ‘Your Highness,’ ” Mr. Green said. “And the poster was going to be Danny in a chain-mail leotard, with a joint in one hand and a sword in the other. And it was going to say, ‘Put this in your pipe and smoke it.’ ”  When the time came to put out the film, Mr. McBride wouldn’t wear the chain-mail leotard, and they ended up cribbing that slogan for “Pineapple Express.” But that, more or less, is the origin of “Your Highness,” a fantasy comedy starring Mr. McBride and directed by Mr. Green that demonstrates the serious efforts they will invest to bring their ludicrous inspirations to life. “We’re of two mind-sets,” said Mr. Green, a genial, flannel-clad Southerner who seemed slightly uneasy by the chic Manhattan hotel lounge he was speaking from. “We’re half, like, what can we get away with? And half, what can we convince an audience to go see?”  In “Your Highness” (which Universal will release on Friday) Mr. McBride plays Prince Thadeous, a medieval layabout who learns to see past his jealousy for his handsome, dashing brother, Prince Fabious (James Franco) and joins his illustrious sibling to rescue a maiden (Zooey Deschanel) from an evil wizard (Justin Theroux).  Having kicked around the idea for several years, Mr. McBride made his first serious effort at writing the screenplay while he filmed a supporting role in the 2008 “Tropic Thunder,” drawing his inspiration from low-budget 1980s sword-and-sorcery films like “The Beastmaster” and “Barbarian Queen.”  “It was a good excuse to watch all that and have your wife or girlfriend still be able to respect you,” said Mr. McBride, who spoke from a sunlit bungalow at the offices of Rough House Pictures, the company he founded with Mr. Green and their college classmate Jody Hill in Los Angeles. “You’re like, ‘I’m doing this for a job, not because I’m some super-nerd.’ ”  But in his original draft for “Your Highness,” Mr. McBride (who wrote the script with Ben Best, another college friend) said he filled the pages with elaborate special effects and “huge cities on the backs of snails that are moving through deserts,” resulting in a film that would have cost between $200 million and $500 million. “That obviously had to be reined in a little bit.”  That first attempt also focused largely on the character of Prince Thadeous while pushing Prince Fabious to the background, an imbalance that was rectified when Mr. Franco, a co-star from “Pineapple Express,” agreed to join the film.  Mr. Franco, in an e-mail response to questions, wrote that the “fleshed-out Fabious gives a motor to the quest” and “pushes Danny’s character to be a better person, because Fabious can see the good in Thadeous.” he added: “This all sounds hokey when talking about a film like ‘Your Highness,’ but I believe that an emotional ground is important for comedy.”  The team caught another break when Natalie Portman — who had been talking to Mr. Green about a possible remake of “Suspiria,” a Dario Argento horror movie set at a ballet academy — joined “Your Highness” as a Xena-like warrior named Isabel. (“Then she signed onto her other dark ballet movie,” Mr. Green said. “The rest is history.”)  Ms. Portman, who was training for “Black Swan” when filming on “Your Highness” began, said she was initially hesitant about stepping into an environment that called for so much improvisational comedy and, in particular, about acting opposite Mr. McBride.  “He always plays such jerks,” Ms. Portman said. “I was like, ‘Oh God, what’s it going to be like to work with this guy?’ But he’s so incredibly lovely.”  She said she was grateful for a role that was athletic as well as comic, allowing her to wield fearsome weapons and foul language traditionally reserved for male characters.  “I don’t know how I got this image of being this strait-laced girl,” she said.  As for a scene in which Ms. Portman conspicuously strips down to a thong bikini before bathing in a lake, she said, “Now being heavily pregnant, I’m glad it’s captured on film somewhere that I wasn’t always this size.”  The filming of “Your Highness” took about six months in 2009 and happened mostly on a soundstage in Belfast frequented by productions that aspire to a craggy, lived-in Middle Ages aesthetic. (The HBO fantasy series “Game of Thrones” arrived there just as “Your Highness” was packing up its scimitars and codpieces.)  But on a budget that Mr. Green put at about $50 million — more than he or Mr. McBride was accustomed to working with but still fairly low by Hollywood standards — there was rarely time to raise a flagon of mead.
âYour Highness,â starring Danny McBride and directed by David Gordon Green, is the latest effort from these two old college friends.