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.

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.