PHILADELPHIA — No matter what the title of the show promises, the skies over this location shoot for “It’s Always Sunny in Philadelphia” had offered only thunderstorms broken up by occasional periods of mugginess. Maybe that was typical weather for this recent summer morning, or maybe it was the influence of the authors of the scene about to be filmed, who were thousands of miles away, busy with their regularly foreboding duties.
David Benioff, a creator of “Game of Thrones,” said he welcomed the challenge of writing an episode of “Always Sunny.”
For most episodes of “It’s Always Sunny,” the proudly depraved FX comedy about miscreant friends who run their own bar, the stars and producers Rob McElhenney, Glenn Howerton and Charlie Day keep the writing assignments to themselves and their like-minded colleagues.
But for this installment, the three (presently gathered beneath an overhang, waiting for the rain to pass) entrusted those duties to David Benioff and D. B. Weiss, the creators and show runners of the starkly brutal HBO fantasy “Game of Thrones.”
Mr. Benioff and Mr. Weiss have won acclaim for “Game of Thrones,” about a battle for power in a cutthroat medieval world; last week, it was nominated for 16 Emmy Awards including best drama.
They have also gained a reputation — consistent with the George R. R. Martin novels from which the show is adapted — for killing off prominent characters in gruesome fashion.
In one of their few outside writing assignments, Mr. Weiss and Mr. Benioff wanted to split sides in the figurative sense, not requiring broadswords or battle-axes. They pursued “It’s Always Sunny” not only because they were fans of the show and its creator, Mr. McElhenney, but also because its humor and fast-paced half-hour format would challenge them.
E-mailing from Belfast, where they do most of their “Game of Thrones” work, they said that Mr. McElhenney was “a sadist and likes to watch drama writers crash and burn.”
Mr. McElhenney said he embraced their offer knowing it was a good opportunity for his show, and respecting what Mr. Benioff and Mr. Weiss do on “Game of Thrones,” “executing that many story lines with that many characters, and creating such a rich and full tapestry every week.”
Also, Mr. McElhenney said, “you don’t know who’s going to get their head chopped off.”
The “Game of Thrones” creators first met Mr. McElhenney and his wife, Kaitlin Olson, another star of “It’s Always Sunny,” several months ago at a party in Los Angeles and confessed their love for the comedy. “Like all actors,” Mr. Benioff and Mr. Weiss said, “they respond well to worship.”
As it turned out, “Game of Thrones” is one of a few shows that Mr. McElhenney and Ms. Olson, who are parents of two young sons, still watch regularly. “Once those kids are in bed,” Ms. Olson said, “we get real grown up.”
When Mr. Weiss and Mr. Benioff hit upon an idea for “It’s Always Sunny” — a gloss on the novel and short story “Flowers for Algernon,” in which Mr. Day’s ne’er-do-well character is convinced that a scientific experiment is making him smarter — they suggested it to Mr. McElhenney.
Asked if they were tempted to kill off any principal “Sunny” characters, Mr. Weiss and Mr. Benioff said: “Nah. Those guys are immortal in our minds. They’re like the Simpsons.” As for supporting players like the unnamed Waitress or the down-on-his-luck Rickety Cricket, well — they didn’t quite answer the question.
Certainly, the “Game of Thrones” connection, and the large youthful audiences it brings in, is a powerful promotional opportunity for “It’s Always Sunny” at a time when the series is migrating to a new FX spinoff channel, FXX, that is aimed at younger viewers. (Both the new channel and the new season of the show will make their debuts in September.)
Still, Mr. McElhenney and his colleagues had to be sure that the “Game of Thrones” guys could emulate the wayward tone of “It’s Always Sunny.” (Not that Mr. Benioff and Mr. Weiss are above the occasional reference to the male anatomy. Asked which muscles they got to flex on this writing assignment, they said, “The cremaster muscle.”)
More crucially, Mr. McElhenney said that the intricate serialized style of “Game of Thrones” is “the polar opposite of what we do on ‘Sunny.’ ”
Rule No. 1 of “It’s Always Sunny,” he said, is “our characters never really change or grow,” or else “there’d be no show.”
By design, he said, “you could pick up Episode 6 from Season 7, and have no idea what was happening in the previous seasons or episodes, and catch right up.”
So Mr. Weiss and Mr. Benioff were subjected to the same process any other potential contributor would undergo. They went to the production offices, pitched their idea to the writing staff, wrote an outline that was further refined by the show’s writers and then a script that was also revised.
The “Game of Thrones” creators said it “was humbling to step into a room with 15 guys who are smarter, funnier and quicker than we are.” They added, “They were all very gracious about the fact that we’re both brutally unfunny.”
But the writers of “It’s Always Sunny” said that Mr. Benioff and Mr. Weiss delivered a script that was structurally sound.
“We knew that most importantly there would be a working story, and we can always add or subtract jokes,” Mr. Day said. “If a random actor came in and wanted to write an episode, I would be concerned. But anyone who runs a successful show, I know they’re probably going to do a good job.”
Mr. McElhenney is already fantasizing about other notable show runners who could contribute to “It’s Always Sunny,” adding that Matthew Weiner, the creator of “Mad Men,” had been “threatening to write an episode.”
(Mr. Weiner, who is currently preparing the final season of “Mad Men,” said in a telephone interview: “We’re discussing it. I don’t think I’m allowed to write anything for any other TV show right now.”)
Mr. McElhenney, asked when he would get to write a “Game of Thrones” episode in return, could only bite his lip and shrug his shoulders. “I’m waiting for my offer,” he said.
Mr. Weiss and Mr. Benioff, meanwhile, said their experience at “It’s Always Sunny” had taught them that “we should let those guys write future episodes of ‘Game of Thrones’ while we hang out and get drunk at our favorite bar.”
"It's Always Sunny In Philadelphia" will premiere on Wednesday, September 4 at 10 p.m. ET, followed by the Season 5 premiere of "The League" at 10:30 p.m., FXX announced today.
Both series have been picked up for 13 episodes. "Always Sunny" will air its 100th episode on Wednesday, October 9 at 10 p.m as part of Season 9. An offshoot of the existing FX channel geared towards comedies, FXX will launch on Monday, September 2 at 7 a.m. ET and will be carried in 72 million homes.
Also joining FXX's lineup is "Totally Biased with W. Kamau Bell," which will air five nights a week at 11 p.m. ET starting September 4, with "Best of the Week" compilation episodes on Sundays in the same timeslot. The half-hour show stars standup comedian Bell as he dissects politics, pop culture, race, religion, sex and the media from his own unique point of view. Bell, Chris Rock, Chuck Sklar and Keri Smith Esguia are executive producers.
Other comedies airing on FXX include syndicated reruns of "How I Met Your Mother," "Parks & Rec," "Sports Night," "Arrested Development," "Freaks & Geeks" and "Rescue Me."