Pierre Boulle – the author of the original novel Planet of the Apes, which served as the basis for the durable movie and television franchise – believed his work could never be successfully filmed, and a number of people agreed with him. The sheer logistics of presenting an entire society of intelligent simians was daunting in the 1960s, when everything required practical effects, to say nothing of a story that required an exceedingly delicate hand to render properly. The fact that it happened at all was something of a miracle.

It also came with a much different ending than originally intended. The novel's finale was steeped in Twilight Zone-style irony but lacked the dark power of the first movie’s iconic final shot. The production process for the movie reflected Boulle’s belief in the difficulty of the task, while the early drafts of the script reflected how difficult it was to arrive at the movie's conclusion. Indeed, at least one earlier draft offered more hope for humanity.

RELATED: Matt Reeves Is the Perfect Director for This Non-Batman DC Movie

Discovery of the Statue of Liberty on The Planet of the Apes

Boulle’s novel ends with a double twist. A framing device depicts a pair of astronauts who find a message in a bottle relating the events of the story, in which a human space traveler finds himself trapped on the titular planet where simians rule and humans are brute animals. He eventually escapes and returns to Earth, only to find that apes rule there, too. The novel ends with a return to the framing device, in which the astronauts are revealed to be a pair of chimpanzees who refuse to believe that humans were ever intelligent.

That proved a very tough nut to crack when delivering it to the big screen. In the documentary Behind the Planet of the Apes, Boulle evinced skepticism that any adaptation was possible, and indeed producer Arthur Jacobs had to produce a number of proof-of-concept elements before any studio would sign off on the project. That included an initial script by Rod Serling, who was completing work on The Twilight Zone. His script ultimately proved unworkable, though the finale – with the human hero falling to his knees before the shattered Statue of Liberty – ended up in the completed movie.

RELATED: The Batman, Venom's Andy Serkis Weighs In on the Age-Old Marvel vs DC Question

With Serling’s script deemed unfilmable, writer Michael Wilson was brought in to revise it. He solved a number of the book’s thorniest challenges, including presenting the ape culture as more primitive than the modern society described in the book. It saved on costs and allowed the movie to be made on a reasonable budget. Wilson is also credited with adding the film’s satirical tone and social messaging, which have remained staples of the franchise ever since.

He played with a happier ending too, at least in the initial drafts. While Serling’s darker finale was too perfect to deny, Wilson added a ray of light. The hero, Taylor, is killed by apes after seeing the Statue of Liberty, but his mate Nova escapes along with their unborn child, providing hope that humanity’s intellect and moral compass can be restored, something neither Serling’s version nor the sardonic novel could claim.

There’s no question which ending was the right one. In addition to its perfect, silent twist, the film arrived in the middle of colossal social upheaval: opening one day before the assassination of Martin Luther King Jr. in 1968 and running in theaters through the summer and autumn that followed. Had it offered a more hopeful view, it might have missed some of the zeitgeist that made it such an ideal comment for its time and place. The ensuing franchise may have looked much different, or never come across at all, as well as ruining what many fans believe is the greatest ending in cinematic history. A happier finale for humanity may still be in the cards, since more movies in the franchise are very likely on their way. But for something like Planet of the Apes, a happy ending might not necessarily be the right one: something the producers of the first film understood very well.