The clinical psychologist Jon Freeman was feeling burnt out. He spent his days at a corporate office in Manhattan, managing dozens of research assistants as they tested pharmaceuticals on people with anxiety, depression, and insomnia. Looking for an escape hatch, he noticed that his daughter often had nothing to do after school. She would pick up her Nintendo Wii controller and drift “into this world of digital isolation,” Freeman recalled. From time to time, he enticed her back into social existence with board games. “Then I had this idea: Couldn’t we do this on a larger scale? Could we expand this to our neighborhood?”

Freeman quit his job, and, shortly thereafter, in 2011, the first customers—initially, his daughter’s friends—arrived at his pop-up board-game club and café, Brooklyn Strategist, a place where children and their parents could sit down and play games, both classic and obscure, over veggie platters and homemade ginger ale. Looking back at his work in the research lab, he paired cognitive-ability tests with the board games that he had on hand, and divided these amusements by brain function—kids worked their way around their frontal lobes a die roll at a time.

One day, a child who had grown tired of a sports-statistics game asked if Freeman had heard of the role-playing game Dungeons & Dragons, and if they could play it. The game has no board and no cards. Occasionally, players make use of maps. At its best, it’s a story told between the players, who control characters (elves, dwarves, gnomes, humans), and the Dungeon Master, who describes the world and uses dice to determine outcomes in the second person (“You come across a band of orcs, travelling down the road. What do you do?”). Freeman refused for a week or two—the game was too open-ended, and didn’t have a straightforward cognitive benefit—but the customer persisted, so he went up into his parents’ attic, dug out all his old D. & D. manuals, and wrote an adventure. “I tried to give them a little flavor of everything,” he told me, “A little dungeon crawl, a little fighting monsters. They ate it up.” Word got out. A few months later, a parent stopped him on the street with tears in her eyes. “What are you guys doing?” she asked him. Her son was dyslexic and had been role-playing at Brooklyn Strategist for a couple of weeks. Before D. & D., he couldn’t focus on writing for more than a few seconds. Now he was staying up all night to draft stories about his character. “Whatever it is, bottle it and sell it to me,” the mother said.

Freeman got a permanent space in 2012 and added French-press coffee. A few months later, Gygax, a once defunct magazine named for the Dungeons & Dragons co-creator Gary Gygax, chose Brooklyn Strategist to host its relaunch party. A reporter for Wired, covering the event, asked the magazine’s founders why they wanted to waste their energy on such a publication (not to mention such a store) when “it’s video games, not Dungeons and Dragons and other RPGs, that are getting all the attention?” This attention, it seems, has shifted. Two popular role-playing shows, “The Adventure Zone” and “Critical Role,” sent Freeman’s older patrons to their knees, begging for more D. & D. time in the store. Soon, Freeman had to hire half a dozen paid Dungeon Masters for the kids and has now begun training volunteer Dungeon Masters to guide adventures for the adults who drop in on Thursdays to fight goblins, trick castle guards, and drink wine.

Dungeons & Dragons nights have spread into classrooms and game stores across the country. Forty dollars in Portland, Oregon, gets you into Orcs! Orcs! Orcs!, a “Tavern-inspired” pop-up restaurant with D. & D. games and artisanal delicacies. (One night, it boasted “tankards of beer” and “a whole roast pig.”) In Massachusetts, snow or shine, a series of role-playing camps called Guard Up offers children the chance to chase each other through the fields of Burlington with foam swords and Nerf blasters, while somehow also learning. (Each summer, in one camp, novels like “Animal Farm” or “Twenty Thousand Leagues Under the Sea” are adapted into a mock zombie apocalypse that is then played out by the campers. In another, at a moment of detente, Gandalf might appear on the edge of a running track to give physics lessons.) “I’ve had parents get very upset with me,” said Freeman, who recently opened another store near Columbia University. “Because they sign their kids up for role playing and my staff is trying to expand their horizons beyond D. & D. and into other independent games. But the parents are, like, ‘If they can’t play D. & D., then I don’t know if this is going to work.’ ”

This turn of events might shock a time traveller from the twentieth century. In the seventies and eighties, Dungeons & Dragons, with its supernatural themes, became the fixation of an overheated news media in the midst of a culture war. Role players were seen as closet cases, the least productive kind of geek, retreating to basements to open maps, spill out bags of dice, and light candles by which to see their medieval figurines. They squared with no one. Unlike their hippie peers, they had dropped out without bothering to tune in. On the other side of politics, Christian moralists’ cries of the occult and anxiety about witchcraft followed D. & D. players everywhere. Worse still, parents feared how this enveloping set of lies about druids in dark cloaks and paladins on horseback could tip already vulnerable minds off the cliff of reality. At the end of the 1982 TV movie “Mazes and Monsters,” a troubled gamer, played by a pre-fame Tom Hanks, loses touch and starts to believe that he really does live beside an evil wood in need of heroes. “He saw the monsters. We did not,” his ex-girlfriend says in a voice-over. “We saw nothing but the death of hope, and the loss of our friend.”

Decades passed, D. & D. movies and cartoons came and went, and the game remade itself over and over. But interest fell like an orc beneath a bastard sword. The game’s designers, surrounded by copycats and perplexed about how to bring D. & D. online, made flat-footed attempts at developing new rule books to mimic the video games that D. & D. had inspired. Gygax died, in 2008, occasioning a wealth of tributes but little enthusiasm. Then, a fifth edition of D. & D. rules came out, in 2014, and, somehow, the culture was receptive again to bags of holding and silver-haired drow. People started buying up these volumes in droves. “More people are interested in D&D than we thought,” the game’s lead developer, Mike Mearls, said, as print runs repeatedly sold out. “Who are these people? What do they want?”

In 2017, gathering your friends in a room, setting your devices aside, and taking turns to contrive a story that exists largely in your head gives off a radical whiff for a completely different reason than it did in 1987. And the fear that a role-playing game might wound the psychologically fragile seems to have flipped on its head. Therapists use D. & D. to get troubled kids to talk about experiences that might otherwise embarrass them, and children with autism use the game to improve their social skills. Last year, researchers found that a group of a hundred and twenty-seven role players exhibited above-average levels of empathy, and a Brazilian study from 2013 showed that role-playing classes were an extremely effective way to teach cellular biology to medical undergraduates.

Adult D. & D. acolytes are everywhere now, too. The likes of Drew Barrymore and Vin Diesel regularly take up the twenty-sided die (or at least profess to do so). Tech workers from Silicon Valley to Brooklyn have long-running campaigns, and the showrunners and the novelist behind “Game of Thrones” have all been Dungeon Masters. (It’s also big with comedy improvisers in Los Angeles, but it’s no surprise that theatre kids have nerdy hobbies.) Nevertheless, the image of the recluse persists even among fans. “We’re going to alienate ninety-nine per cent of the people out there right now,” Stephen Colbert told Anderson Cooper last year, on “The Late Show,” as they fondly recalled their respective turns as an elven thief and a witch. “The shut-in at home is really excited,” Cooper replied. “Neckbeards,” Colbert added.

The “neckbeards” may be more numerous now than he and Cooper realize. “The Big Bang Theory” is a sitcom about young scientists at CalTech who spend most of their time shuttling between their laboratories and the comic-book store. The show’s protagonists also play a lot of D. & D. In one episode, a theoretical physicist takes on the guise of the Dungeon Master to relieve a microbiologist of her distress over the restraints of her pregnancy. She pretends, for an evening, to live in a world where only men are with child (“Your husband is home trying not to pee when he laughs”), to drink ale out of the skull of a goblin, and to eat sushi made from the meat of a monster that she has butchered herself. Fourteen million people tuned in.