Seth Rogen and company craft a filthy, funny yet finely put together film about how they would handle the Apocalypse.

Written by Seth Rogen and regular writing partner Evan Goldberg, This Is The End is also the directing debut from the duo. While the team is most well known for penning Superbad and Pineapple Express, they’re also responsible for a few duds like The Green Hornet and last year’s The Watch. Fortunately, This Is The End has Rogen and Goldberg at the top of their game.

The film opens with Jay Baruchel landing in LA and being greeted by Rogen, who takes Jay back to his house for a day of decadence that involves video games, 3D TV and copious amounts of weed. But Seth wants to go to James Franco’s house warming party, despite Jay’s aversion to Franco and pretty much every other friend of Seth’s. They end up going anyway and find a ridiculous house which “Franco designed himself” and a raging party inside littered with famous friends.

It’s about as simple a plot as a film can have but it still sets up an internal conflict — that of Jay not fitting in — that will clash with the obvious impending external conflict. From the outset he claims that Jonah Hill hates him, and he can’t stand Jonah anyway, that he hates LA and that he’s just not a part of Rogen’s new crew. While the two claim they’re best friends, there’s an obvious rift forming which propels much of the film, especially when the comedic bits begin to wear thin.

That’s not to say that the film isn’t funny, because it is. Hilarious, in fact. But the best of Rogen and Goldberg films have always understood jokes don’t make a film. To carry a film from beginning to middle to end, there has to be plot, character development and conflict. While the film may not have the deepest of each ingredient, it has just enough of each to make it more than a sketch that’s just carried out to feature length.

Of course, the real conflict is that during the party, LA is suddenly destroyed by some unknown force and all that remain are Seth, Jay, Jonah, James Franco, Craig Robinson and, unbeknownst to them, a vile Danny McBride, who’s probably the overall greatest departure from his real self. Once the group is confined to the house, struggling to understand what’s going on and just trying to survive, the film certainly doesn’t lose its humor but it enters new territory that ratchets up as much tension as it does laughs.

Another fine line the duo walk is casting Rogen and their friends as versions of themselves. Stunts like this always run the risk of going overboard into self-parody but the film never quite gets to that point, pulling off some self-deprecating humor in the beginning but, once the crisis hits, the characters never really go over the top. Rogen and Goldberg do mine the inevitable swipe at real actors, mostly during the party scenes, but are wise enough to find much of the humor in the relationships between the trapped six themselves. They paint them as real people, even if some do find it hard to shake the preferential treatment they’re used to having.

Ultimately, what makes it work is that it has the same spark that made Pineapple Express such a success, in which it has some parody of genre, and in this case some parody of the cast themselves, but it isn’t a parody film. Like Edgar Wright, Simon Pegg and Nick Frost’s Ice Cream Trilogy (the third of which comes out this summer and is, ironically, about the end of the world), they infuse comedy into a genre film while also existing within the genre itself. In this case, it’s a version of a disaster film but even then, it’s a pretty original idea that they’ve created. Not to mention, once again, that it’s flat out hilarious.