It was about a year ago that Brooklyn filmmaker Alex Ross Perry released his latest, about some female friends who retreat to a cabin after a woman’s relationship doesn’t end well. Now he’s appearing in a film in which a group of guy friends retreat to a cabin after their bro’s relationship falls apart. Needless to say, Joshy, directed by Jeff Baena (Life After Beth), contains way more dick jokes than Queen of Earth, as you’d expect from a largely improvised film in which comics Nick Kroll and Brett Gelman play coke-snorting, prostitute-hiring wingmen. But don’t mistake this for an Apatow knockoff– it’s actually a nice balance between the Rich Dicks shtick for which Kroll is known and the sad-sensitive mumblecore for which Perry is know.

In the film, the titual Joshy (Thomas Middleditch of Silicon Valley) decides to go through with his bachelor party in Ojai even after his fiancee ditches him in the most unsettling manner. After the film’s New York premiere at BAMcinemaFest last week, Baena revealed during the Q&A that the premise arose because Adam Pally (who plays one of Josh’s would-be groomsmen) once had to persevere a similarly awkward weekend. “It wasn’t the same, but there were similar elements,” Baena said.

Originally, Ben Schwartz was set to play the character that would eventually be played by Alex Ross Perry– the stag weekend’s nerdy, neurotic killjoy and straight man, who doesn’t do drugs and studiously avoids hot tubs for fear of boil-inducing bacteria. The other guys are, well– let’s just say they’re not quite as evolved. “I kind of wanted to capture this thing that’s going on right now in California right now,” Baena said, “which isn’t cool, necessary– it’s not like the ’70s and ’60s where it’s like, ‘This must be documented because it’s so rad.’ It’s more just like, ‘This is kind of what’s going on: it’s, like, dudes who vape. Like, it’s that scene.”

Though he’s better known for having written and directed films like Listen Up Philip and The Color Wheel, Perry has done some acting in films like 7 Chinese Brothers. In this case, he scored the role partly because he’s Scrabble buddies with Baena. “Jeff was like, ‘Hey, I’m going to make this movie– you know how we play games when we hang out? You should come be in this movie as a character who likes to play games,'” Perry said.

True to form, Perry’s character, Adam, spends the entire bachelor party moping around and trying to get the other guys to put down the tequila shots and play a board game called Megadungeon Crawl– which, it turns out, is an actual game created by the husband of script supervisor Andrea Manners-Petersen. According to Baena, the game’s creator had been trying to get it off the ground, but its appearance in the film constituted its “swan song,” in part because its multiple pages of instructions (11 of them, by Perry’s count) were impossible for even Middleditch and Perry to grasp.

“Thomas and I both play games,” Perry confessed. “I can understand a complicated game that takes a day to play, and so can he. And neither one of us could make sense of this game.”

Needless to say, Joshy’s alpha-male bois insist on bar crawling instead of megadungeon crawling, even though lovelorn Joshy is keen to play the game. “Not to be drawing gender lines,” Baena said of the dynamic, “but a lot of men, the way they deal with trauma and their emotions is insane.” The director said he was fascinated by a particular aspect of male bonding: “Guys don’t really talk about their feelings, or when they do it’s aggressive– they get it out of the way right away and just move on.”

Perry said that part of the reason he was so capable of playing a character who is so alienated from “emotionless bro time” was because he was the outsider among the group of lead actors. “All these guys in this movie know each other really well and go back years and years,” he noted.

Plus, Jenny Slate, Jake Johnson, and the others who appear in the movie are all based in California, whereas Perry is such a NYC filmmaker that Listen Up Philip garnered comparisons to Woody Allen. Nevertheless, he got a West Coast education when he established a routine with Pally: “The deal every night was that he would drink a lot and use a vape pen and I would drive his car home,” Perry tattled. One of those nights turned out to be eventful when “there was sort of a drug situation and a car chased a car over a bluff or it drove over it and exploded near our house,” Perry said.

“This is what wouldn’t happen in New York,” he recounted. “The house was, like, on a dirt road and there was a guy with his shirt off holding his dislocated arm and running toward the car at 4am, and we were like, ‘That’s odd,’ and then we rounded the corner and there’s like plumes of smoke and flames 100 feet from the house.”

“So that’s the California I got to see,” said the Brooklyn filmmaker. “As someone who lives up the street from here, that was fascinating for me.”‘

“Joshy” will be released in theaters and on demand on August 12.