There is tragedy in the Danish palace: the untimely deaths of the entire royal family, the king’s advisor and both of his children, and the prince’s friends Rosencrantz and Guildenstern. But for Ophelia, the advisor’s daughter, death is not the end, as she awakens in her bedchamber four days in the past. With the knowledge of what is to come, she attempts to avert this Shakespearean tragedy. Again and again and again.

This is Elsinore, a new video game released this year from a team led by American writer Katie Chironis. She has described it as Groundhog Day meets Hamlet, though, she noted: “If they’re under age 35, they give me this blank stare because they don’t know what Groundhog Day is.”

“I thought about what it would look like if we were to empower a player to step into the role of somebody in Hamlet and say, ‘Hey, you think that this situation could have been avoided easily? Go ahead and try, see what happens.’”

Time-loop narratives, in which characters are forced to knowingly relive the same period of time, are so strongly associated with this 1993 movie that the exhaustive pop culture website TV Tropes calls them “Groundhog Day Loops.” The team behind Elsinore pulled the trope from anime, where it has been popular since the 1980s. But in the six years it has taken to develop the game, time loops have come around again in the West: the 2014 movie Edge of Tomorrow, this year’s TV series Russian Doll, and video games — over and over.

Many games already contain loops of repeated failure, albeit ones in which only the player — not the character they may be playing — retains the knowledge necessary to break the cycle. And as academics have pointed out, time loops are often a problem-solving process, so it’s unsurprising they should find their way into video games. But why are time-loop games so popular right now?

Outer Wilds (2019), whose art director Wesley Martin also worked on Elsinore, began life as creative director Alex Beachum’s master’s thesis while he was at USC. He wanted to play with natural systems, and thought it would be more fun for players to experience them over and over again if time travel was part of the narrative. Over the next few years, his team built an entire solar system of planets that change over the course of 22 minutes — one collapsing into a black hole at its center, one filling another with sand — before the sun goes supernova. And his sister, Kelsey Beachum, helped write a story that encourages the player to explore that system.

In the upcoming game 12 Minutes, a thriller from the same publisher as Outer Wilds, the idea for the time loop also came first, before the story was developed. Director Luis Antonio wanted to explore causality, and said he made all the design choices accordingly, as if they weren’t really his choices at all. He shrunk the space and time so that players could understand how their actions interacted. To make them care, he made it intimate: in 12 Minutes, the player takes on the role of a man who knows that a cop will come to his home to accuse his pregnant wife of murder.

Elsinore, of course, already had a story. As a writing major, Chironis studied Shakespeare and tragedies in which characters try to make good choices to no avail. “I thought about what it would look like if we were to empower a player to step into the role of somebody in Hamlet and say, ‘Hey, you think that this situation could have been avoided easily? Go ahead and try, see what happens.’” While the first loop of Elsinore is pretty faithful to the text, the team has made some changes, most notably expanding and diversifying the cast beyond white men (and a couple of white women) to help make what Chironis calls a timeless story more accessible to a modern audience.

All three of these games are approached like mysteries. The goal is understanding, because all that remains between loops is knowledge, whether stored in an in-game log or just represented by increased dialogue options. One design challenge is managing the pace at which that knowledge is obtained, to motivate the player without overwhelming them. “Every loop, I need to leave you two or three breadcrumbs,” explained Antonio.

But since the game scenario resets, the designer has limited control over the order of those breadcrumbs. “No two players are likely to experience the exact same path through the story,” said Kelsey. Elsinore has the longest loop, with the events of the play condensed down to four days, so pacing is even more important. “It feels unnatural if it’s just high-octane all the time,” said Chironis. As anyone familiar with the play will know, there has to be room for Hamlet to mope.

To enable Ophelia to rewrite this story armed only with foreknowledge, Elsinore required a complex social simulation. As engineer Kristin Siu explained: “The idea is that you can talk to anybody, at any point in time, with any piece of information that you have, and that may or may not have an effect on this ongoing world tragedy simulation around you.” This complexity left Chironis with overlapping narrative arcs to juggle and Siu with bugs to squash if, for example, a character popped up where they shouldn’t be.

Video game players crave these kinds of complex simulations that offer so much choice, but they’re really only possible in games with a narrow scope. “People are sick, overall, of games that are super wide but shallow,” said Alex, pointing to the commercially successful open-world games such as the Assassin’s Creed and Grand Theft Auto series, with their exhausting to-do lists.

“What experiences are valuable in the face of certain death?”

12 Minutes is perhaps the clearest example of this refined and in-depth alternative: three nameless characters in one apartment with maybe a dozen objects. Antonio credits this minimalist approach to his background in visual arts, where every color and shape has a purpose: “I try to only say what I need to say in order for you to be able to have enough breadcrumbs to communicate with this interactive experience. Everything else was removed.”

Another benefit of time-loop games is the lack of long-term consequences: the designer doesn’t have to write them, and the player doesn’t have to worry about them. This encourages a more playful approach; while time-loop movies and television shows force you to follow the protagonist’s pre-written actions, in a game, you have the agency to take more risks. You can give your wife a weapon, or jump into a black hole, or have Ophelia sleep with Othello. (Chironis added a few characters from other Shakespearean plays to Elsinore.)

And what choices the player makes in these moments can encourage introspection. As Chironis puts it: “It’s like, ‘Norway is going to invade this country in four days and everyone is going to die. So what are you going to do in the meantime?’” Outer Wilds, with its dying star, is even more existential. “Is it still worth it to explore and learn new things in the face of Armageddon?” Alex asked. “Yeah,” added Kelsey. “What experiences are valuable in the face of certain death?”

People have written that Outer Wilds can help with death anxiety. With the climate crisis in the news, apocalyptic thinking is on the rise. As the mistakes of our past threaten our future, perhaps it’s no wonder that people are drawn to stories about attempting to break free from a negative cycle. “When Trump got elected,” said Chironis, “A lot of people joked, ‘We’re living in the worst time line.’ And I still think that’s sort of how many people my age perceive the world. It’s not just the way things are and the way things will be. It’s: ‘We have a choice, and we made the wrong choice.’”