My day job, in lieu of teaching creative writing like a normal person, is writing scripts for blockbuster video games. Last summer, while I watched a play-through of the then-unreleased Gears of War 4, for which I was the lead writer, something odd happened. The game’s story called for a massive plane crash, out of which a single robot, operatically aflame, was intended to stride toward the player. Within the game’s fiction, robots have hitherto opposed the player, but we wanted this particular burning robot to pose no immediate threat.

The game programmers had thus switched off the hostility driven by the robot’s artificial intelligence, allowing the player to walk past the hapless robot or shoot it. Most of us on the development team, I think, hoped our game’s future players wouldn’t shoot. Just ahead of the encounter we placed what is referred to, in game design, as a frontgate—a kind of contrived environmental blockage intended to prevent players from rushing too far ahead, which can mess up loading times. In this case, our frontgate was some airplane wreckage, which has to be lifted by two characters. Typically, once the player gets into position, his or her accompanying squad-mate, controlled either by another human player or a non-player programmed to be an ally, joins and helps lift the wreckage out of the way.

On this afternoon, however, to everyone’s shock, the burning robot joined in and aided the player in clearing the wreckage—at which point I decided that our burning robot had at least earned the dignity of a proper name. I called him Bernie. Nothing in Bernie’s (quite primitive) A.I. brain, as written by our coders, was telling him to help the player; we later deduced that his behavior had something to do with the deactivation of his anti-player hostility, which might have tricked him into thinking he was part of the player’s squad. Alas, the bug was fixed, but I have not been able to walk past Bernie, in my many dozens of play-throughs since, without regarding him as a figure of immense and complicated pathos.

Lisa Joy, the executive producer and co-creator of HBO’s hit “Westworld” reboot, responded with instant, hand-over-heart empathy when I described to her the tragic helpfulness of Bernie the burning robot. “That is so sad,” she said. “The Good Samaritan robot!” Joy, visibly pregnant with her second child, was driving us around the “Westworld” set, a place called Melody Ranch, about thirty miles north of downtown Los Angeles. “I’ve always had a problem with over-identification with inanimate objects,” she said. As a girl, for instance, she couldn’t eat Gummi Bears. “They’re cute. They’re also delicious.”

“That’s a tragic combination,” Jonathan Nolan, Joy’s husband and, now, collaborator, said from the back of our golf cart. With his director brother, Christopher, Nolan has worked on or scripted several high-minded specimens of pop cinema, among them “Memento,” the “Dark Knight” Batman films, and “Interstellar,” while Joy has written for shows such as “Pushing Daisies” and “Burn Notice.”

“I had a Gummi Bear sanctuary,” Joy went on. “I’d put them in this little chest that I had of precious things, these moldering Gummi Bears, that I’d keep by my window.” On a particularly hot day, Joy opened her chest to discover that her beloved Gummis had melted into a giant versicolor orb. “It looked like soap.” She still remembers feeling “really sorry that I hadn’t taken better care of them.”

The proper treatment of inanimate objects is one of the core themes of Joy and Nolan’s “Westworld,” which recently finished its ten-episode début season. As just about anyone interested in television is now well aware, “Westworld” is a show about a futuristic theme park in which highly convincing humanoid robots, called “hosts,” are forced into a purgatorial simulacrum of the Old West for wealthy visitors, called “guests,” who are encouraged to murder and molest the hosts as they see fit. Much of “Westworld” is filmed in the dusty confines of Melody Ranch, which was established in 1915, making it one of the oldest studios in the world. It provided the backdrop for numerous episodes of “Gunsmoke,” “The Adventures of Rin Tin Tin,” and “The Lone Ranger.” For many years, Gene Autry owned the venue, which was burned to the ground by a wildfire in 1962. In recent years, Quentin Tarantino shot portions of “Django Unchained” in the town saloon, and the set’s rows of bespoke little buildings were transformed into the eponymous town of a show now doomed to be regarded by many as HBO’s second-greatest western. “A lot of these were built for [David] Milch on ‘Deadwood,’ ” Nolan said, gesturing at some pre-fab production huts. We were driving through Deadwood, past the ghosts of Tonto and the Magnificent Seven, on our way to Westworld, an Old West town intended to function as a neverland fantasy of the frontier—a town calculatedly built to look like it had been calculatedly built. The degree of meta-ness, Nolan admitted, was “getting pretty heady.”

Any active film studio, a mixture of the bracingly convincing and patently false, is itself a sort of theme park, and Nolan reminded me of Orson Welles’s maxim that Hollywood filmmaking is “the biggest electric-train set a boy ever had.” But when J. J. Abrams first presented Nolan with the tantalizing train set of “Westworld,” a few years ago, Nolan wasn’t interested. He was fondly disposed toward Michael Crichton’s original 1973 film, which Abrams’s production company thought was ripe for a reboot, but, he said, “I couldn’t quite wrap my head around what it would be.”

The pitch immediately appealed to Joy, though, who hadn’t seen the original film. She told me, “When I heard, ‘Western robot theme park. Do it as a TV show. Think about the lives of the robots’—”

“Which was J. J.’s suggestion,” Nolan said quickly.

“—It suddenly just, once that thought had been triggered, I just wanted to play with it.”

Joy had long viewed even the Western’s most heralded examples with a kind of aesthetic and emotional remove. “I do love Westerns,” she said. “But, in a way, traditional Westerns, for me, have been hard to love viscerally and personally. You tend to gravitate toward stories in which you see yourself. I don’t see much of myself in the traditional Western hero.” As the first-generation American daughter of a British father and a Taiwanese mother, Joy found herself thinking about the Westerns she’d seen. “I would sometimes look at the side characters in those movies, hanging out by the saloon doors, or crossing the street, or working on a railroad, and think, Well, actually, that’s kind of more like who I would have been in the Old West. I wonder what their story is. To do it together in this show allowed us to explore all those stories. . . . That was irresistible to me.”

Nolan, in turn, who’d played a lot of video games before the birth of the couple’s first child, began thinking about the disruptive narrative freedom provided by open-world titles such as Grand Theft Auto, Red Dead Redemption, and Skyrim, which Crichton’s film seems to have anticipated without knowing exactly what it was anticipating. (Another thing that Crichton anticipated: computer viruses. The film version of “Westworld” was one of the very first pieces of fiction to conceptualize one computer’s problem affecting another as a form of contagion.) In the show, day after day, Westworld’s hosts wander in preordained narrative “loops,” which the park’s guests are free to unsettle, join, or terminate at their leisure. Joy told me that the moment they began pondering what a revamped “Westworld” could do, “I just couldn’t get it out of my head. It seemed to be at the nexus of a bunch of ideas that we were interested in.” Nolan agreed: “We got stuck in a loop—our own loop—so we called J. J. back.”