On October 7th, author James Frey will release a novel about the apocalypse. It will hold an elaborate code, directing readers towards a key hidden somewhere in the real world. That key will open a case containing $500,000 in gold.

This is the premise of Endgame: The Calling, which is not so much a book as a sweeping attempt at a story that will colonize all conceivable media. Fox is developing a movie concurrently, and Google's Niantic Labs, responsible for alternate-reality game Ingress, is making a new game based on the plot. A D&D dungeon master has been conscripted to maintain social media accounts for the characters, which he has done for the past year. Two more books are coming. And around it all is a scavenger hunt based on cryptic numbers, coordinates, and other details hidden in the book.

"It could happen tomorrow."

"There's so much possible in today's world that people don't do," says Frey in an interview at San Diego Comic Con. "You know, the idea that Twitter can be part of a book, or a search result can be part of a book, and a game can be a part of a book. A book can be more than what's on the page. It can take you out into the real world; it can take you out into the digital world." After coming up with the idea, Frey cold-called Google to see if the company would be interested in partnering on a game. Google agreed to a meeting, sending members of the team behind Ingress, its first foray into gaming.

Ingress, which was released for iOS earlier this month after years on Android, asks people to join one of two factions: the "Enlightened" and the "Resistance." Players walk around the real world to gather virtual "energy" particles and capture nodal points at specific locations. The game's lore has been fleshed out over time, but it has also slowly slid toward being more advertising-oriented, with important items found in branches of Jamba Juice and Duane Reade Pharmacy. "We were great at technology and kind of learning our way in terms of creating a narrative and fiction, but it's not Google's forte, you know?" says Niantic founder John Hanke. There aren't many details yet about the Endgame mobile game, but Hanke says there will be at least a little crossover with Ingress — a character from the latter "is investigating Endgame."

That sort of thing is possible because Endgame, despite its fantastic premise, is set more or less in the real world. "It could happen tomorrow," says Frey, who got the idea for the book from the ancient astronaut hypothesis, which posits that extraterrestrial beings shaped human civilization and are remembered today as gods. In the book, 12 bloodlines have passed down knowledge about a final game, which the aliens have said will determine the fate of the world. Scattered across the world, the teenagers they have picked as players must begin the competition: a hunt for three keys, one for each book in the trilogy. Readers, meanwhile, will conduct their own hunt, though what they’re looking for is nebulous. "A key in today's world is a broad word, and there are all sorts of places it could be," says Frey.

Though the ending is years out, and the first book hasn't even been released, characters are fleshed out with their own Twitter and Google+ accounts. "My teachers need to understand that i will not be doing every mindless bit of homework. I have bigger things to worry about," reads one tweet from "Marcus Loxias Megalos." Similarly, fake sites have been seeded throughout the web as part of the puzzles. You might, for example, want to look up the man credited with taking the book's author photo — Leon Alberti — to find secret messages in his other photos. "We've built, I don't know, 50 or 75 websites that exist in the world that nobody knows are there, says Frey." The potential ephemerality of these sites and social media accounts doesn't bother him. "I guess I don't even think about it. If it all goes away, it all goes away. Honestly, the fun so far has been just in doing it," he says. "You can always search for it on Google," Hanke helpfully interjects.

Frey frequently compares his novel to Masquerade, a 1979 children's book by Kit Williams that included clues directing readers towards a jewel-studded gold rabbit somewhere in the UK. "Everywhere you went you looked around and wondered if this was part of Masquerade," he says. "Is the rabbit there? Is it there?" Inauspiciously, the prize was actually found by a man with ties to Williams' former girlfriend, who is widely suspected of giving him a rough location to search.

Nor is Endgame the first fiction to use "viral" sites and alternate-reality games, which are frequently promotional vessels for other media, to build a story. The creators of horror film Nitrate perpetrated one of the longest-running Wikipedia hoaxes of all time, planting information about a fictitious Russian director named Yuri Gadyukin across the web to build credibility. Halo studio Bungie was famous for its prerelease web scavenger hunts, which in one famous example revealed a story about stranded AIs through glitches in a seemingly homespun beekeeping site. And this doesn't count fiction that's told in its entirety through social media, like elaborate mass storytelling experiment TedX Summerisle.

"It's a book about violence and ruthlessness and strategy."

Frey, however, sees many multimedia campaigns as pro forma afterthoughts. "Most of what I've ever seen done has been reactive," he says. "If you look at a lot of the big global media franchises, they were books that became immensely popular, so everything was built as a reaction to the popularity." His company, Full Fathom Five, specializes in releasing books that coincide with soundtrack, film, or video game counterparts. Once scathingly described as a "fiction factory" by a New York Magazine article whose veracity Frey disputes, it has dozens of often co-authored projects in the works at any given time; Endgame itself is written with the help of fellow Full Fathom Five author Nils Johnson-Shelton. So far, it's probably best known for science fiction novel I am Number Four, which was released as a film in 2011.

Though the setting of Endgame is in no way futuristic, its premise — a group of teenagers are chosen to play in a deadly, high-stakes competition — evokes obvious comparisons to The Hunger Games and similar books. Frey makes a case for classifying it outside the normal dystopian or post-apocalyptic genres, but it's less clear how far it strays from their most common themes. "I don't think we deal with a lot of what traditional YA is about. This isn't a book about love. It's not a book about angst. It's not a book about finding yourself. It's a book about violence and ruthlessness and strategy," he says, perfectly summarizing a swathe of young adult novels.

Isolate any individual element of Endgame, and it doesn't feel particularly unique, no matter how well-executed it ends up being. Its potential beauty lies in the sheer scale that Frey can manage, leaning on some of the biggest entertainment companies around. Two books remain in the series, and the prize will increase for each one — first to $1 million and then to $1.5 million. Google, for its part, plans to keep working with Fox and publisher HarperCollins to integrate its game into the rest of the series. "I have the best tech company in the world as my partner," Frey says. "I have the best publisher in the world as my partner. And I have the best movie studio in the world as my partner. If this doesn't work, I have fucked something up very badly."