It’s a good thing no one told Paul Thomas Anderson that making Boogie Nights—not just shooting his own script, but ending up with the product he has—was impossible. His timing would have been perfect had he wanted to direct a lousy, widely hailed mainstream art movie about the porn industry: Porn has recently earned a hip credibility, and at the same time prurience is too tempting a response to it. A director one iota more facile than Anderson would have been tempted to turn Boogie Nights into exploitation disguised as a satire of the exploitation business. A director whose confidence was, unlike Anderson’s, unfounded, would surely have made this a numbing, self-righteous defense of freedom à la The People vs. Larry Flynt.

Most dangerous of all, Hollywood players who suspect that others suspect they make their living at worst doing nothing at all and at best gaudily whoring love to see flattering shadow versions of their lives on the screen. If Anderson had been willing to parallel his seamy milieu with that of the “respectable” film industry and throw in the attendant self-pity, irony, and insidery winking, he could have been looking down the business end of an unlimited budget.

But Boogie Nights had the advantage of growing organically from an old pet project, The Dirk Diggler Story, and it feels disconnected not only from on-the-radar Hollywood life but from other movies. In the style of its chief influence, Robert Altman’s Nashville, it reads like a novel, one that can end only when its story has been told (mere restlessness is not an option), and it explores with curiosity and good nature various corners of the comprehensive space it occupies. The film isn’t about making it in the movies but growing up in Los Angeles—more properly, the San Fernando Valley—in the ’70s, a hothouse time and place that spawned its own vigorous mutant flower: the thriving, this-close-to-real-art adult film industry.

There’s a point here about artistic integrity at any level, but Anderson is too sly and fond of his subject to make it; he takes it for granted that director Jack Horner (Burt Reynolds, flawless and finally Oscar-bound—now maybe he’ll shut up about it) and his stable of comely stars believe they’re doing good work. Where Ed Wood crawled up its own behind boring us with how adorable Wood’s efforts to get his rickety movies made were, Boogie Nights shows movies getting made, with gravity toward the subject and the usual buzz about technical wrangles providing the mundane background static. Anderson doesn’t allow the topside film industry to intrude and expose the principals’ tinsel and trash to the harsh light of Art. Boogie Nights’ world is uniquely pure, a hermetic environment that looks nowhere else for the frisson of “real” filmmaking. Its denizens have their own discussions about character motivations and camera angles, their own warehouses packed with profitable product, even their own night to shine—the glittery Adult Film Awards.

Horner first spots Dirk when he’s mere Eddie Adams (Mark Wahlberg), a busboy in a happening Valley disco, with a bulge in his pants and a head full of dreams. Eddie has been ducking out of his rotten home by night and using his natural gift—a huge penis—to take in some extra cash; his goals are writ large on a small board: Be a star of any kind, meet chicks, make lots of money.

Soon enough, Eddie joins the Horner stable, where Jack’s kindness and the attention of the other stars—nurturing, soft-spoken Amber Waves (Julianne Moore), blithe teenage Rollergirl (Heather Graham), and the boastful, competitive, but harmless Reed Rothchild (John C. Reilly)—make Horner’s tacky, swinging pad seem more like a home than the twisted suburban nightmare Eddie comes from, where Mom (Joanna Gleason) is a hysterical harpy enraged by her handsome son’s sexual autonomy.

Before plunging us into the business proper, Anderson shows us sick sexuality on the loose in the so-called straight world, where a mother’s insistence on claiming as her property everything her son has touched transparently indicates her desire to claim him physically, and where high-school boys’ idea of fun is to mouth filth at the prettiest girl in school. Horner has created the community the stars cannot find at home, in school, or even at straight jobs—frustrated Buck (Don Cheadle) is ordered to stop demonstrating stereo systems with his favorite music, country—and these lost souls not only cling to the warmth and camaraderie but grow strong through it. After what they’ve seen of the outside world, what could feel more normal than fiddling with lighting setups and memorizing dialogue?

Eddie renames himself Dirk Diggler for his movie debut; he’s so naive he wants to know if Amber is having a good time. Wahlberg has a wonderful, opaque self-absorption in his youth, beauty, and prowess—”Do you mind if I make it look really sexy?” he keeps asking—but he’s also a sweet kid with a deceptive, razor-sharp smile, clearly headed down the well-worn rise-and-fall path: transformation, ascent, hubris, exile, dissolution, rebirth.

What makes Anderson’s retelling of this tale news is his rock-solid confidence and the obscene amount of fun he has unrolling this story before us. His asides and occasionally crazed camera are never less than good-natured and often useful. When Eddie closes his eyes, he sees his screen name in blue-and-purple neon (as do we), so sharp and powerful it explodes in a shower of sparks, as will he. A faux-documentary (Amber’s “love letter” to Dirk at the peak of his powers) tracks Dirk’s first tip over to the other side; interviews unravel characters’ psychologies and illuminate their interaction, but Anderson never cheats by using this timeout to advance the plot.

The arc of the story is connected by a series of parties at Horner’s place, leisurely affairs where margaritas are the drink of choice and everyone keeps their scanties on, even in the hot tub. Anderson roams from table to table, to the pool (and into the pool), to the bar, to the driveway out back, overhearing conversations and witnessing major developments. There seems to be more going on than he can possibly show—so many great stories to tell—but he is trustworthy and will take us to them soon enough.

As the ’80s roll in, life takes on a harder edge—artistic Horner is threatened by the advent of videotape (he’s a film purist), there’s shocking violence, and Dirk meets his new friend, cocaine. After exile from paradise, which is becoming a hell for its restless inhabitants—in one depressing scene, Amber and Rollergirl make frantic plans for the future while they do all they’re ever going to do: mountains of coke—Dirk undertakes a pathetic recording career of the kind that his pride and native stupidity breed (think Loverboy or Survivor). Reed follows him, as does Scotty (Philip Seymour Hoffman), a podgy, tremulous ex-Horner crew member piteously devoted to Dirk.

As drugs eat up their money, they look to the criminal schemes of a dicey friend-of-a-friend (Thomas Jane), only to find that the porn world was the safest one they could hope for. Wahlberg seems to float effortlessly enough through this role, but he’s occasionally much more than the former Marky Mark playing himself; there’s an astonishing moment in a drug dealer’s ritzy den where Dirk zones out as Rick Springfield’s “Jesse’s Girl” pumps mechanically in the background. It’s impossible to say how Anderson can make such breezy kitsch so heartbreaking, but in one look Dirk’s sense of innocence and imperviousness drains away and you can see how soiled he feels, how wretched and unprotected.

Meanwhile, the times change right under Horner’s feet—he grooms another young star to take Dirk’s place, but no one wants to see sex-and-action sub-Bond heroics in a porno flick anymore; video, realism, and a tough-enameled glitter he will never understand are where it’s at. A video experiment ends in brutality; tellingly, he gives in to the technology anyway.

Everyone thinks this messed-up new phase can be accounted for by Dirk’s absence, but in the end, it isn’t the times or the business that determine the characters’ well-being and ability to function happily. It’s their need for family, a need so keen it’s frightening, and when they create a family out of nothing—proximity, shared damage, sheer force of will—it’s exhilarating. Anderson walks right through his subject’s surface—sex for sale—and into its heart: Human beings need love at any cost, not instead of sex but beyond it. Boogie Nights isn’t ironic about this point, but prosaic, and sensibly so; perhaps the people for whom sex is a business understand this better than most of us.

To play the hero of Playing God, David Duchovny assumes the task of mumbly, pseudo-jaded narration to explain why he is no longer Dr. Eugene Sands but merely Mr. (while high on a complicated pharmaceutical combo, he killed a patient in surgery) and how Chandleresque life can look when you’re sucked into a world of blood, dames, and mobsters. The mobster is Raymond Blossom (Timothy Hutton, believe it or not), who recruits Dr. Do-Me to fix up his shot, hatcheted, and otherwise interfered-with friends, while Duchovny drones on in voice-over about the things he’s seen done to the human body (“Well, I’ve seen the results,” he corrects himself); the dame is Angelina Jolie, who once or twice almost acts, although watching her get excited about a basketball game is a very special experiment in strain. The blood is everywhere.

It’s hard to say whether the dialogue is stupider than the narration. Clearly Dr. Hotpants left his gray cells on the operating table: “A friend,” he muses dementedly. “Ray genuinely liked me. I wondered why.” The tone is so serious you feel compelled to listen, but there’s no lightness, no kicks, no fun with the sleazy milieu. It’s shot like a TV movie, with cheesy ’70s tricks transitioning the scenes—zigzag split screen and the like—and if this is Duchovny’s big-screen crossover, they’re gonna have to do better than only two gratuitous shower scenes (chest only), one gratuitous swimming scene, and no butt.CP