SPOILER ALERT: Do not read if you have not yet watched “The Riddle of the Sphinx,” the fourth episode of the second season of “Westworld.”

As co-showrunner on the western thriller epic she also co-created with her husband Jonathan Nolan, Lisa Joy says there are parts of herself in every episode of “Westworld.” But she left her mark on the fourth episode of the second season, entitled “The Riddle of the Sphinx,” in a new way, stepping behind the camera to direct for the first time.

“I really wanted to play with different genres in this episode,” Joy tells Variety.

In the early scenes with James Delos (Peter Mullan) in his seemingly modern apartment, Joy was going for a “2001: A Space Odyssey” vibe — “this mysterious, futuristic environment that you feel somewhat displaced in,” she shares. But later on when Delos has had his own awakening and has “gone insane,” she took the same location and bathed it in red light for a completely new feeling.

“I wanted to take the same room that had been so sterile and antiseptic and safe and make it into this horror film,” Joy says. “I looked at a lot of Tarkovsky films just in terms of how much set decoration and the slow movement of the camera could lead to a suspenseful theme — and the way the music interacts with things — to give a real sense of foreboding and horror while keeping it grounded in something emotional and real.”

Of course, Joy wanted to play in the show’s more traditional western genre, too — and she got her opportunity with William aka the Man in Black (Ed Harris).

“When the Man in Black is on the road, I wanted to make sure we were getting as much scope there as we could,” Joy says.

And when he was in a fight — a gun battle the show had shown him engage in before “in that very scene, sitting in that very chair, seeing how his quote-unquote loop within the game plays out and how easy it was for him to kind of cavalierly shoot a bunch of people,” Joy points out — she had an opportunity to depict the increased stakes of the western world.

“The whole place is this wild jungle where nothing is predetermined, and so for that in the gun battle, I didn’t want it to be easy, and I wanted us to feel that uncertainty and have it feel very visceral and immediate,” Joy says, adding she included a couple of Steadicam shots to keep the audience in the middle of the action, “literally over the man’s shoulder feeling the bullets whizzing by.”

Although Joy didn’t pen this particular script — those credits belong to Gina Atwater and Nolan — she says she was “creatively drawn to it” because she has wanted to look a little closer at William (played by Jimmi Simpson in the earlier timelines and Harris in present day) since the beginning of the show.

“In the first season he was the absolute villain and we painted that in a very stark light,” Joy says. “This season we’re playing with perception and loyalty — what happens to your perceived victim when the shoe is on the other foot? Is there any moment at which they cross a line and you lose sympathy for them? And what happens when you look at a villain and you keep looking closer and closer and closer at him, do you ever see any glimmers of light, any other sides to their character?”

“The Riddle of the Sphinx” dove into William’s backstory to connect some dots between the man he was when he first stepped foot in the park to the man he became.

Sitting with Delos, William shared a few nuggets of information about his family as time went on. But he also showed great patience and care for the experiment he was running to keep Delos alive as an android, testing out the capabilities of such artificial intelligence through simple discussions. As the episode revealed, William returned to Delos time and again, with many years in between, to play the control in Delos’ loop.

“By the time you see the second version of it, I think it starts to feel inevitable that you’re going to see something else happen,” Joy says. “I like playing with the inevitability of that and building the suspense — you can’t wait for the other shoe to drop to see how, when Ed comes in to play it, he’s going to play it differently. Part of the fun for me was the repetition in dialogue and even in the chair that they take [but] you get to see two actors look at characters from three different timelines and even though they’re saying very similar things and sitting in the same position, it’s the tiny gestures in performance — the tiny deviations in what they’re saying — that betray how their character is evolving over time.”

The episode also introduced William’s daughter as an adult who found her way into the theme park herself.

Joy chose to shoot her backlit by the sun so that she was shrouded in darkness as she had been shrouded in mystery since earlier references to and quick glimpse of her character. It was all about adding to the suspense.

“The man is rushing toward the horizon and he’s chasing his own demons in some ways, and then you see this figure and you can’t make out who they are. I wanted to be really ambiguous at first with whether it’s a man, whether it’s a woman, and that went into our costume choices even at the beginning of the season,” Joy explains.

William was far from the only character with whom Joy got to dive deeper, though. In addition to shooting the reveal of Elsie’s (Shannon Woodward) whereabouts, she explored the inner workings of Bernard’s (Jeffrey Wright) broken mind as his memories came to him in fragmented, non-linear pieces.

“It’s sort of like how Dolores had trouble sorting her [memories] in the first season so the interesting thing, for me, was to incorporate some visual tricks that would help mimic his condition with memory,” Joy says. “What I loved was the idea of having these macro shots where tiny flickers of memory were coming back to him — eyeballs were falling on the ground, why? The sound, the distortion, and not knowing what it connects to. And then of course he finds this lab and he’s wandering through it as he’s also trying to wander through his own mind and piece together what he saw.”

Joy calls the sequence in which Bernard observed his own memories play out in three-dimensions in front of him in the lab his “out of body experience.” Although she shares she worked very closely with Wright as well as her camera team on the day of shooting to capture the “uncanny” feeling of floating outside of one’s self, when she got into editing, she used music as a way to make it even more jarring for the audience.

“I wanted to feel a little bit like we were crawling outside of our skin,” she says.

Bernard watched the faceless androids commit acts of violence against the humans working in the lab and then against themselves, all from the center of a “giant room,” Joy points out. She wanted slow-motion shots to really capture the sense of him trying to take everything in and make sense of it. She also wanted his turns to see different memories on different sides of the room to be equally slow and methodical — and “like he was on a merry-go-round.”

“It’s this idea of loops that I tried to thread throughout the episode,” she says. “From the opening shot, Delos is in his own loop to the shot here where now we’re with Bernard and he’s turning around and taking in this room in this circular motion, but it’s almost like he’s a passenger in his own memory. And then he finally stops and realizes, with some horror, that he wasn’t just entirely passive, taking it in — that he actually had a decidedly active move in the violence that occurred there. So I wanted that step to feel like the loop is being broken — you weren’t just riding this wave, you were an active participant, so now reevaluate your own character, Bernard.”

The parallels between Delos’ loop and Bernard’s were ones that Joy further fleshed out with her use of mirrors throughout the episode, culminating in the moment the two men were in the same room.

“It wasn’t originally scripted for it to be this tender, almost emotional character moment between the two men, but as we were playing with the scene, I realized that there’s this really poetic intimacy to it,” Joy says. “Delos looking at Bernard and Bernard looking back at Delos, they’re looking at mirror images of each other — the devils and the angels that reside within both of them and the ways in which the path, depending on which steps you take, can indicate who in the final tally of your life you become.”

Joy shares that when she and Wright were working out his inner dilemma within the episode, they talked about how he has played Arnold and how he plays Bernard but maybe there’s “another persona he could be — someone heroic who’s trying to be born.” Joy notes that Bernard wants to be moral and good and he made such a plea to Elsie with sincerity, but after understanding what he did in the past, he will oscillate “between his ideals for who he should be and what he should do and who he’s been and the way he’s been controlled” and these inner conflicts will be “constant bursts of tension for him throughout the season.”

But while Bernard, like Dolores (Evan Rachel Wood) and Maeve (Thandie Newton), is trying to take control of his own life, Joy acknowledges that not all of the hosts can — or want to.

“They’re used to the way their lives were. They have a loop that some of them haven’t even begun to question, even though they could. And some of them understand that there were puppeteers controlling them — but just understanding the constraints of your life doesn’t mean you’re willing to break out of them,” Joy points out. “To me, there’s something very relatable to that, even for humans. How many of us have these demons or habits or things we don’t like about ourselves and understand the loops that we’re in and yet are unable to break out of them and create lasting change within ourselves? We can understand both our nature and our nurture, but understanding is only the first step.”

While the character work alone was enough to set Joy’s episode apart, she also had the privilege of being the first director to incorporate rain on the show — something she feels was really important to further set the tone for how unknown things still are for the characters.

“Just the idea that nature would intrude itself and that tempestuous storm — I think it gave a feeling of the chaos that was unleashed in the park, the wildness, and the idea that maybe there are forces here beyond our control for the humans and the hosts,” she says.