Topicality and breaking format can get a show noticed, but those same qualities can also be risky, provoking studio concerns about whether an episode is too of-the-moment or viewer tune-out if a program deviates too much from the norm.

But in the peak TV era, distinctive programming rules the day, especially when it comes to buzz, critical acclaim and Emmy nominations, as series noms for topical TV comedies “Atlanta,” “Black-ish,” “Master of None” and “Veep” attest.

The entire sixth season of “Veep” deviated from tradition with lead character Selina Meyer (Julia Louis-Dreyfus) no longer holding a political office. “[Before the real-world election] we made the decision to take her out of the White House and have her move on in her life, and I think that helped create a distance, a buffer, that as the season unfolded I was thankful for every day,” says “Veep” executive producer David Mandel. “Had we been in the White House we would have been in trouble. The comparisons would have been even crazier. It would have felt like we were lagging behind. It would seem too similar.”

Mandel says some of “Veep’s” topicality comes by design, through routinely planned take-offs on real-world events, but this season he was surprised how much real-life imitated the HBO comedy, which has won top comedy honors the past two years and a dozen overall.

“We created an episode where Selina would be over in Georgia, part of the former Soviet Union, monitoring elections and get involved with dirty money and bribes, which we thought was interesting but we were not expecting Russia to be perhaps the biggest story of the year and yet there you go,” he says of the season that filmed from October to February.

“The night our episode aired with Selina visiting Qatar giving a speech that was pro-female mutilation, Trump was in Saudi Arabia praising them for their human rights. I couldn’t design that if I tried.”

ABC’s “Black-ish” confronted the reality of a Trump administration head-on in the January episode “Lemons.”

“That was an emotional response just to seeing the world around us and feeling like we needed to say something,” says “Black-ish” executive producer Kenya Barris. “In general we talk about the season before it starts and try to talk about the things this family would be talking about. We’re not ‘Law & Order,’ ripped-from-the-headlines per se, but sometimes those things line up.”

And Barris adds working on “Lemons” was personally cathartic: “It’s what my family was going through, my friends, people I work with. I wanted to do what we as writers so seldom get to do, which is just write from our hearts.”

Season two of Netflix’s “Master of None” tackled the notion of workplace sexual harassment in scripts written before allegations against Fox News impresario Roger Ailes and host Bill O’Reilly led to their ousters.

“The concern we raised was, ‘Will this feel dated? Will this feel very much of the time?’ ” says “Master of None” co-creator Alan Yang. “Unfortunately, men acting horribly toward female co-workers is an evergreen topic.”

Yang says there was also conversation about changing the second season’s religion episode. “We had a political candidate running for president saying he would ban Muslim people from entering the country and here we’re sitting on a script about Islam and it doesn’t take any of that into account,” Yang says. “We debated it and we ultimately decided this episode is not about Trump, it’s about these characters and this family and it’s about a son standing up to his parents and trying to engage with them and learn more about their lives.”

Scribe Stephen Glover, brother of “Atlanta” creator Donald Glover, says the writers don’t set out to tackle topics just for the sake of being topical. “We make sure not to ever be too preachy,” he says. “And you want to make sure the topic you’re talking about fits in well to the story you’re doing.”

Furthermore, these comedies didn’t just play off current events, they also broke the rules of comedy, zigging where others might zag. On “Veep” this year’s season finale took viewers to moments from Selina’s past that had not previously been seen.

“As a writer, I love to play with format,” Mandel says, citing the “Bizarro Jerry” episode of “Seinfeld” he wrote in 1996. “Our ‘Veep’ flashback episode was really an opportunity to both fill in some missing blanks and earlier parts of [Selina’s] life and it gave us a chance to see what makes her tick. We were concentrating on those moments in her life where it was the office versus her personal life and we watched her choose the office time after time. It helped motivate her decision in the end to both sabotage her library and [dump] the man she loves to run for president again.”

“Master of None’s” second season featured so many deviations from the norm it was sometimes difficult to know what the norm even was for the show: A black-and-white season premiere with much of the dialogue in Italian (“The Thief”) as Dev (Aziz Ansari) took a detour from his usual locale; an episode dedicated to New York and characters who would normally be background (“New York, I Love You”), and another that focused on a supporting character over a 25-year period (“Thanksgiving”).

“We get 10 episodes [per season] and we try to make each one unique and have something that grabs the audience and gives them something to talk about after each episode,” Yang says. “These were ideas, topics that really excited us and the format came naturally.”

In the “Atlanta” episode “B.A.N.,” Paper Boi (Brian Tyree Henry) was a guest on a fictional talk show, complete with fake commercials.

“We wanted to do something different and see how people would take it,” Glover says. “It’s funny that people loved it because we loved it so it all worked out.”