The Happytime Murders isn't good, which is no surprise at all; but it is very close to being good, which is quite a surprise indeed. Basically, the problem is this: it's poisonously unfunny. The film is an enthusiastic participant in the current wave of adults-only comedy, where cursing is funny, cursing in a sexualised manner is funnier, and talking about sex in increasingly complicated, biologically unlikely ways is funniest. And on the side, the suspicion that it is much funnier to do all these things in the context of an entertainment form that is generally regarded as family-friendly. In other words, it's every bit a post-Deadpool, post-Sausage Party kind of film, and this time around, the target of the scandalising, transgressive vulgarity is The Jim Henson Company, which in a weird twist is also The Happytime Murders's production company.

The film has been languishing in development hell for a decade, as Jim Henson's son Brian has steadfastly, hopelessly kept the fires lit for the principle that people really want to watch a violent, sexual story built around Muppets. But even if he'd made it the first time he wanted to, it would still feel old hat. The very narrow concept of films parodying The Muppet Show and its characters with vulgar language, explicit sex, and wanton violence has already been done twice to my first-hand knowledge, in 1976 with Let My Puppets Come and in 1989 with Meet the Feebles. If we're willing to broaden the definition a bit wider, to include puppets that aren't specifically parodying the Jim Henson style, that also adds in 2004's Team America: World Police, which would have been a bright, shiny new memory at the time Brian Henson was first shopping around his project.

So no, "Muppets, but they curse and fuck" really just isn't enough to cut it. There needs to be something more to it, and what's sublimely frustrating about The Happytime Murders is that it has that something. The script by Todd Berger, from a story he co-wrote with Dee Austin Robertson, is basically a hard-boiled L.A. detective yarn on the '50s model. Not even a parody of one - just a pretty straightforward example of the form. Phil Philips (Bill Barretta) used to be a cop, until an accident under dubious circumstances led to a dead civilian, an escaped perp, and Phil being banished from the LAPD. Now he's a private detective, working in a shabby office all done up in dark brown wood, with golden California light filtering through the blinds and doing its best to make the constant haze of dust look vaguely alive. Phil is also a puppet, in a world where puppets live as a perpetual hated minority. And that would be that, except that Phil's latest case inadvertently brings him to the scene of a crime, where a rabbit named Mr. Bumblypants (Kevin Clash, who is also the head of the film's puppeteering team) is one of several puppets gunned down at a pornography shop. Phil's detective sense starts tingling, and he becomes the first to notice as other puppets are killed, linked in that they were all stars on the TV sitcom The Happytime Gang, which also starred Phil's own brother Larry (Victor Yerrid), as well as Phil's human ex-girlfriend Jenny (Elizabeth Banks). Just like that, Phil ends up consulting with the LAPD, much against his will, particularly since this puts him directly in contact with his hostile ex-partner Connie Edwards (Melissa McCarthy).

The important thing about that scenario is that not one thing about it is funny. Nor, for that matter, is any of it played for laughs. Of the two films that The Happytime Murders most resembles, one is Bright, and I don't want to talk about that, because fuck Bright. But the other one is the 1988 masterpiece Who Framed Roger Rabbit, which provides a perfect model for exactly the kind of thing The Happytime Murders apparently wants to do: earnestly tell a hardboiled story about a world in which the unreal stars of children's entertainment actually exist and can interact with the human world. I've suggested in the past and will stand by it every inch of the way: Roger Rabbit isn't a comedy. It has the sly one-liners of just about any halfway decent noir (it's a nihilistic genre, not a mirthless one), and many of the characters are comic actors unable to reign themselves in to be serious, but in most ways, it's deadly serious about the plot and the dramatic stakes, about the characters, about the world.

The Happytime Murders is only sometimes that. Maybe about 60% of the time. And that 60% is genuinely very good, a fine homage to the long history of Henson Company productions in its endless attention to even the smallest details and bizarre one-off gags (a notable highlight: the DVD covers of puppet porn movies Puppet Pussy Party and Chicks with Big Asses, both interpreted in the most extremely literal, non-sexual way). Henson fils isn't up to any kind of sacrilegious mischief at all: he is taking exactly the kind of world-building, sincerity, and comic timing that showed in his father's works, like The Muppet Show and its various spin-offs, or Fraggle Rock, and simply applying them into a much darker, dirtier world. I've seen more than a few people grouse that this is an insult to Jim Henson's legacy, but given some of the truly bizarre things he tried out, and given his increasingly open desire to make movies for grown-ups at the end of his life, I actually think he would have approved of the notion of The Happytime Murders, if not exactly the execution.

For Brian Henson is, at any rate, not a tremendously gifted director: his first film, The Muppet Christmas Carol, is a masterpiece, but it was mostly staffed by people who'd worked intimately with his dad, and his second film, Muppet Treasure Island, is cute and all, but rather stiff and indifferently paced. If anything, The Happytime Murders improves on that second film; it moves pretty quickly, and it adroitly handles the single biggest challenge that faces any project made with Muppet-style puppetry: giving the puppets equal weight in the frame, making the film scale properly to them, and making their interactions with humans feel invisible and organic. Given how much of this film hinges on Phil and Edwards sharing the screen, it's critical to this film having any success at all that this technological challenge be solved faultlessly, and for the most part it is; the film even ends with some behind the scenes footage showing off how some of the most elaborate effects were achieved using extensive, and totally invisible greenscreening, a sure sign that the filmmakers were proud of themselves. Granting all of that, the film has much of the same stiffness of Muppet Treasure Island, an overreliance on dialogue to do all the heavy lifting while the characters mostly just stand there.

Still, it works, it's impressive, and it feels like a good-faith attempt to tell a sordid tale of sex and violence using well-designed puppet characters. 60% of the time. The other 40% of the movie is a Melissa McCarthy comedy of the shabbiest kind (she and her husband Ben Falcone are among the film's producers), executed by people who have no apparent idea what in the hell to do with this kind of humor. The film tries very hard to get mileage from sex and cursing simply for the sake of sex and cursing, in the witless fashion too common in R-rated American film comedy in the 2010s; the idea seems to be that, since laughing is generally symptomatic of being startled or shocked in some fashion, "shocking" is enough to get the job done. It never is, of course, and it's much worse in this kind of environment, when it feels so annoyingly self-regarding on top of it. The result isn't the all-time worst McCarthy vehicle - Identity Thief and Tammy have made that an extremely difficult bar to clear - but the extreme conflict between the crude, loud humor (which, to be very clear, is found all throughout the film, not just in McCarthy scenes - not even primarily there) and the more sardonic, bitter anti-humor of the hardboiled P.I. story makes both halves of that equation seem worse than they are. The greatest Henson projects, be they comedies or otherworldly fantasies, start by going subtle: taking stories and genres very seriously and then imbuing them with absurd humor mostly on the surface. The Happytime Murders, for all its flashes of promise, really has no idea whatsoever what "subtle" looks like, and everything interesting, well-executed, and creative about its characters, scenario, and world has to struggle for attention beneath its remarkably terrible sense of humor. I think you should still see it, especially if you're a Muppet fan, but you shouldn't expect to enjoy the experience.