SPOILER ALERT: Do not read if you have not yet watched “Maniac,” streaming now on Netflix.

Although writer Patrick Somerville took some inspiration from the 2014 Norwegian series of the same name, he knew pretty early on that he didn’t want to set his version of “Maniac” in a mental institution, too.

“Cary [Fukanaga] and I wanted to come from a place of sensitivity and compassion for mental illness, and we just didn’t see a way to do that with the set up of a mental institution,” Somerville tells Variety.

Jonah Hill’s character, Owen, is schizophrenic, and Somerville says that he was drawn to the more subtle things that can happen to people who are diagnosed as adults.

“There’s this thing that happens where when somebody becomes ‘other’ — the rest of the people in the family can’t love him [or] her properly anymore,” Somerville says. “It’s like a slow letting go of love and support, and it’s somewhat not intentional, but every person who’s involved in it has a different relationship with it. All of that was really fascinating to me in telling Owen’s story and in trying to tell a story that people with mental illness would respond to.”

Drawing from experiences with his wife, who is a psychotherapist, and his father, who is a neurologist, Somerville saw the world of pharmaceutical testing as a good place to deal with the question of “what is real?” that plagues Owen, who often sees his brother (Billy Magnussen) when he’s not really there, but to also question “what is therapy [and] what is healing?”

The setup of pharmaceutical testing, Somerville says, made that all feel more “present and available.”

The trial is one that forces its participants to relive their worst moment but, if successful, will put them through simulations that help them heal. Owen enters it while wrestling with familial pressure to cover for his brother, who’s been accused of abusing his power to have an employee perform sexual acts. (That storyline was conceived before the #MeToo movement, Somerville says, but was “adjusted” along the way.) Meanwhile, Annie (Emma Stone) is struggling to grieve the death of her sister (Julia Garner), and enters as a way to get access to a drug she’s become addicted to help her cope with her pain. 

“There’s a lot of things about grief and trauma that intersect — how just a horrible thing happening can blow up people’s connections to one another and connections to reality,” Somerville says.

Their shared familial pain was only one reason Owen and Annie were drawn to each other and connected in the sub-worlds within the testing, though. “The show is holding multiple theories at the same time,” says Somerville, as to why they keep entering each others’ subconscious. While there is a “very technical explanation that has to do with the machinery of the computer,” there is also a “cosmic explanation that has to do with things we don’t understand about human souls.”

And then there’s a “humanistic” reason as well. “Sometimes we run into people and we can just sense that our shared emotional histories are compatible — it just works,” he says. “I think we have an amazing ability to connect with other people’s identities, and I am most interested, by far — even though I love the other explanations — in the ways in which our emotional signatures are compatible with other people’s. I’m a romantic, I think, and it’s sort of about people’s histories and taking the time to see each other.”

For Somerville, the most exciting part of the show was challenging the idea of “normal,” not just for “everyone experiencing the show, not just the people in the experiment.”

That’s why he set the entire series in a world that was “a little bit unusual, relative to ours.” Various stages of the trial were represented through the visions the characters had during the testing — from a suburban relationship drama to a highly stylized sci-fi/fantasy world.

“‘Maniac’ is a MacGuffin-plus, in a way, because there are all of these other worlds and the characters are also trying to decode what’s going on with them,” Somerville says.

But regardless of how different each world would get, the underlying conflict for Owen and Annie remained. “They want something, but they’re learning along the way that what they want is more complicated than what they thought and how they can get it is more complicated, too,” Somerville says.

With each new world, such as Annie’s quest to deliver a lemur and a letter to a recently-deceased woman’s daughter, Owen and Annie are forced to face some of their own issues and inch toward healing.

“She’s so desperately trying to deliver and prove she’s a good person and by the end of the episode she’s sort of successful but,” Somerville says. “And that’s what’s true of all of them, that they’re successful but, and she realizes that by the way this has everything to do with a very difficult relationship you have with your sister and your mother. And it has nothing to do with lemurs.”

Both Owen and Annie are eventually forced to confront versions of their family members within the genre worlds and are given chances to make their peace with their pain. But it is not until the trial ends that its true success is revealed. After all, being back in the real world is the true test of whether or not everything they experienced in the trial actually healed them enough not to fall back into old patterns.

“I’m just really interested in warmth and finding ways to tell stories that have an authentic and earnest kind of warmth,” Somerville says. “As a writer, I think you have to show real kinds of pain and fresh looks at how people suffer [first]. I owe so much beforehand to be able to get to warmth like that, but I love it. I love that feeling, and I want to put that feeling into everything I write.”