The Disaster Artist, the new James Franco comedy, is for anyone who’s ever seen an extremely bad movie and wondered, “How the fuck did this happen?” You know a movie is bad when you immediately start to ponder the conditions of its existence, and also probably your own—that’s how these movies get you. You keep watching because you’re in shock. You see ingloriously bad scene after ingloriously bad scene and eventually begin to wonder whether people really stood there with boom mics and tattered scripts in hand, day in and day out for months, as these crimes were being committed. And did nothing! Which is what makes these movies strangely invigorating. Bad movies are, if nothing else, boons to the imagination. How many times has your flavor-of-the-season, overly manicured Oscar drama inspired the same?

For the record, I’d probably still rather watch the Oscar drama, for the same reasons that I persist to eat celery and carrots at Super Bowl parties: They hold me over between rounds of juicier fare. And so we’re clear, The Disaster Artist isn’t the bad movie in question—though Franco, its director and star, has absolutely made his share of them, enough for you to get away with calling him an expert on the subject and mean it as a compliment. The strange thing isn’t that The Disaster Artist is good; Franco can do good work, even if he has for some time seemed keen on denying himself a chance to prove it. No, the strange thing is that The Disaster Artist probably wouldn’t be so good if the movie it’s about, the 2003 cult film The Room, weren’t so bad. Funny how that works.

The Room, as the legend goes, was written, directed, produced, and (somehow) financed by a guy named Tommy Wiseau, a mysterious Mr. Moneybags with a Keith Richards–knockoff vibe and a somewhat muffled Eastern European accent. (He’s claimed he’s from Louisiana.) Wiseau stars in The Room as a successful banker named Johnny whose fiancée, Lisa, betrays him with his best friend. But the movie hasn’t been selling out midnight movie screenings across the country over the past 14 years because of its plot, obviously: People go for the indescribably weird sexual vibes, the meteor-crater-sized plot holes, the green-screen skyline, the d-r-a-m-a. They go for “You’re tearing me apart, Lisa!!!” and to see if they can figure out how this movie cost a reported $6 million. Six million isn’t exactly breaking the bank in Hollywood terms (unless you mean a piggy bank), but it’s a testament to The Room’s beguiling awfulness that when it ends you’re left wondering where all that money went.

That’ll remain a mystery no matter how many times you’ve seen The Room, just as Wiseau stays enigmatic no matter how much you read up on him. (His age, specific birthplace, and source of income remain officially undisclosed even today.) The closest we’ve gotten to understanding the man is a book on the making of The Room cowritten by Wiseau’s close friend and collaborator Greg Sestero, who plays the other male peg in the movie’s love triangle. That book—The Disaster Artist: My Life Inside ‘The Room,’ the Greatest Bad Film Ever Made (2013)—is the inspiration for The Disaster Artist, which stars real-life brothers James and Dave Franco as Tommy and Greg, respectively. Franco’s film begins at the start of the duo’s awkward friendship, in 1998, when Greg is just an Abercrombie-pretty 19-year-old living with his parents in San Francisco who takes a liking to the fearlessly theatrical Tommy in an acting class. Theirs is a distinctly struggling-actor friendship. They rehearse lines, fall in love with James Dean and drive 300 miles to his crash site, and, a few months later, move to L.A. together, to “make it.”

Good thing Hollywood didn’t bite, because if they’d made it big, Tommy and Greg wouldn’t have felt put-out and desperate enough to make their own movie, in which case there’d be no cult of The Room to speak of and, thus, no excuse for James Franco to do whatever the hell it is he’s is doing in The Disaster Artist. Franco delivers a marvelous performance, far better than the mere imitation you might (rightly) expect, given how much of a complete character Wiseau already is. It’s a role practically begging an actor to Do Too Much, and in Franco’s case, that can be a risky proposition. But he’s onto something here. He’s got a lot to work with in Wiseau, whose voice makes him sound like he’s got a permanent hangover and whose zealous self-confidence would make him at home amongst American Idol’s most delusional rejects. Franco fills out the accented nuances in Wiseau’s voice and the quirks in his moves and behavior with an utter sincerity that is, without being mocking, deeply funny—and uncannily revealing.

Rather than merely mimic what he’s seen of the guy, Franco gives life to the sense that Wiseau’s personality is completely aspirational. Wiseau is living out the American dream, or trying to, and the first step, apparently, is to try to act as American as he can, as if he’s trying to will himself into becoming a success story by acting the part. Of course Wiseau, an avid fan of Tennessee Williams (or at least of crying “Stellaaaaa!” in public), would claim to be from New Orleans, where A Streetcar Named Desire is set, and where America is least ashamed to admit that it’s a bastard mix of everywhere and everyone else. It’s a great origin story. But wherever he’s from and whatever his reasons for keeping that to himself, Wiseau won’t ever be able to outrun his accent. Franco seems to find inspiration in that. He finds a way to make it feel just this side of sad.

How does Franco do it? For one, he makes a point of understanding Wiseau’s obsession. The Disaster Artist is ultimately the story of two friends, Tommy and Greg, and how they tried to make it in Hollywood. But it’s also the story of Wiseau’s preoccupation with becoming an “artist.” The clear precedent for Franco’s project is Tim “Speaking of Bad Movies” Burton’s Ed Wood (1994), about the cheapo 1950s cult filmmaker Ed Wood (played by Johnny Depp), whose ingenious sense of trash was a source of inspiration for Burton himself. Like Ed Wood, The Disaster Artist is a loving look at its subject. But Wiseau proves a little harder to love.

The best stretch of The Disaster Artist depicts the actual making of The Room and Wiseau’s increasingly tyrannical attitude on set, his abuse of his actors, and his completely ignorant confidence in his own ability to make a good movie. In an earlier scene, an acting coach suggests that Wiseau’s weird vibe and unsettling aesthetic lent themselves to playing villains, not heroes. “I’m hero,” Wiseau yells at his classmates, “and you are all villain. You all laugh, ‘HA HA HA.’ That’s what villains do.” “You have a malevolent presence,” the acting coach says. It doesn’t seem true until Wiseau is actually making his movie, with Greg in his back pocket like an emotional support dog. But even that relationship comes under strain, with Greg getting a girlfriend, to Wiseau’s dismay, and trying to make moves in his own career. The actual movie-making scenes in The Disaster Artist are remarkable examples of how egotism functions on a movie set—meaning, they’re funny until they start to feel dangerous.

You can easily imagine a bad version of all of this, the SNL-sketch edition, anchored by a James Franco performance that puts it all in giant quotation marks. But The Disaster Artist is a little too rigorous a recreation to not be genuine. You can tell that getting The Room right was a priority, which feels strange for such a shitstorm of a movie. But when the end credits roll, you’ll get to see clips from the original film alongside The Disaster Artist’s exceptionally well-timed reenactments. Franco and his stacked cast (Zac Efron! Alison Brie! Seth Rogen! Jacki Weaver!) have truly outdone themselves here. The only winking and nudging I sensed from the movie was from the overfamiliar buddy romance at its center, with its steady beats of betrayal and reconciliation sounding out with knowing dependability.

The real genius of The Disaster Artist is its understanding of anti-genius. With The Room, Wiseau intended to make a semi-autobiographical dramatic masterpiece that launched his and Greg’s big Hollywood careers. Instead, he made an accidental cringe comedy—and became a cult hit. Franco’s movie ends with Wiseau and others in the audience of the premiere, mouths agape with horror at the awfulness of the movie and the initial confusion of the audience. And then, sensing that the audience is having a great time, they all embrace it. I don’t know that I believe in accidental genius—I’m not too keen on defining genius as a matter of intention, in the first place. But it’s undeniable that Wiseau struck gold here despite glorifying his lack of talent—and that Franco, as ever poised to sink his immense talents into forgettable trash, was able to make a tribute worthy of Wiseau’s passions by finally doing justice to his own.