Science fiction is often the genre that holds the most optimistic musings of mankind as it looks towards our future and what it may hold. Much more often, however, it's home to the greatest nightmares of the artist's mind as they consider the certain doom that lies ahead.

As most people know, the first sci-fi story was probably Mary Shelly's Frankenstein, but as the concept grew and became larger in scale, the fate of the Earth became a common topic. Whether comedic or horrific, action-packed or tragic, there are countless ways people can imagine their home planet being obliterated. Spoilers ahead for every film mentioned, but the end of the Earth isn't always the end of the story.

RELATED: 5 Underappreciated Sci-Fi Comedies

Hitchhiker's Guide to the Galaxy

hitchhikers-guide-movie Cropped

Douglas Adams' iconic work of sci-fi absurdism remains one of the most influential texts in modern pop culture. It's been directly adapted to radio plays, video games, and TV shows, but in 2005, it finally became a feature film. Every sci-fi fan knows the basic outline of the story. Mild-mannered human Arthur Dent is brought on a spectacular journey throughout the universe by his alien friend Ford Prefect.

On the way, they meet bizarre creatures, brilliant automatons, endless incalculable rules of engagement, and learn everything they can about the depths of space. Dent's journey begins when Prefect alerts him to the upcoming destruction of the planet Earth. As it happens, the Earth is unceremoniously annihilated to make way for an interstellar bypass highway. Here, the global destruction is very early in the plot and an extremely minor detail of the story. One of the more uplifting takes on the sudden end of the world.

Knowing

knowing-movie-nic-cage Cropped

This 2009 bizarre apocalyptic sci-fi epic is barely remembered, and what is recalled about the film is exclusively around the performance of its lead actor. Nicolas Cage stars as an astrophysics professor who stumbles upon a mysterious series of numbers that seem to predict a nightmarish event to come. Cage is as unhinged as would be expected, running around screaming and arguing as the only man convinced that the world is ending. The film was a financial success, but most critics tore it apart. Roger Ebert, strangely, gave it a perfect score and seemed to think it was a masterpiece, but that is not the consensus.

Regardless of its intrinsic quality, the film does end spectacularly. Cage's mystical numbers do hold a tragic secret, and sure enough, the Earth comes to an end. A solar flare burns the Earth to cinders, but don't worry, aliens abduct the children and bring them to safety. This movie deserves more discussion.

Cabin in the Woods

Cabin in the Woods floating key art

It's worth debating whether this mind-bending horror film counts as sci-fi, but those who know the big twist of the film are aware that it breaches that genre. Drew Goddard's directorial debut is a deconstruction of classic teen horror films that turns into something very special early on. Throughout the film, it becomes clear that the nightmares the main characters are forced to face are being engineered by a clandestine organization.

The film goes on to reveal the need behind the piles of dead teens. The hand-made horror situations are entirely to please some sort of eldritch horror that threatens to end all life on Earth if they are not sated. Sure enough, the heroes rebel against their destiny and decide that a system that relies on death doesn't deserve to stay in place. By resisting the system, they awaken the wrath of something inconceivable. The last shot of the film depicts a massive lava-like hand punching through the ground before its destructive conquest of the planet. The destruction is implied but conveyed so powerfully that it's undeniable.

Beneath the Planet of the Apes

beneath-planet-apes Cropped

The second film in this venerable franchise was a controversial follow-up to its iconic predecessor. While the first film is a classic, this one did not reach anywhere near the same cultural cache. Instead, the film kept neither the director nor writer of the original film and attempted to tell a new story in the established canon. Fans will recall that the big twist at the end of The Planet of the Apes is that the eponymous world is Earth, countless years after the fall of mankind.

The second film sees people discover an underground city populated by mutants. The film ends with a tragic struggle over the detonator for a massive bomb. As multiple characters die trying to stop him, Dr. Zaius makes his final action count by destroying the Earth with the press of a button. The film's final narration is a touching short poem about the end, then the movie somehow managed to have three sequels.

Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb

Peter Sellers in Dr Strangelove

This satirical black comedy comes from the mind of Stanley Kubrick to deal with one of the most common sci-fi themes; humanity's relationship with technology. The film concerns a former Nazi scientist who aids the US in the nuclear conflict with the USSR. Blown to ridiculous proportions, Kubrick wrings absurdist comedy from the nightmare scenario. Most probably know this already, but it doesn't end well.

After every character makes every wrong decision imaginable, the time comes for the worst choice ever made. Sure enough, convinced of the inevitability of the end, the bombs are dropped. The world is blanketed in nuclear fallout forever. Despite this, Strangelove is one of the funniest films ever made and is a must-see for any audience.

MORE: 25 Years Later, The Fifth Element Is Still An Enigmatic Sci-Fi Classic