“Daring” isn’t a word you would use very much to describe 2011’s The Hangover Part II, the disappointingly lazy, beat-for-beat rehash of the wild and wildly successful original Hangover from 2009.

And yet, here we are with The Hangover Part III, which runs a different sort of risk by going to darker and more dangerous places than its predecessors, both artistically and emotionally. It dares to alienate the very audience that made The Hangover the highest-grossing R-rated comedy of all time because, well, it isn’t exactly a comedy.

Sure, there are some outrageous lines and sight gags, mostly courtesy of Zach Galifianakis and Ken Jeong, who function as central figures this time when, previously, a little bit of them went a long way. (This was also a potentially alienating decision.) But director and co-writer Todd Phillips signals early and often that he’s much more interested than ever before in exploring matters of real consequence, rather than simply mining them for brash laughs.

Phillips and co-writer Craig Mazin have placed the unusual challenge on themselves of trying to create something bold and new while simultaneously remaining true to the trilogy and wrapping it all up in a satisfying way. They succeed somewhat; simply trying to be creative marks a huge improvement from part two.

This time, Galifianakis’ insufferable, inappropriate man-child Alan has gone off his meds and is out of control. His family and friends — including fellow “Wolfpack” members Phil (Bradley Cooper), Stu (Ed Helms) and Doug (Justin Bartha) — stage an intervention and offer to drive him to a treatment center in Arizona. And so the four venture off on yet another journey, once again assuming their familiar roles: arrogant English teacher Phil is the de facto leader, Stu is the cautious and neurotic dentist and Doug is the bland and stable voice of reason.

In theory, this should be a pretty innocuous trek through the desert. But this is a Hangover movie. So, naturally, they get run off the road by masked thugs who work for crime boss Marshall (John Goodman, who improves everything merely by showing up). Turns out, some of their actions in Las Vegas four years ago have tied them to the evil, effeminate gangster Leslie Chow (Jeong) and put them in trouble with some powerful, volatile people. (Chow, we see in the prologue, has escaped a Bangkok prison, sparking an epic riot captured in dramatic, visceral detail by Phillips’ frequent cinematographer Lawrence Sher.)

Now, they must make things right by finding Chow. And of course, there’s a deadline, with Doug serving as collateral. Their assignment takes them to Tijuana and the rolling hills of northern Mexico until, inevitably, they must end up back in Vegas. In keeping with the tone of part three, this depiction of the city isn’t sparkly and full of promise, but rather seedy and foreboding.

Las Vegas does, however, serve as the location for some rare moments of heartfelt emotion. One comes courtesy of Melissa McCarthy, in typical scene-stealing fashion, as the pawn-shop clerk who turns out to be Alan’s trashy, mulleted soul mate. The guys also revisit Stu’s first wife, ex-stripper Jade (Heather Graham), and find that she’s living a happy suburban life with her son, who’s now 4. The child actor who plays him, Grant Holmquist, was one of several infants used in the original “Hangover” as Baby Carlos and is the one featured prominently in that film’s posters. It’s a nice touch.

On the opposite end of the spectrum, Chow is more than just a silly, bisexual cokehead this time around. He’s clearly a sociopath, and the group’s association with him is more than just a nuisance. Jeong gets a bit more room to explore the role and finds a bit more shading, but if you hate this character, you might just hate this entire movie, as well.

Similarly, Galifianakis gets way more screen time here; he’s essentially the star of The Hangover Part III, with Cooper and Helms fading into reliable supporting roles. (Bartha once again misses out on the adventures.) The character of Alan is still odd and off-putting, unorthodox and unpredictable. But his loneliness and neediness shine through, which makes one of the more out-there figures in the Hangover universe unexpectedly relatable.

Your expectations — and keeping them in check — are a crucial factor here. This isn’t a party: This finally, truly is the hangover. And it’s also the recovery.