The set-up is classic “X-Files.” A top-secret location. The corpse of a victim snuffed out under mysterious circumstances. A shady official managing the situation. FBI agents Fox Mulder and Dana Scully trying to uncover the truth.

David Duchovny and Gillian Anderson have played scenes like this over a hundred times before. It should be a cakewalk. But on this August afternoon on a Vancouver soundstage, nothing’s going right. The actors are tripping over their lines. They can’t hear writer-director James Wong’s cues through the walls of the set from his perch behind the monitor. Anderson feels the blocking is off. And then a small piece of the set — the inner sanctum of a tech company’s private server — comes crashing down.

“The servers must be scrambling our brains,” Anderson jokes as she steps away to her chair.

If this were the first week of shooting on Fox’s heavily hyped revival of the iconic TV franchise, there might be cause for concern. But it’s the penultimate day of filming on the fifth of a six-episode “event series” order, and any nerves over getting the band back together have long since faded.

Jason Madara for Variety

“We’re probably a little slower than we were, but we’re just trying to get it right,” Duchovny says after they’ve wrapped the scene and everyone breaks for lunch. “If there are only six (episodes), you can focus on those six, as opposed to trying to get 24 right.”

Fourteen years have passed since Mulder and Scully were last on the small screen, and during that time, the business of television has been rocked by seismic shifts, including the way ratings are measured and the number of episodes networks order. Without those changes, “The X-Files” may not have come back at all.

The question for Fox is whether the audience, as Mulder might say, is still out there. And whether all the work it has taken to reopen “The X-Files” will prove worth the effort.

For a while, it looked like “The X-Files” was finished. A 2008 feature — “The X-Files: I Want to Believe” — bombed at the box office and was blasted by critics. Creator Chris Carter wrote a third screenplay that went nowhere, and all the key players moved on to other projects.

The revival seeds were planted in 2013, the 20th anniversary of the show’s original run on Fox, when a flurry of celebratory events kicked off at San Diego Comic-Con with an epic reunion panel featuring Duchovny, Anderson, Carter and several heavyweight alumni from the writing staff, including Vince Gilligan and Howard Gordon.

At the time, Anderson firmly shot down the idea of resurrecting the series in any form on the small screen. But informal discussions were already under way behind the scenes between Carter and 20th Century Fox Television. Studio chair Dana Walden, who assumed stewardship of the network alongside Gary Newman in 2014, remembers meeting with Carter for a “social friendly lunch” before the Comic-Con event.

“Kevin Reilly, when he was working at Fox, and Gary and I had talked about (reviving ‘X-Files’), and how great it would be. We all decided that it was time, and we should try to make it happen if Chris had any interest,” Walden says. “And then, after what seemed like forever, the pieces came together.”

It doesn’t take a conspiracy theorist to figure out why Fox was keen on the idea. Nearly 20 million viewers watched the show during its season-five peak. Almost 30 million watched the season premiere. A theatrical film bridging the gap between seasons five and six opened in summer 1998 and grossed $189 million worldwide. More than that, the show was a full-blown cultural phenomenon.

One of the reasons we’re back is because the show had a range of things that it did well.”

CHRIS CARTER

Jason Madara for Variety

Walden worked on the series’ launch in her early days at the studio’s publicity department, and knew that securing the creator and two stars was essential. While she “wouldn’t 100% rule out” a take on the show without Mulder and Scully at some point in the future, there was no interest in going that route now.

“It would just be very hard to take any one of those elements out in a cavalier way and imagine you’d have a successful show,” she says. “Or something that felt as special.”

Carter, who was hard at work on the never-aired series “The After” for Amazon, was willing to balance both projects, but he, too, wouldn’t move forward without his leads. “I thought it was just talk,” Carter recalls of the early discussions. “I never took it seriously until I got the phone call and it was pitched to me as the actors are interested in doing this.”

But that interest had its limits: The stars wanted to do only a certain number of episodes — far fewer than the standard 22, and closer to the 12-episode model Fox had greenlit for “24: Live Another Day.”

Anderson explains that the reluctance she expressed at Comic-Con had nothing to do with reprising her Emmy-winning role as Dana Scully, and everything to do with committing to the grueling schedule of traditional network television. Having just completed the five-episode first season of BBC’s crime drama “The Fall” in her adopted U.K. homeland, she understood the creative value of a short run.

“It was only at the point that we were having conversations about six or eight (episodes of ‘X-Files’) that I would even, or could even, consider it,” she says. “I don’t think it took that much convincing once that became a reality.”

Duchovny, who was ending a seven-season stint on Showtime’s “Californication” and would soon begin shopping the period thriller “Aquarius” (which landed as an event series of its own at NBC), had burned out on the 22-episode model, and similarly needed a short run. “There were so many moving parts to get this thing together,” he says. “By the time we did, it was late. That’s the only reason I think we’re doing six. I think we would’ve preferred to do eight or 10, but we all have other things (on our schedules).”

During the time it took to nail down the actors, Amazon had nixed “The After.” “We had a difference of opinion about the direction of the show,” Carter says. “I understand what their fear was. It was a huge outlay of money. There was a split on what direction the show should take.” That meant Carter could focus all of his attention on “The X-Files.” By March of last year, the announcement was official. He would write and direct three of the new episodes (including the premiere and finale), while fan favorite veterans Glen Morgan, Darin Morgan and Wong would each write and direct a single standalone installment.

The Crucible of doing the show made monsters out of both of us. … The way we work together has changed.”

DAVID DUCHOVNY

Jason Madara for Variety

Handing each veteran his own hour to play with preserves a key aspect of the series that made it such a sensation: unpredictability. No other TV show has pivoted so effortlessly among bone-chilling horror, freaky science fiction, sharp-edged satire, downright loopy comedy and nail-biting thrills.

“One of the reasons we’re back is because the show had a range of things that it did well,” Carter says in his typically understated fashion.

And although “The X-Files” was often credited with a cinematic style of filmmaking and storytelling (looking back, it feels like a necessary stepping stone between “Twin Peaks” and “The Sopranos” on the way to ushering in TV’s current golden age), its strongest qualities were always unique to television.

That was confirmed by the cautionary tale of “I Want to Believe.” Carter and Duchovny maintain the lower-budgeted effort was unfairly sent out to battle against flashier summer releases, though Anderson admits it “wasn’t well received” and says she remembers little about it now. “I think we learned what works on the big screen with ‘The X-Files,’ ” Carter allows, “and we learned that with the first movie.”

A single film can’t recapture everything that made the show compelling, but a limited series might do the trick. “I think it’s a nice mix,” Duchovny says of the new installments. “We do have a funny one, a horror one, a gross, nasty one and three that are extending and elaborating and negating in some ways the old mythology. A lot is done in six episodes.”

Carter insists he didn’t want the revival to feel like a “victory lap,” and the new episodes promise to fall in line with “The X-Files” of old. Mulder and Scully are estranged, but quickly fall back into their familiar rhythms when a loudmouth conspiracy theorist TV host (Joel McHale) tips them off to the case of a possible UFO abductee (Annet Mahendru).

Their former boss, Walter Skinner (Mitch Pileggi), is still with the FBI, and an arch rival, the otherwise unnamed Smoking Man (William B. Davis), is in hiding after cheating death in the series finale. The visual effects are updated — look for a jaw-dropping UFO crash and a vivid re-creation of an extraterrestrial encounter at Roswell in the premiere — and there are smartphones, drones and social media. But there’s nothing that will feel out of place to the fans who fell in love with the pilot back in 1993.

It’s very much in line with the pop culture zeitgeist — super-serving the nostalgic while forging a new path forward. From the box office successes of “Star Wars: The Force Awakens,” “Jurassic World” and “Creed” to the excitement over Netflix’s “Arrested Development,” “Wet Hot American Summer: First Day of Camp” and upcoming “Fuller House,” the takeaway seems to be: Respect the fans and they’ll respect you back.

“Something I’ve come to realize is that even though there was a degree of expectation that we would create something that was as revolutionary as we did back then, that’s not necessarily what people are expecting or wanting,” Anderson says. “They’re wanting what they had before. That’s more of what the commitment should be focused on. It is about re-creating what the audience really wants, rather than trying to fix what isn’t broken.”

At the core is the complicated relationship between Mulder and Scully — a delicate dance that blurs the lines between professional friction, romantic flirtation and mutual respect.

“The only thing I was worried about (with the revival) was how it would feel for David and Gillian to be back in those same roles that they had spent a long time working on together,” Wong says of returning to the show that launched his career (which now includes an executive producer role on FX’s “American Horror Story”). “And what that meant in terms of who they are now as Mulder and Scully.”

Our relationship has become a proper friendship over the last few years. I think we’re more on each other’s side.”

GILLIAN ANDERSON

Jason Madara for Variety

Although Wong’s episode was the fifth shot, it will air as the event series’ second installment, and deals with the mystery surrounding William, the child Mulder and Scully put up for adoption. When the series picks up, the two agents are living separate lives, but their relationship status is guaranteed to veer toward “it’s complicated” as they grapple with getting older and assessing their life choices.

In public appearances, Duchovny and Anderson get a kick out of teasing interest in Mulder and Scully’s rocky romance. When a fan at Comic-Con asked what the characters would do on a date, Anderson answered, “Have sex.” That same effortless rapport is evident during filming, as they playfully rib each other and crack jokes between, and often during, takes.

Back on set, Anderson is vamping with the small child who plays William in a dialogue-free dream sequence. She’s far more maternal than Scully, who never got to raise her son. (Anderson has three kids, and her first, born during the series’ original run, took a work-experience job in the revival’s art department.) At the monitor, Wong frets that the tyke won’t do what’s scripted. But Anderson gently nudges him toward the necessary props.

“David and Gillian know the characters so well it’s almost like intruding on the process, but they don’t make you feel that way at all,” Wong says.

Duchovny and Anderson weren’t always so easygoing on set, and they presented about as far from a united front as two co-leads could. “The crucible of doing that show made monsters out of both of us,” Duchovny admits, but says that reuniting on “I Want to Believe” changed things for the better. “Once we got to step back, it was like, ‘Oh, wow, we really like each other. I didn’t know that was going to happen.’

“The way we work together has changed,” he adds. “Whatever rapport we have as actors, we earned. It’s nice to be able to play that without ever even feeling like you’re playing it.”

Anderson agrees. “Our relationship has definitely become a proper friendship over the last few years. I think we’re more on each other’s side. We’re more aware of the other’s needs, wants, concerns, and mindful to take those into consideration— and just sharing more about our experiences in the moment, under the sudden realization that we’re both in this together, and wouldn’t it be nice if it were a collaboration?”

Now it’s Fox’s job to make sure that both believers and skeptics check out what’s new with the pair. Even in its post-Duchovny final-season nadir in “2001-02, “X-Files” averaged more than 9 million viewers, a number that would eclipse all scripted shows save “Empire” on Fox today.

Then again, “The X-Files” was already off the air before time-shifting, DVRs, VOD and digital outlets permanently altered the way an entire generation consumes television. No one knows if fans will opt to stockpile the new episodes for a binge, or flock to them live every week.

“It’s so mysterious now with these nonlinear ratings,” Carter says. “I don’t know quite what to make of it all. I think a lot of it is smoke and mirrors.” But he’s impressed with Fox’s promotional efforts, and sees a substantial difference from

the way the last feature was treated. “I have to say they’re marketing the show beautifully. I don’t think there’s anybody out there who doesn’t know the show is coming back.”

In addition to scheduling the premiere in the coveted timeslot following its NFL conference championship game on Jan. 24, the network held advance screenings at Mipcom and New York Comic-Con, to build buzz months ahead of the debut.

Walden emphasizes that Fox wins no matter when viewers tune in — as long as they do. “The good news for us is that we own the show,” she says. “I think we’ll see a great turnout within a seven-day window. But if viewers watch it beyond that, on whatever platform it’s available, that’s all good news.”

She’s also ready for more, regardless of ratings. “We would commit to new episodes right now, today, in advance of our launch. We are excited creatively by what we’ve seen. These episodes are incredibly consistent with the original series.”

The catch, once again, is scheduling. Duchovny is shooting season two of “Aquarius,” while Anderson is back at work on season three of “The Fall” before heading to Broadway in the spring for “A Streetcar Named Desire.”

“Gillian and I have talked about (doing more episodes), and then we just stop because we get to 2023 and we still haven’t found a date we can do it,” Duchovny says. “It’s like, ‘Let’s just wait and see what happens after this,’ and then we can start to talk seriously about whether we can make it work again.”

Last week, reviews of the first episode appeared on the same day as the show’s glitzy L.A. premiere. To Carter’s surprise, the response was tepid. “What seemed to be under review was the fact that we were coming back at all,” he says. “They were reviews of our intentions rather than reviews of the show itself.”

But there are still five episodes to go, and he hopes critics will reassess when they’ve seen them all. (Fox subsequently made two more episodes available to the press.) “The only reason for me to come back was to do great work,” Carter says. “This was not an exercise in nostalgia.”