I wonder what the brainstorming session for Your Highness must have been like. How exactly does one make the leap from “fantasy epic” to “stoner sex comedy?” How could anyone find a connection between exploring faraway lands while slaying mythical beasts and doing so many miscellaneous drugs while smoking so much pot that I just answered my own question, didn’t I?

The premise begins when a fair maiden is kidnapped from her princely husband-to-be as part of an evil wizard’s plan to take over the world. It’s a simple fantasy premise, easily understood and sufficient to start a great quest. But then we learn of the wizard’s great plan: To knock this maiden up with dragon in a ritual called “The Fuckening.” Such is the influence of this film.

The premise alone should clue you in that this movie’s humor is the absolute lowest of the lowbrow. Aside from one (1) ingeniously clever bit of gallows humor at the film’s outset, there’s no evidence of a single brain cell to be found anywhere in the proceedings. The rest of this film’s comedy consists pretty much entirely of sex humor, drug jokes and general buffoonery. Hell, the stupidity on display even extends to the totally predictable narrative. Still, there are two things that keep the movie funny. First is just how far this film goes. The filmmakers truly commit to pushing the gross-out envelope as far as they can, going to such a shocking and surprising extent that I couldn’t help laughing in spite of myself. Secondly, the film shows a tremendous amount of self-awareness. There’s a character in this film that spoofs Bubo, for God’s sake.

Basically put, this film knows exactly what it wants to be. It isn’t just a bottom-of-the-barrel film, it’s a film that intentionally dives to the bottom of the barrel at a million miles an hour and makes no apology for it. I can’t help but respect that just a little.

Of course, it also helps that the film is far better-crafted than it has any right to be. The camera work is good, the production design is rock-solid, the makeup, VFX and creature effects are all marvelous. I’ve no idea why such top-notch effort and sterling visuals would go into a 100-minute reel of sophomoric humor, but I like it.

Then there’s the matter of the cast, starting with Danny McBride. No, he doesn’t play our Prince Charming. Instead, McBride co-writes, exec-produces, and plays the King’s second-born, Thadeous. He’s a man so sullen and jealous of his beloved older brother that he just sits around all day, getting high. And why not, considering that he’ll never have any chance of ever being king?

Thadeous isn’t entirely sympathetic, which helps make it humorous when he’s subjected to some abuse or other. Yet he’s still a prince, he’s not really a bad person and he’s put in the relatable position of finally being given a chance to prove his worth. All of this keeps the character watchable and helps us root for his development as a character. Plus, he serves as our “straight man” through most of the proceedings, and seeing fantasy tropes filtered through his mundane slacker sensibilities is very funny. Sorry, but a fantasy character saying “fuck” is funny. I don’t know why, it just is.

The “Prince Charming” role is played by James Franco, who does an outstanding job here. He and McBride play very well off each other, creating a dynamic and loving relationship between these two brothers. Franco himself turns in a great performance, particularly with the humor. No matter how much humiliation the script puts him through — and the proceedings get pretty damn embarrassing, believe you me — Franco handles every scene like a champ.

His bride is played by Zooey Deschanel, who does a decent enough job with what little she’s given. Hers is a standard “Damsel in Distress” role, requiring very little except to look pretty and remark how the villain will never get away with this and blah blah blah. The film’s other female lead, none other than Natalie Portman, gets a much better deal as the sexy and stoic warrior who puts our male leads to shame. Portman is in full-on badass mode here, playing a perfectly straight-faced parody of a wandering swordswoman. She’s awesome, she’s beautiful, she’s hilarious in how serious she is and the film uses all of that to the fullest potential. Her romance with McBride was quite rushed, but what else would you expect?

The villainous sorcerer is played by Justin Theroux, also known as the guy who wrote Tropic Thunder and Iron Man 2. The film strikes a very fine balance with this villain, effectively showing him as a powerful and formidable threat while also showing him as a comedically pathetic little douchebag. A lot of this is due to Theroux, who chews scenery with every second of screen time. In fact, there’s one segment in which he actually grinds up and snorts the scenery. The man truly buried himself in this role, and he makes it very funny.

An honorable mention is due to McBride’s squire, played by someone named Rasmus Hardiker. He effectively plays the plucky sidekick role, yet Hardiker plays Courtney as someone who’s unusually self-aware and comfortable in that role. A lot of jokes are made at his expense, yet Courtney takes it all as if he’s in on the joke. Moreover, he’s clearly got Thadeous figured out, though he greatly cares for both his masters and he proves his worth when it counts.

Your Highness is a guilty pleasure. As gross, disgusting and mindless as the humor is, it’s still delivered in a way that produces laughs. Furthermore, the film is so competently crafted and well-acted that I have no problem giving it a recommendation. If you’re able to leave good taste at the door, you’ll have a fun time with this one.