No doubt Ben Affleck’s well-documented struggles with addiction over the years, beginning with an Outward Bound visit at age fifteen, afforded the actor plenty of perspective in prepping for Gavin O’Connor’s The Way Back. In fact, according to O’Connor, Affleck finished his latest rehab stint just in time for the first day of shooting.

The fictional film (which feels very much like it could carry a “based on a true story” label) chronicles a raging alcoholic’s attempts to right his life by coaching basketball. And aside from being an ultimately uplifting and inspirational film, it’s the platform for what’s easily the best performance of Affleck’s long (and checkered) career.

The actor stars as Jack Cunningham, a one-time star on the L.A. private high school hoops scene who led his team to multiple state championships and earned Player of the Year honors. But that was 25 years ago. Now he’s working construction, hiding his vodka in a coffee tumbler, and chugging beers in the shower.

When his alma mater comes calling, offering him a job as their new head coach, Jack pales at the thought and initially wants to decline, but after drinking himself into it (he pounds an entire case of beer while working through his no-thank-you speech), he comes on board. Naturally, the team he inherits is the stereotypical motley crew of misfits and wannabees, but there’s also some real talent at play, including troubled kid Brandon (Brandon Wilson), petulant big man Marcus (Melvin Gregg), and showboater Kenny (Will Ropp).

If The Way Back sounds like Hoosiers, only with Dennis Hopper’s Shooter as the coach, you’re not far off. As with Gene Hackman’s Coach Dale, Jack has his own skeletons and a tragic life event that weighs heavily. Indeed, The Way Back touches on many of the same themes and includes several identical plot points, but it still winds up feeling like a much different movie. Credit first and foremost to Affleck’s raw and honest performance (as guided by Brad Inglesby’s winning script), which deftly goes from zero to sixty and back down again in a way that never feels forced or rings untrue.

O’Connor (who directed Affleck in 2016’s supremely underrated The Accountant) elevates The Way Back out from under from every cliché that could have crushed it to deliver a riveting and ultimately redemptive film. Though the basketball scenes (exquisitely shot by cinematographer Eduard Grau) provide the backbone of the film, Affleck is The Way Back’s beating heart. The film emerges as a multi-layered profile of perseverance and personal growth and is an immediate game-changer, instantly serving as a definitive reminder of his eminent talent. And if it also helps him put that entire Batman fiasco behind him, all the better.