In M. Night Shyamalan’s latest thought experiment, Dave Bautista brings the end of the world to a peaceful country cottage.A little girl, out collecting grasshoppers in the forest, meets someone who might be described — if this were a picture book — as a friendly giant. His huge arms are covered in tattoos, and his demeanor walks a fine line between gentle and fearsome.His name is Leonard, and his new acquaintance, just about to turn 8, is called Wen. Since this is a movie by M. Night Shyamalan — and a pretty good one, all things considered — a sinister vibe creeps in around the edges of their first encounter. The colors are uncannily bright, the close-up shots unnervingly angled (Jarin Blaschke and Lowell A. Meyer are responsible for the 35-millimeter cinematography). The music (by Herdis Stefansdottir) hums with menace. Something scary is about to happen.What happens is a version of what former philosophy students and debate-happy internet smarties will recognize as the Trolley Problem, a chestnut of hypothetical ethical disputation. Would you, the classic version goes, run over one person with a trolley if doing so meant you could save five people on the other track? The variation that Leonard (Dave Bautista) proposes to Wen (Kristen Cui) and her family is at once grander and more intimate. Would you sacrifice yourself or someone you loved to prevent a global apocalypse?Think fast! But don’t, maybe, think too hard about the premise and the narrative scaffolding of this itchy, claustrophobic, metaphysical thriller, which Shyamalan adapted (with Steve Desmond and Michael Sherman) from a novel by Paul Tremblay. Leonard is accompanied by three other believers in his end-times scenario: Sabrina (Nikki Amuka-Bird), Adriane (Abby Quinn) and Redmond (Rupert Grint). Strangers until very recently, they received identical visions of flood, plague and darkness. They believe this cascade of catastrophes will come to pass unless Wen or one of her dads, Eric (Jonathan Groff) and Andrew (Ben Aldridge), volunteers to die.Why them? Is it because Eric and Andrew are a gay couple, or because they happen to have rented an unlucky vacation property? Surely not the first thing: Sabrina insists on behalf of the group that “we don’t have a homophobic bone in our bodies.” Even if that doesn’t turn out to be true (Redmond has some ugliness in his back story), the real estate seems like a more plausible explanation. The movie is called “Knock at the Cabin” (the book is called “The Cabin at the End of the World”), and the house, with its remote location, floor-to-ceiling bookcases, dark wood paneling and deep cellar, looks like a perfect place to host a horror movie.Is “Knock at the Cabin” one of those? That’s another topic for debate. Shyamalan is sometimes classified as a horror auteur, but the genre label doesn’t always fit with his themes and methods. While this movie is suspenseful and (discreetly) bloody, it is more interested in thoughts and tender sentiments than in fright or shock.The story isn’t coiled around a clever, rug-pulling twist — a sometimes tiresome, sometimes bracing Shyamalan signature — so much as balanced on a series of simple binaries. Either Leonard and his pals are telling the truth or they’re out of their minds. Andrew and Eric will believe them or not. The film’s effectiveness depends on what occurs on the way to the answers, and in this respect Shyamalan’s wit and sincerity serve him and the audience well.Granting the preposterousness of the whole idea, he is genuinely nonetheless curious about what it would be like to have this kind of experience. Whether Leonard is the kindly schoolteacher and reluctant prophet he claims to be or the leader of a small and lethal doomsday cult, he tries to be sensitive to the predicament of his captives. The rules of the vision forbid him or his colleagues from performing the sacrifice themselves, so they engage Eric and Andrew in a lengthy, sometimes brutal seminar, with occasional news broadcasts to emphasize their argument.A handful of flashbacks of Andrew and Eric’s life as a couple — including their adoption of Wen — makes them seem like more than panicked, generic victims, while also opening up the occasionally stagy action. Aldridge and Groff do what they can to overcome the blandness of the characters, but the movie really belongs to Bautista and Cui, who provide the danger, charm, wit and grit that it needs to be even remotely credible.I wish it were more than that. There is a grandiosity here that’s hard to swallow, and a final swell of emotion that isn’t quite earned. For all its skill and cunning, “Knock at the Cabin” is an overwrought quasi-theological melodrama that also manages to be a half-baked thought experiment. It’s a thrill ride in a toy trolley.Knock at the CabinRated R. You see dead people. Running time: 1 hour 40 minutes. In theaters. More