Hollywood loves happy endings. Fairytale romances, the bad guys getting their dues, and estranged friends joining forces again are the ingredients for a mainstream film. The battle may be hard-fought, and losses may occur, but at the end of the day the princess can be saved, the city defended, and the earth preserved.

RELATED: This Almost Forgotten Film Starring Ewen McGregor Is A Fantasy Gem

Sometimes, though, not even the world's greatest scientists and action heroes can redirect the incoming meteor or quiet the supervolcano. The good guys try but fail. Sometimes they don't even try. The end result is the eradication of all life on earth, even of the earth itself. Planetary destruction is often a grim ending, but it can be a blackly humored one too. Here are just a few films in which the planet doesn't make it in the end.

8 When Worlds Collide

People run in terror as the city is destroyed in the theatrical poster for When Worlds Collide

A 1951 film based on a 1935 novel, When Worlds Collide is a classic of the genre. Whereas in the novel, Earth is destroyed by a collision with another planet, it is the rogue star Bellus that wipes it out in the film, rendering the title and its tagline "Planets destroy earth!" more than a little misleading.

The nature of the collision, though, makes it no less lethal in this alternate version. Earth's scientists scramble to prepare a rocket capable of shuttling a chosen few to safety. The lottery system devised to select those that will live unsurprisingly causes problems, and humanity's last remnants scramble to escape as earthquakes, tsunamis, and tornados consume the planet.

7 Knowing

knowing-movie-nic-cage Cropped

Nicholas Cage drives through the city, accompanied by classical music, making his way through a mob of terrified people, trapped with no way to escape their impending doom. The burning skyline is reduced to a smudge of brown and charcoal from the smoke, and castoff paperwork flutters through the streets, suddenly meaningless.

RELATED: Are Studios Relying Too Much On Nostalgia?

Knowing does a better job than most at casting the end of the world as a truly hopeless and desperate scenario. Cage's quiet, overwhelmed performance complements the audience's own sense of inevitable loss as fire rolls across the city, obliterating it in seconds. Here the music smartly cuts away, leaving only the sound of crumbling buildings.

6 The Quiet Earth

The main character watches a planet rise over the horizon in The Quiet Earth

There's more to an apocalyptic film than the end of life on Earth. How life ends says much about the film, its themes, and whether the audience will leave satisfied. The Quiet Earth, an underrated gem from 1985, shifts seamlessly from surreal abstractions to the concrete image of Zac lying on a beach then to the painterly image of clouds above the sea. As he walks to the water's edge, a ringed planet rises to greet him.

Simple yet robust, the film's imagery makes viewers fall in love with the world only to tear it away from them. The Quiet Earth will always be one of the planet's finest moments, though also its last.

5 Dead Or Alive

A bloodied man holds a rocket launcher in Dead or Alive

Takashi Miike is notorious for directing such films as Audition, Ichi the Killer, and the "Box" segment in Three...Extremes. Dead or Alive isn't a sci-fi film, a disaster film, an ecological thriller, or even a horror film. It's a yakuza crime thriller, featuring Miike's personal brand of weirdness and violence.

RELATED: What Makes It Follows Such A Popular And Enduring Horror Movie?

In the end, one of the gangsters reaches into his own chest and pulls out a fireball, which he then throws at his rocket launcher-wielding foe. The fireball produces a blast that consumes Japan and then expands to engulf the world. None of it makes sense, and all of it is amazing.

4 Melancholia

melancholia movie

Director Lars von Trier's apocalyptic art film includes fantastic performances from a powerful cast, including Kirsten Dunst, Charlotte Gainsbourg, and Alexander Skarsgård. Though it might sound obvious, searching for hope at the end of the world is a questionable endeavor, and those looking for a pleasant or optimistic end here will be disappointed.

Even by the usual standard of apocalyptic films, Melancholia is bleak. However, it's no less beautiful for that. Indeed, the final moments of Melancholia are arguably some of the most stunning of any film of its kind. It is less a film about planetary destruction than it is about the ravages of depression, even when planets literally collide.

3 Beneath The Planet Of The Apes

A gathering of apes in Beneath the Planet of the Apes

In many apocalyptic films, there remains a degree of ambiguity in the end. Does anyone survive at all? Is there any hope that the planet itself can recover from whatever catastrophe befell it? 1970's Beneath the Planet of the Apes leaves no such mystery.

RELATED: Underrated Blumhouse Horror Movies

After Taylor, played by Charlton Heston, triggers the bomb's activation in the subterranean city, the screen fades to white. The narrator then proclaims, "In one of the countless billions of galaxies in the universe lies a medium-sized star, and one of its satellites, a green and insignificant planet, is now dead." The war between apes and humans ends in as ugly a manner as it began.

2 Last Night

Sandra Oh's character sits on the stoop, looking exhausted in Last Night

Don McKellar's 1998 film Last Night is a black comedy that never flinches from its premise: the world is ending, people have known for a while, and there's nothing anything anyone can do to stop it. Last Night doesn't care about saving the world. It doesn't even care about why the world needs saving.

Instead, the film is preoccupied with another question: if everyone knew about the earth's imminent destruction and their inability to prevent it, what would they do? By exploring this question, Last Night arrives at conclusions that are simultaneously sweeter and more unsettling than most films in the genre.

1 Dr. Strangelove, Or How I Learned To Stop Worrying And Love The Bomb

Peter Sellers in Dr Strangelove

Stanley Kubrick's 1964 black comedy Dr. Strangelove, or How I Learned to Stop Worrying and Love the Bomb, is a surreal satire of the Cold War. Exceptional performances, including Peter Sellers as three different characters, help carry the film, but it's the image of Major T.J. "King" Kong riding a nuclear bomb down to its target, whooping and waving his cowboy hat the whole way, for which the film is iconic.

The activation of the Doomsday Machine activates numerous nuclear weapons, bathing the earth in radiation and rendering it uninhabitable for almost a century. Even if anyone survives underground, there isn't much of a world to return to.

MORE: This Underrated Horror Movie's Setting Is Haunted In More Than One Way