M. Night Shyamalan is making his TV debut with “Wayward Pines,” a 10-episode events series that premieres Thursday night on Fox. The mystery miniseries, which has inspired comparisons to “Twin Peaks,” Shyamalan’s own “The Village” and more, follows an FBI agent, played by Matt Dillon, who heads to an odd Idaho town in search of two of his fellow agents who have gone missing. Once he’s there, however, he learns he may never leave alive.

The show brings to life the books by Blake Crouch, adapted for television by showrunner-executive producer Chad Hodge. Shyamalan serves as exec producer and directed the first episode. Along with Dillon, the cast includes Melissa Leo, Terrence Howard, Carla Gugino, Shannyn Sossamon, Toby Jones, Reed Diamond, Tim Griffin, Charlie Tahan, Juliette Lewis and Hope Davis.

Ahead of the thriller’s premiere, Hodge spoke to Variety about adapting the series, the all-star cast and landing Shyamalan for the director’s first television project.

The first two episodes really reminded me of “Twin Peaks” and “Twilight Zone.” Were those some of your inspirations?
You know, not really. I think the main inspiration, for me, going into it, was the first book. I sort of took all the cues, in terms of taking cues from anything other than my own brain, from the book. It wasn’t sort of me thinking, “Oh, I could, this could be a little like ‘Twin Peaks’ or ‘Twilight Zone’ or ‘The Prisoner’” — I’ve heard a few different things. And I’m flattered by all of those comparisons, but really the inspiration for me was really Crouch’s book.

What was it about the book that made you think it would translate to TV?
Well, I got the first book before it was published — maybe two, three months before — from a producer and read the book in one day and completely flipped out. I turned those pages as fast as I could and immediately knew that I had to turn it into a show. I was so grabbed by the single-player storytelling, I kind of like to call it. You’re really with Matt Dillion’s character, Ethan, and you’re feeling the experience of coming into this town with him and you’re kind of really in his head. People stare at him as he interacts with this crazy nurse and this crazy sheriff — why isn’t anybody talking to him? So it’s really almost like you’re in his head and I felt the same way when I was reading the book.

I feel like Ethan’s head isn’t a great place to be – they brought up the fact that he might have some brain injuries, and suffered with mental illness in the past. How does that come into play?
That’s definitely part of it. He has a backstory that gets revealed over the course of the 10 episodes that you realize what happened to him and, is this something that happened to his head or not? That definitely plays into it, for sure. But I think that you’ll see pretty quickly that we’re not trying to pull the wool over anyone’s eyes and this isn’t a kind of twist like, you know, “Oh, they’re all dead.”

Actually, when I sent the script to M. Night Shyamalan, I expected him to take four weeks or something to read it. I thought, “Well, we’ll have to wait awhile, this guy’s never done television, he’s probably not going to do this. Wouldn’t it be amazing if he did?” And he read the script in one night and called me the next day and said, “As long as everybody isn’t dead, I’m in.”

This is a big deal for M. Night Shyamalan – like you said, it’s his first television project. What do you think it was that made him want to come on board?
Well, I think what made him come on board was the script in the first place. He really liked the tone and the tension and the storytelling. What I really love about this show is that it does start pretty small. It’s this one guy coming into a town and it gets bigger and bigger and bigger as the episodes go on into a very, very big place, ultimately. But it starts small, and I think that’s what he was attracted to and I think he also really appreciated the dark humor that’s in it. You know, the sort of wink-y, funny, little inch-off-the-ground tone that it has. He’s so good at establishing a tone. I think he responded to that in the script. It’s very scary and thrilling and page turner-y, hopefully.

Speaking of the tone, the town itself has a pretty interesting one – I can see where it would be warm and welcoming, but it’s also super creepy. How did you pull that off?
Creating the town was one of the most interesting things and one of the most challenging things we did. What you’ll see as the show goes forward is there a person, there is a character in this story who built this town. It’s someone that you’ve met already in the first episode – I’m not going to tell you who. But, point being, within the story of Wayward Pines is the story of when this place was built and who built it and how they designed it. So, as we were designing the town with our brilliant production designer Curt Beech, we had to essentially put ourselves in the shoes of the character who, once upon a time, built this town within the context of our story.

But it’s not just the town – we have Teresa and Ben, Ethan’s wife and son, on the outside. How big of an impact are they going to have?
They’re going to have a big impact, you will see. Visually we were also very conscious in the difference in looks between Wayward Pines and outside Wayward Pines. So when you’re inside Wayward Pines, it’s a certain color palette. When you’re outside Wayward Pines, it’s a different palette. It’s a little bit cooler and blue and grey and that kind of thing. And you might notice that in almost any scene that takes place outside of Wayward Pines, there are lots of people around. It looks like you’re in a big city. You’re definitely not in Wayward Pines, is the point.

You’ve got this really great cast – Juliette Lewis, Terence Howard, Carla Gugino, etc. How did this cast come together?
We sold it to Fox as a 10-episode, straight-to-series commitment, really designed to be this one season. And so that’s one of the main reasons we were able to get Matt Dillon because to get a bigger star from the world of film, sometimes it’s easier to get them to do something like this when they are only signing on for one year. So that’s how we got Matt, and then once we cast Matt, I think that was sort of our signal to the community that loved what we were trying to do, in terms of the caliber of talent. So very quickly, the rest of the cast fell into place. I think the second person to come in was Melissa Leo as Nurse Pam, and then Terence Howard and then Carla and then Juliette and it just all came together very quickly. Them knowing that they weren’t just doing a pilot, they were doing something that was actually going to happen, 10 episodes, I think there were a lot of reasons for them to do it. So I was very lucky and very in awe of the cast that I have.

Why do you think this works better as a 10-episode event, rather than a longer series?
I always envisioned it really as a limited run thing, because it was based on these books and I knew that the reveal of what Wayward Pines comes at the end of the first of three books, and so that was going to be something that was going to happen relatively soon in the series. I was interested in sort of telling the story in the way that the author told it and that lent itself to a more compact event series.

And also, I think people like watching TV like that these days. They like things that are a shorter commitment, they can binge-watch the whole thing, they can watch it live and participate in the social discussion of it. But we all have less and less time, it seems. As TV lover, things that are limited series, I’m more willing to engage with them and commit to them because I know I’m going to get answers and reveals and be on the edge of my seat and then 10 episodes later, I’ll feel like there was a beginning, middle and an end. And then, should it do so well that, you know, Fox wants to do a second season, there’s absolutely an opening for that, storytelling wise.

Why was Fox the right place for this? Why not AMC, FX or any of the cable networks?
I mean, I don’t think this would not have been something that would work at others places, but the reason we sold it to Fox is because — and we had other offers, actually all of the cable places — but the passion that Fox showed for the show and the commitment they were willing to make to it made us all look at each other and go, “Well this is great.” Like, we were setting out to make a cable show, like a 10-episode thing, and we never thought that a network would do that. It was almost three years ago when I sold it. The event series thing was certainly not a big thing yet then. And so, Kevin Reilly, who was the president of Fox then, had just started an event series department and we were, basically, I think the first thing that he bought. He made the commitment to make the entire series, 10 episodes. He supported it creatively 110%. I fully had the support of the studio and the network the entire time. They were just such great partners. So, for me, it was about the passion that Kevin had for it and the resources he gave us to make the show we wanted to make.

I know you’re working on another project with Blake Crouch, “Abandon,” for Amblin TV. Can you tell me a little bit about that?
Blake and I did not know each other at all before “Wayward Pines.” I mean, I was given his book by a producer and we didn’t speak very much at the beginning. Sometimes authors don’t really want to talk to the adapter or the adapter is afraid the author isn’t going to like what they do if they change anything and all that, so that’s usually not a warm and fuzzy relationship. But I guess Blake really liked what I did with the pilot and then we ended up really realizing how much we got along and how much we approached writing similarly in storytelling. And in his deal for “Wayward Pines,” Blake is a consulting producer on the show and he got in his deal that he would write one episode of the show. And back then, I was like, “Oh great, the author’s going to write an episode of the show, he’s never written an episode of television before, it’s going to be terrible and I’m going to have to rewrite the whole thing.” And he did an unbelievable job.

I couldn’t believe how well he adapted his own material and in the format of a television script, so it was kind of great. And then I said, “Great, do you want to write two more episodes?” And he did with me. So we had a great time working on the show together, and sort of when it all was winding down, we looked at each other and said, “Let’s do something else together. What else do you have?” And so I read this book “Abandon,” which is so cool, and it’s about an abandoned mining town in Colorado that, in 1893 on Christmas Day, every single person in the town vanished and nobody knows why. So the story begins in present day, where you have a group of scientists who are going to sort of figure out what happened in 1893 on that day and it goes back and forth in time between 1893 and today, the present day. We sort of watch each storyline unfold next to each other and it’s really fun and really scary.