Warning: SPOILERS ahead for Old and Sandcastle.

M. Night Shyamalan's new beachside horror Old is based on the graphic novel Sandcastle, by Oscar Lévy and Frederik Peeters. But while Old and Sandcastle share the same basic premise and a few plot points, Shyamalan's film goes a lot further in explaining the central mystery and also chooses to give its characters a happier ending.

Starring Gael García Bernal, Vicky Kriepps and Alex Wolff, Old is set on an idyllic beach that has an insidious and ultimately lethal effect on anyone who spends time there. For every half-hour that passes, people on the beach physically age by a year, reducing their lifespans to a single day. With the clock ticking, the people trapped on the beach must find a way to escape before they die of old age.

Related: What Song Maddox Sings In Old

In 2017, Shyamalan shared on Twitter that Old was one of the graphic novels he was reading in search of inspiration while writing the screenplay for Glass. In an interview with Entertainment Weekly,  Shyamalan explained that the graphic novel was given to him as a gift by his daughters. "I kept it in my bag and kept thinking about it," the filmmaker said. "The graphic novel is almost picture-perfect as a trap for me because it's incredibly visual and Twilight Zone–y and it has an enigmatic ending." Shyamalan was compelled to adapt the graphic novel by a desire to "finish this story, and put it up on screen." Here's how Old's adaptation of Sandcastle is both similar and different to the original story.

How Old and Sandcastle's Stories Are Different

Old Movie Sandcastle

The plot elements of a mysterious resort and a nefarious manager who tricks people into going to the beach aren't really present in Sandcastle, though the story does begin in roughly the same way. A young woman takes off her clothes on the beach and goes walking into the ocean, watched from the shore by a man (though in the graphic novel the man is Amesan, a Kabyle jeweller from Algeria, not a semi-famous rapper called Mid-Sized Sedan). Several groups of people arrive at the beach, starting with a mother and father and their young son and daughter. When the young woman's body is found in the water, alarm spreads through the group, which is only further compounded when they realize how quickly they're ageing. An elderly woman dies first, followed by a dog, and the children grow up into teenagers. Two of the teens have sex, and the girl goes through an extremely accelerated pregnancy.

It's here that Old's story diverges from Sandcastle's in a major way. In Shyamalan's movie, the baby dies from starvation after less than a minute, since it's established that children on the beach need large amounts of food to sustain their rapid accumulation of mass. For the baby, a minute without food was the physical equivalent of weeks, and it was too delicate to survive the beach's rapid ageing effects. In Sandcastle, however, the baby lives and is ultimately the last person in the group who is left alive at the end of the story.

Old's story about the vacation resort being a cover for a pharmaceutical company that uses the beach to experiment on people with particular diseases was built out of some smaller moments in Sandcastle. In the graphic novel, one of the unlucky beachgoers is a science fiction writer who proposes a few different theories for what could be happening to them. He suggests that perhaps the beach was the result of a cosmetics company trying to create an anti-ageing "fountain of youth," or that it could be some kind of social experiment. At one point the group sees José, the son of the hotelier, running towards the beach only to be gunned down by unseen shooters before he can reach them. In Old, this puzzling and unexplained detail is broadened and becomes a key to the movie having a happy ending (or at least, a happier ending than the source material).

Related: Every Character M. Night Shyamalan Played In His Own Movies

How Sandcastle Ends

Sandcastle Graphic Novel Ending

Unlike Old, where the people on the beach are panicked and desperately trying anything they can think of to escape, the group in Sandcastle accepts their fate more passively. After it becomes clear that the beach is surrounded by a force that won't let them leave, they more or less give up on escaping and focus alternately on lamenting their fate and trying to make the most of their suddenly shortened lives by throwing a party. As they near the end of their lifespan, Marianne (the character analogous to Prisca in Old) reaches out to her husband, Charles (the character upon whom Guy is based) and asks him for some "tenderness" before she dies. But unlike the movie adaptation, the couple does not reconcile. Charles ignores Marianne in favor of building a sandcastle, and keeps building until he keels over into it face-first and dies.

Eventually, all of the people who originally arrived at the beach die of old age. The only person left alive is the baby who was born on the beach, now an adult woman, who wakes up and is horrified to find her mother and all the other people she knows dead. With nothing else to do, and no hope of escape or even awareness of the outside world or just how severely her life has been shortened, the woman begins to build a sandcastle.

How Old Ends

Old Trent and Maddox

Old has a considerably happier ending than Sandcastle, though the movie still has a high body count and features more violent deaths, such as Kara falling from the cliff and Chrystal's calcium deficiency causing the horrifying mangling of her body as her bones break and instantly heal at odd angles. Eventually Maddox and Trent, now physically in their 50s, are the last two people left alive on the beach. Like the characters in Sandcastle, they are approaching their deaths with a strange sense of calm. However, it occurs to Trent that the resort manager's son, Idlib, gave him a coded message that he had yet to figure out. He translates the cryptic message, which gives them the clue that the nearby coral reef is their only means of escape. Before their final attempt at leaving the beach, Trent and Maddox sacrifice another year or two of their lives by taking the time to build a sandcastle together.

When it appears that Trent and Maddox have drowned in the coral, Old reveals that they were merely the latest test subjects for a pharmaceutical company that is using the beach's rapid-ageing properties to test the efficacy of new drugs over time. As the resort manager is preparing to welcome the next batch of test subjects, Trent and Maddox return to the resort with evidence of all the people who have gone missing on the beach, which they hand to a police officer staying at the resort. The pharmaceutical company's employees are all arrested, and the movie ends with Trent and Maddox flying away from the beach in a helicopter. It's certainly a neater ending, but arguably lacks the poignancy of Sandcastle's final image.

Related: Old Movie Ending & All Twists Explained

The Biggest Differences Between Sandcastle and Old

Sandcastle Half-Man Story

Perhaps the biggest difference between Old and Sandcastle is genre. Shyamalan uses the concept from Lévy and Peeters' graphic novel to create a horror movie, with a more immediate sense of danger and scary moments like Chrystal pursuing Trent and Maddox through the caves as her body becomes more twisted and broken. The beach's powers go unexplained in Sandcastle, but Old goes into a lot of detail about why the beach ages people (it's due to unusual properties in the rocks surrounding it), why people black out when they try to leave, and why exactly the victims of the beach were lured there. It feels a lot more like science fiction than the magical realism of the graphic novel.

Whereas Old shows a keen interest in exactly why the beach does what it does, Sandcastle instead uses the rapid ageing as a way to explore how people live their lives and the regrets that they have as they get older. Towards the end of the graphic novel, when the group has accepted their fate, Amesan tells them a story about the death of a king. In the story, the king is visited by a half-man who proclaims he is a messenger of death and has come to collect the king's soul. Not ready to die, the king begs for another seven years of life. The half-man grants him a pardon, with the catch that he will return at some point in the next seven years, but the king won't know when exactly he'll appear.

Determined to keep death away, the king orders a great fort to be built around him and tells his staff to send anyone who visits away from the gates. Over the next seven years, the king sits in his fort alone as his porters turn away his wife, his daughter, and his son when they try to visit him. In the seventh year the half-man returns, unaffected by the walls of the fort, and tells the king that he will die in the tomb he has made for himself. Too late, the king realizes that he has wasted the precious extra time he was given by spending seven years worrying about when and how he was going to die, instead of spending however much time he had left with his family.

In Sandcastle, the beach is much like the half-man in the story; it forces the characters to realize that they'll soon be dead, and the true meaning of the story lies in how they spend the time they have left. Old has been criticized in reviews for losing sight of this deeper meaning at the expense of over-explaining the mechanics of the beach. However, Shyamalan's adaptation does bring in the slower philosophical moments of the comic in more subtle ways, such as when Guy and Prisca (now reaching the end of their lives) realize that they can no longer remember why they were so keen to leave the beach, and instead simply allow themselves to appreciate being together as a family. Trent and Maddox's decision to build a sandcastle before swimming for the coral demonstrates that they've learned the same lesson; even if an hour on the beach costs them two years of their lives, then at least they'll have spent those two years with someone they love.

More: Will Old 2 Happen? Everything We Know About A Sequel