In the late 1700s and early 1800s, a machine known as “The Turk” became a sensation by winning matches against expert chess players.

Audiences marveled at this feat of technological wizardry — that is, until one vanquished player took a closer look and discovered that there was a man hidden inside. The whole thing was a hoax.

That long-ago story pops into the head of Sandeep Chowdhury, a deputy U.S. national security adviser, as he’s pulled deeper into a terrifying match of technology and military gamesmanship in “2034: A Novel of the Next World War,” by combat veteran Elliot Ackerman and Adm. James Stavridis, a former supreme allied commander of NATO.

This crisply written and well-paced book reads like an all-caps warning for a world shackled to the machines we carry in our pockets and place on our laps, while only vaguely understanding how the information stored in and shared by those devices can be exploited. We have grown numb to the latest data breach — was it a political campaign (Hillary Clinton’s), or one of the country’s biggest credit-rating firms (Equifax), or a hotel behemoth (Marriott), or a casual-sex hookup site (Adult FriendFinder), or government departments updating their networks with the SolarWinds system (U.S. Treasury and Commerce)?

Oh yeah, it was all of them.

In “2034,” it’s as if Ackerman and Stavridis want to grab us by our lapels, give us a slap or two, and scream: Pay attention! George Orwell’s dystopian masterpiece, “Nineteen Eighty-four: A Novel” was published 35 years before 1984. Ackerman’s and Stavridis’s book takes place in the not-so-distant future when today’s high school military recruits will just be turning 30.

The action in “2034” begins near the aptly named Mischief Reef, where Sarah Hunt, a veteran U.S. navy captain nicknamed the “Lion Queen,” has steered her flotilla of three Arleigh Burke-class destroyers into the South China Sea — a thinly veiled mission to sneer at the Chinese claim to that stretch of water as part of their territorial seas. Hunt commands highly sophisticated war machines with computerized weapons systems. But she has a tendency to rely on her intuition, in much the same way as another of “2034’s” central figures, Maj. Chris Mitchell, a fighter pilot with a penchant for using manual controls and a nickname — “Wedge” — derived from “the world’s first and simplest tool.” He celebrates successful missions by smoking Marlboro Reds and loves the straightforward stick and button controls of old arcade games.

Their commander in chief is an unnamed woman, the first president elected in modern history without being affiliated with a political party. (Perhaps the future ain’t all bad.) Among her predecessors is a one-termer identified only by his last name: Pence. (Presumably — but who knows? — the former vice president, Mike Pence, not his wife, the teacher, towel-charm entrepreneur and watercolorist, Karen Pence.)

Hunt’s foray into the South China Sea and Mitchell’s simultaneous piloting of an F-35E Lightning into Iranian airspace set in motion a cascading series of events that — without giving away too much — lead to the world war referenced in the book’s title. The United States is eventually pulled into a conflict that involves forces from China, Russia, Iran and India. Yet, at a time when strident nationalism has become one of the defining characteristics of our age, Ackerman and Stavridis offer subtle commentary about the interconnectedness of the world. Chowdhury’s uncle is an admiral in India’s armed forces. Lin Bao, a Chinese defense official who plays a crucial role in the book, is half-American and half-Chinese, and studied at Harvard’s Kennedy School.

“We have M&Ms in China too,” he says during a tense conversation with Chowdhury in the run-up to the war. “But they taste better here.”

He tosses the empty candy wrapper on the sidewalk outside the White House to punctuate the threat. When Chowdhury asks him to pick it up, he just walks away.

The disembodied weapons wielded in the war of “2034” initially are the main tools of the conflict — artificial intelligence, cyber-snooping, Internet-disrupting digital invaders, unmanned drones. But it is the men and women inside the machinery — the bureaucrats and politicians — who move the pieces around the board.

The Chinese scoff at their U.S. adversaries, and the policymakers they see as being responsible for a degradation of American might.

“The deregulation that had resulted in so much American innovation and economic strength was now an American weakness,” sniffs one Chinese defense official. “The Americans have proven incapable of organizing a centralized cyber defense.”

Hunt isn’t so sure that the viewpoint expressed by not only the Chinese, but by her fellow U.S. military commanders, gets it right.

After a major setback, she laments that “there’s still a whole swath of officers in our military who cling to a cult of technology. They cannot bring themselves to acknowledge that an overreliance on these systems has crippled us.”

She eventually concludes that “the way to defeat technology isn’t with more technology. It is with no technology.”

The fate of the world in “2034” the novel, and perhaps in ours, just might rest on the answer to that question.

Or maybe the question has already been answered, but we don’t know it yet.

2034

A Novel of the Next World War

By Elliot Ackerman and James Stavridis

Penguin Press. 320 pp. $27