TV's longest-running live-action sitcom is built to last thanks to its brilliant inclination to get really, really weird.

“Dee Day” is a pretty strange episode of television, even by “It’s Always Sunny in Philadelphia’s” warped standards. There’s a racist play featuring brown face, an involuntary make-out scene between two platonic friends, an ongoing vomit bit, a mystery lurking in the background about a secret plan, and it’s all wrapped in a simple sitcom premise: It’s Dee Day, which means everyone as to do what Dee (Kaitlin Olson) says, no matter how uncomfortable, unwanted, or weird.

Written by Megan Ganz (who last penned one of “Sunny’s” best recent episodes), “Dee Day” utilizes many of the series’ comedy go-to’s: satire, physical humor, shocking behavior, random running gags, and an utter lack of shame from anyone involved. But it’s also really, really weird, and that in itself has been a key element to the FX sitcom’s longevity. Without episodes like “Dee Day,” “It’s Always Sunny in Philadelphia” would’ve never tied “The Adventures of Ozzie and Harriet” as the longest-running live-action sitcom ever — nor would it have continued to stand out from the ever-increasing competition as it steams toward a record-breaking Season 15.

Weird episodes like “Dee Day” are a regular component of “It’s Always Sunny,” but they’re not to be confused with the characters’ generally weird vibes. Sure, Frank (Danny DeVito) and Charlie (Charlie Day) like to play Nightcrawlers — a mysterious game that may or may not involve the two roommates throwing blankets over each other and crawling around their apartment like worms — but there’s no episode dedicated to the game itself (yet). It’s just one of many contributing facets to their peculiar personalities.

Weird episodes are a different story. They’re chaotic, experimental, or so out there that it’s hard to recap them without sounding insane. Think about what happens in “The Gang Makes ‘Lethal Weapon 6’,” “Making Dennis Reynolds a Murderer,” “Charlie Work,” “The Nightman Cometh,” “CharDee MacDennis: The Game of Games,” and “Being Frank.” Now try to explain what happens in each, why it works, and what’s funny about it. It’s harder than it sounds!

Yes, some of the weird episodes are deceptively simple. Like “The Gang Makes ‘Lethal Weapon 6’,” “Dee Day” is exactly what it sounds like. Yes, it’s difficult to encapsulate how and why things happen, let alone everything that happens in the 23 minutes, but the episode’s grounding force is Dee. She’s the boss. She tells them what to do. She keeps them from their secret mission. So if Dennis (Glenn Howerton) suddenly walks into frame wearing a bright red wig and sporting an Irish accent, it’s really weird, but you can easily presume he’s doing so because Dee made him. Many of the other weird episodes have a similarly basic foundation, which lets the stories built on top get stranger and stranger. This is the core engine of most situational comedies, and “Sunny” is no different.

But many of these weird episodes don’t even fit into the sitcom’s accepted, ongoing premise: five “friends” run a dive bar in Philly. “Charlie Work” is an homage to “True Detective’s” one-shot, and while it’s rooted in what Charlie does at Paddy’s pub, it’s funniest when considering the formal approach and outside influences. “Being Frank” works similarly, while “The Nightman Cometh” — “Sunny’s” famous musical episode — really shouldn’t work. Bringing Charlie’s play on pedophilia to life is risky, to say the least.

Patrick McElhenney/FXX

But it’s certainly original. From the play’s premise to its music to the downer ending, nothing about the episode should feel familiar. Originality and creativity go hand-in-hand. So as long as Day, Howerton, Rob McElhenney, and the rest of the writing staff are thinking outside the box in terms of their episode content and construction, they’re bound to keep finding new opportunities. Much has been said about how the show’s satiric goals are routinely restocked by world events, and that’s true. But that topical content would die out if the “Sunny” gang wasn’t looking for new ways to tap into those topics.

Just the same, not all of the weird episodes are top-tier installments. “Dee Day” would probably land in the lower third of “Sunny’s” episodes, and that’s OK. Weird episodes are usually big swings, which can equal big misses. The talent inherent to this show makes even the bad episodes entertaining. Just look at “A Very Sunny Christmas.” The special is a bit bloated, and it’s hardly a must-see when you’re in the mood for holiday TV. But if you mention “Sunny” in just about any setting, someone is going to mention Frank crawling naked out of the couch. It’s an iconic moment within a risky episode, and the former cannot exist without the latter. Usually the cast can find a laugh in just about any situation, and their ambition is as admirable as it is critical. Big swings often connect, and those home runs create timeless pieces of television that reinvigorate a season and the series overall.

Season 14 hasn’t hit on that level yet, but “Sunny” absolutely will get there soon. Greatness is part of it’s very weird DNA.

“It’s Always Sunny in Philadelphia” Season 14 airs new episodes Wednesdays at 10 p.m. ET on FXX.

Sign Up: Stay on top of the latest breaking film and TV news! Sign up for our Email Newsletters here.