Underwood 2016
Political campaigners for fictional TV character Frank Underwood, from House of Cards MICHAEL OWEN BAKER/AFP/Getty Images

Say you're a storyteller whose TV show draws inspiration from real-life Washington.

Whether portraying the noble geopolitics of "Madam Secretary" or the dirty deeds on "House of Cards," the high-stakes fumbling on "Veep" or the scourge of terrorism that haunts "Homeland," script writers have always faced the challenge of staying topical yet inventive without straying outside the bounds of plausibility.

Then the Donald Trump presidency struck. Almost overnight the unexpected or unthinkable became the new normal, with real-life drama constantly threatening to outdo anything the cleverest writer could dream up.

The writers of Showtime's "Homeland" are already brainstorming next season, "and every day the landscape changes," says Alex Gansa, an executive producer and co-creator of the Claire Danes-starring spy thriller. "It's very difficult to keep up with.

Damian Lewis
Homeland star Damian Lewis Frederick M. Brown/Getty Images

"We are in extremely unusual times," he says, "and sometimes it feels like nothing we dramatize on 'Homeland' can be nearly as scary as what's actually happening on the world stage."

Melissa James Gibson is a showrunner for Netflix's "House of Cards," which stars Kevin Spacey as a cut-throat chief of state. She has a similar lament about Trump's impact.

"It's true that we are being met with a certain brand of audacity in real life," she says. "I think it engenders a sick impulse — 'What's he gonna do today?' — where we're looking for our drama from the real-life president, as if THAT were a show."

"I'm very jealous," jokes David Mandel, showrunner for HBO's political satire "Veep," where Julia Louis-Dreyfus plays a blunder-beset former president. "We work very hard on our scripts. They seem to be better at the job than I am."

CBS' "Madam Secretary" follows the career and family demands borne by Elizabeth McCord, the soft-spoken, hard-charging U.S. Secretary of State played by Tea Leoni.

When the series began three seasons ago, "we wanted to show a government where people still valued others' opinions and things still got done," says executive producer Lori McCreary. Now, with the widening political breach, she sees the show as more than ever "an aspirational version of where we are — and, I hope, a much-needed break from all the craziness of the news."

But trying to forecast true-life foreign relations as grist for storytelling has become even trickier in the Trump Era, says "Madam Secretary" executive producer and creator Barbara Hall.

"In the past, we would take current events and try to project them into the future," she says. "But now, in some cases, we have to just decide that the show IS our world. Then we make up our own rules."

The recent season finale found Secretary McCord seeking help from NATO nations to ease an international flare-up.

When Hall was writing the script months ago, she was well aware that NATO was a sore subject with Trump, who had called it "obsolete" as a candidate.

"But there was no way to know where it would land," says Hall. "We ended up doing an episode that as much as anything explained the history of NATO and what it was for, with our administration supporting it."

Then, by chance, the finale's May airing coincided with Trump's visit to Brussels. Even though by that point he had reversed his position on NATO's "obsolescence," he created a diplomatic stir by scolding other NATO members, and appeared to shove Montenegro's prime minister to get a prime spot for the photo op.

"Madam Secretary" isn't the only series where fiction and reality crisscrossed in surprising ways.

On "Veep" last month, hapless former president Selina Meyer traveled to Qatar. There, addressing an Arab conference on human rights, she gave in to political pressure and tried to gloss over the oppression to women she had planned to decry.

The very same day the episode aired, Trump's travelled to Saudi Arabia where he praised that country's progress in empowering its women — who, as more than one observer noted, aren't allowed to drive or be out in public without a male escorting them.

Julia Louis-Dreyfus
Veep star Julia Louis-Dreyfus poses with two Emmys in 2016 Frazer Harrison/Getty Images

"You just can't plan that," says "Veep" writer Mandel of the harmonic convergence.

"Veep" didn't plan for Trump to be president. But Mandel says that, a couple of years ago, the show adopted a fortuitous strategy for staying fresh: Meyer would be voted out of office, then struggle comically with post-presidential life (which, judging from this week's season finale, will include another presidential run — her fourth).

"That allows us to continue to do political comedy but from a different angle, like a bumper shot in pool," Mandel explains. "We no longer, thank gosh, occupy the Oval Office. If we did, you'd watch Trump, then you'd turn to our show and it would look no different."

"Homeland" didn't figure on Trump's election, either. The preparation of scripts for its sixth season, which concluded in April, had begun a year earlier with a fictional new president in mind — a woman.

Still, the writers happened to guess right on something else — then doubled down on it.

"It was complete serendipity," says Gansa. "We wanted our president-elect to be in conflict with her intelligence community. And lo and behold, just a matter of weeks after Trump was elected, he and his intelligence community were in a full-blown adversarial relationship."

By then the scripts were long since finished and a number of episodes shot. Even so, "we were able to course-correct our narrative right into the midst of that conflict," Gansa says. "As we moved forward, we were keeping one eye on what was happening in real life and one eye on our fiction. We were on a high wire as we headed toward the end of the season."

The entire fifth season of "House of Cards" was released just a few weeks ago. But already its writers, like the "Homeland" team, are looking ahead to next season.

"We don't know yet what 'the Age of Trump' is," says showrunner Frank Pugliese. "But instead of focusing on Trump, we're talking about what Trump is a product of. If we look at that, it might give us a sense of where we are, and where our characters might go.

"Our job is to research and explore what's possible, then take it to the extreme to entertain and grab attention. That's still what we're trying to do.

"But it's concerning," he adds, "when a politician feels they have to do the same thing for themselves."