In 2014, Sledgehammer Games worked with the Hollywood screenwriter Mark Boal (his credits include “The Hurt Locker” and “Zero Dark Thirty”) on the story for the first-person shooter Call of Duty: Advanced Warfare. That same year, the former Pixar writer Stephan Bugaj worked with Telltale Games to develop a narrative for the studio’s popular episodic adventure game series Game of Thrones and The Walking Dead.

Last December, Naughty Dog, the studio behind blockbuster action-adventure franchises like Uncharted and The Last of Us, announced that Halley Gross, a writer and story editor on HBO’s “Westworld,” would help write the studio’s coming game, The Last of Us Part II. The game will follow its two protagonists, Ellie and Joel, as they make their way across post-apocalyptic America fighting off zombielike monsters.

Video game fans have long signaled their appreciation for narrative games. Action-adventure games, which typically have more complex story lines, are among the top three genres for PC games, console games and mobile games, according to Newzoo, a video game marketing intelligence company. In April, the Entertainment Software Association released a survey that found that 59 percent of gamers consider the story when buying a title; it was the third-highest influencing factor behind quality of graphics and price.

But writing for a video game can present hurdles for television and film writers. That’s because unlike film and TV audiences, gaming audiences are not passive spectators. With a story-based game, you expect to be able to exercise some agency over how the story unfolds — or at least to experience the story in a way that feels more intimate and personal than a film or television show. Writers have to take that interactivity into account.