When creating an original horror anthology series based on the world of Stephen King, “Castle Rock” co-creators and co-showrunners Sam Shaw and Dustin Thomason knew one thing was key: leaning into the psychological aspects of what scares a person.

“We live in what might be considered the era of terror. Questions of violence and chaos and fear are at the center of a lot of conversations that people are having all over the world,” Thomason tells Variety.

In populating their version of the titular fictional town that features prominently in King stories from “The Dead Zone” to “Cujo” and “Needful Things,” Shaw says he wanted to include people who may be traumatized from things in their past but “dig in their heels” and choose to stay in the environment anyway. “All unhappy families are unhappy in their own way, and all unhappy towns are unhappy in their own way,” he explains.

Shaw and Thomason were heavily inspired by King’s 1981 novel “Cujo,” which plays with the idea of whether something supernatural is in play, depending on interpretation of the reader.

“There’s this lineage between ‘The Dead Zone’ and ‘Cujo’ involving the house where the strangler lives and kills himself,” Shaw says. “There’s a way of reading ‘Cujo’ as a story about demonic possession and the soul of a dead strangler that you know terrorizes a family, and there’s another way of reading that story as…about population control of bats and rabies.”

King’s 1989 novel “The Dark Half,” in which the protagonist Alan Pangborn investigates a series of murders seemingly created by a writer’s pseudonym, also served as inspiration. In it, Pangborn chooses to bury the other-worldly parts of the story he uncovers, such as the fact that the writer had a parasitic twin who might be manifesting himself as a real person.

“Basically he’s, on some level, sweeping it under the rug, and [on another], I think, trying to protect the town from the horrors of what has happened,” Thomason says. “That, for us, was pretty interesting to think about. What would [it] be in a town where … you have access to the subjectivities of all of the characters’ [perspectives] … but not all of the characters actually know exactly what’s happening.”

Shaw and Thomason carried Pangborn over into their series, meeting him first as a young sheriff who gets caught up in the case of missing child Henry Deaver in the 1990s, and then following him decades later in a present-day storyline. He stayed in the town and was changed by it. That theme, producers say, is key for a number of characters.

“Stephen King loves a story about the traumas and fears of childhood casting a shadow over the experience of adulthood,” Shaw says.

The juxtaposition of the two time periods became important to the storytelling, as well, because the 1990s were a “nostalgic era” for the producers’ relationship with King.

“It was a time when some of [his] great, iconic novels had just been written or were just being written [and] a time when we were discovering those books and were scarred by them,” Shaw admits. “It felt apropos and interesting to check in with the town the last time we saw it and then yank the viewer into the present and a different vision of the town, a different vision of Alan Pangborn.”

The 1990s scenes were shot on film, while the rest of the show was shot digitally in order to capture the aesthetics of each sequence differently, which they further depicted through the use of seasons. The story set in the past is “almost entirely set in winter,” notes Shaw, with a “stark, cold” landscape. Then the present-day story falls into the “dog days end of summer descending into a New England fall [in which] the lawns go un-mowed and trash left on the highway median doesn’t get collected.”

Working with executive producer JJ Abrams and Bad Robot, Shaw and Thomason acknowledge that part of the format of “Castle Rock” is the “mystery box” method of storytelling, despite the fact that King novels usually imply their ending right from the start.

While they were conscious of answering some of the mysteries along the way so the audience feels gratified, there will also be bigger, broader questions that linger in a “why-done-it or what does it mean” way.

“New questions are implied by story choices,” Shaw says. “It was interesting for us to imagine how a story might reckon meta-genre questions about the town itself and what might be wrong with [it] than any single question about what happened to Henry or what the nature is of the kid who’s discovered under Shawshank prison.”

But what was most interesting for them, and what they hope the audience will most be enthralled by as well, was in the discoveries of how the various characters make sense out of what has befallen them and the town.

“Hopefully we can surprise the viewer just as Stephen King surprises us every time,” Thomason says.

“Castle Rock” premieres July 25 on Hulu.