High-tech warfare at knife-fight ranges: that’s the ugly future of urban combat. If you thought Baghdad was bad, with its roughly six million people, imagine a “megacity” of 10 or 20 million, where the slums have more inhabitants than some countries. Imagine a city of the very near future where suspicious locals post every US military movement on Twitter with digital photos and GPS-precise coordinates. Imagine roadside bombs that fly because the bad guys downloaded blueprints for a kamikaze mini-drone and built it with their 3-D printer.

As the US pulls out of the mountains and deserts of Afghanistan, the Navy and Air Force may be looking to the wide-open Pacific, but the Army is increasingly concerned about the cramped alleyways of Third World cities. (The Marines, as usual, have a foot in both worlds). Chief of Staff Ray Odierno’s personal Strategic Studies Group — now led by hybrid warfare expert David Johnson — is working on the subject, as is the Army’s think tank and teaching institution, Training and Doctrine Command (TRADOC). This August, after months of seminars, simulations, and study, the Army War College will host a “deep future wargame” set in a megacity, probably a coastal one, circa 2035.

“We talk about the danger of failed states: Imagine a failed megacity,” offers Col. Kevin Felix of TRADOC’s Army Capability Integration Center (ARCIC), which plays a leading role in organizing the wargame. Even a partial breakdown of security and public services could put thousands of people in peril — or under the rule of drug gangs, as in Brazil’s infamous favelas; or of terrorist groups, like Hezbollah in parts of Lebanon. In those parts of the city, Felix told me, “there may be order, but I wouldn’t define it as law and order.”

There are already 26 megacities, defined as urban areas with over 10 million population, including such hives of instability as Karachi, Pakistan and Lagos, Nigeria. Worldwide the urban population now exceeds the rural for the first time in history. While megacities are the flavor of the month, they’re hardly the only potential trouble spots.

“It’s not just megacities,” said Maren Leed, a ground warfare expert at the Center for Strategic and International Studies. “We weren’t fighting in megacities in Iraq.”

Nor is the problem going to wait for 2035. “It’s not something, unfortunately, that’s 20 years away, so there’s some degree of urgency in thinking about this more deliberately,” Leed told me. “Both the Army and the Marine Corps are doing that on their own, but it ought to be something that the Joint Staff and OSD [the Office of the Secretary of Defense] are leaning forward on.”

That said, a wargame set in the biggest city in a high-tech future forces the Army to confront the hardest case of a wider phenomenon. “I’m just glad that the Army is talking about doing stuff in cities, because that had traditionally not been the case,” said Ben Fitzgerald, director of the technology and security program at the Center for a New American Security. “Whether they call them megacities or just cities, please keep talking and thinking about it.”

Live-tweeting the war: the “digital wake”

A foretaste of what is to come: At 1:00 am local time on May 2, 2011, an irritated Pakistani tweeted that a helicopter was flying over his Abbottabad neighborhood. He didn’t know it then, but it was the Navy SEALs coming for Bin Laden. Sohaib Athar‘s series of tweets didn’t compromise the raid, but they could have offered a warning. Waging “war amongst the people” has always been hard: Vietnam veterans could tell you about walking through a village, suspicious eyes watching the Americans’ every step — and now those eyes have iPhones. The spread of mobile devices makes abstractions like “social media” and “cyber warfare” a pressing tactical concern for infantry sergeants.

“Everything that you do leaves an information wake, just like a ship on the ocean,” said Michael Macedonia, who’s spent a lifetime working on digital technology for both the Army and industry. “People see you, they observe you, they talk about you, [though] you may not be aware of it.” Just as individual consumers need to be aware how everyone from Google to the Russian mafia is sucking up their personal information, Macedonia told me, “in the future, commanders need to be cognizant and aware of that information wake around them — hence the value of cyber.”

The military’s problem here is that its “cyber” efforts — from intelligence gathering to network defense to alleged virus attacks like Stuxnet — are not only a work in progress but highly centralized. Both technical capabilities and legal authorities are held tightly at high levels, concentrated in the White House, the Pentagon, and Fort Meade rather than distributed along the front line, focused on threats to national strategic interests rather than to forward patrols.

“Here’s one of the challenges with cyber,” said Lt. Gen. Edward Cardon, head of Army Cyber Command, at February’s Association of the US Army conference. If he were a brigade commander in Afghanistan or Iraq and wanted to hack a local terrorist’s computer, “I’d have to go way up the chain [of command].” If you just want to shoot the guy, no problem — “as a combat team commander, I have plenty of Title 10 kinetic authorities” — but his laptop is effectively off-limits.

Tactical commanders do have plenty of equipment to jam wireless transmissions, originally fielded to stop insurgents from detonating roadside bombs by remote control. But jamming everybody all the time is a good way to make enemies, especially since developing countries are actually more dependent on cellphones than the industrialized world. With even Africa now encircled by fiber optic networks, future adversaries won’t have to invest in proprietary military communications networks that the US can target without affecting civilians: Like guerrilla fighters hiding in a neighborhood, guerrilla communications can just piggyback on whatever the local civilians use. (That’s something even the US Army is considering for rapid-deployment forces).

“The adversary may be using the infrastructure that makes the city work,” said CNAS’s Fitzgerald. Sometimes “shut it down” may be the answer, especially for short-term, high-risk operations, but often the best tactical choice is to leave the networks running and to mine them for intelligence.

Troublemakers ranging from London rioters to Arab Spring protestors have used social media to coordinate their actions, and in the most troubled neighborhoods, online and wireless activity may be the best data source you have. “When people are living in high rises they have addresses,” Fitzgerald said. “People living in slums may not have surnames” — but they are increasingly likely to have (pirated) satellite television and mobile phones.

“In 2025,” Macedonia told me, “everybody in the world carries a cellphone even if you’re dirt poor.”

Democratization of the Drones

Electronic networks aren’t the only potentially dangerous technologies proliferating around the world: so is robotics. “A research team at a college printed a drone [on a 3-D printer], all except the engine,” said T.X. Hammes, a retired Marine colonel and expert on irregular warfare. “Fraternity houses have air forces now,” he told me, taking videos and dropping water balloons on each other from cheap remote-controlled miniature aircraft.

What are toys today may be weapons in the future, Hammes warned. “I would see the opposition using a lot of cheap drones as flying IEDs [improvised explosive devices],” he said. “You can jam them” so the human controllers lose contact, he said (though they may use the same frequencies as legitimate civilian communications), but as pattern recognition software and cheap sensors improve, you could program an autonomous drone as a kind of flying mine: “If it’s big and it’s metal and it’s moving, kill it…. The other side doesn’t care if he kills a mail truck instead of a tank, because he doesn’t have mail trucks or tanks.”

US forces wouldn’t unleash a buzzing swarm of indiscriminate robotic killers, but they could certainly more drones of their own to keep themselves and civilians safer. Remote-controlled robots have become standard in both military and police bomb squads, but for urban warfare, foot troops need something smaller, cheaper and, if necessary, expendable. “What the squad desperately needs is something that can go ahead of them,” Hammes said, to discover, for example, if a room is empty, rigged to blow, defended by diehard fighters or filled with women and children. “Those are the things we should not have to find out by sending people into the room.”

“The majority of casualties we sustain in urban combat are from first contact with the enemy,” said Fitzgerald. In a cluttered, crowded environment where IEDs and enemy fighters can hide until someone stumbles upon them, “it would be preferable if it wasn’t one of our humans that made that first contact,” he said. “How do we make sure our people are part of the second contact?”

There’s a danger here of high-tech overload — of giving young troops so much data on everything from social media activity to drone surveillance that they have no mental bandwidth left to think. “You can easily overwhelm the squad leader and the fire team leader if you give him too many things,” Hammes said.

“You want riflemen to be looking at people, to be looking at the environment,” Fitzgerald agreed. “We’re going to need to have battle managers, people who can provide information management”: sorting through the mass of data, finding important patterns and vital clues, keeping some information available on demand while pushing urgent notifications out to frontline troops.

That said, Fitzgerald (an Australian by birth) has great confidence in young American troops to have the tactical and digital savvy to get the job done in the city. “I am continually in awe of soldiers and marines who’ve been able to operate in these environments over the last 10 years,” he told me. “If you had to pick one country in the world to do this stuff, it’d be the United States of America.”