At one point in this vampires-on-a-rampage flick, based on a 2002 comic book mini-series, the head bloodsucker, played with a mouthful of prodigious teeth by Danny Huston, reminds his crew that they’ve worked for years to make humans believe that they were only “a bad dream.” “30 Days of Night” should succeed in achieving that objective in slightly under two hours. The gory, gruesome picture, directed by David Slade, whose previous film “Hard Candy” was equally violent though on a much smaller scale, doesn’t go the tongue-in-cheek route, but by the close it’s pretty risible in spite of itself.

Actually the script, credited to Steve Niles, who wrote the comic, along with Stuart Beattie and Brian Nelson, boasts a promising premise: an Alaskan pipeline town, where the sunlight disappears for a full month every winter, is cut off from the world when its power sources are destroyed by a hungry group of vampires, who make use of the prolonged darkness and cold to feed on the inhabitants. A small group of survivors try to elude the predators until the sun returns to save them. The result is like a combination of two John Carpenter movies—it’s “Assault on Precinct 13” in the milieu of “The Thing.”

Technically, too, the movie is a cut above the usual genre level. The locations look authentically chilly—a credit to Paul Denham Austerberry’s production design and Nigel Churcher and Mark Robins’ art direction—and Jo Willems’ cinematography gives the widescreen images an appropriately dank, gloomy look, even though one finds oneself constantly questioning the sources of light needed to make the figures viewable.

And the picture has been cast more starrily than this sort of thing usually is, too. In addition to Huston, there’s Josh Hartnett, who tries to add some layers to the stock heroic role of Eben, the town sheriff who becomes the de facto leader of the resistance. Melissa George is Stella, his estranged wife (or girlfriend) who’s stuck in town despite her efforts to leave before sunset. And Ben Foster even shows up in what might be called the Renfield role as the maddened human stranger who comes to town to prepare the way for his undead masters. Some would say, in fact, that these parts had been too strongly cast. Huston is game, but hobbled by those huge choppers and the need to deliver his dialogue in some foreign tongue that’s subtitled for our delectation, and Foster’s done a similarly maniacal bit too often (see “Alpha Dogs” and “3:10 to Yuma”) to avoid seeming repetitive. But Hartnett’s the worst offender: Eben’s written as an angst-ridden fellow, but the actor’s halting, hesitant performance keeps damping down the energy level well below the simmering point. For some roles, it’s not smart to search for too many nuances.

But the actors aren’t really the main problem; it’s the script that pretty much dooms the movie. In its episodic way, after the obligatory stage-setting prologue it becomes merely a succession of chases and fights in which characters successively bite the dust (or snow in this case) to reduce their number to the tiny crew you can pretty much predict will survive. Among these deaths, there are inevitably quite a few that exhibit noble self-sacrifice. And the trajectory of things is never much in doubt (you can be sure, for instance, that the large trash compacter you glimpse toward the start is fated to reappear in the big finale).

But the fatal flaw of “30 Days of Night” is its failure either to make the town’s geography clear, so that all the running from place to place seems purely arbitrary (as well as absurdly easy, given the purported tracking skill of the vampires), or—more importantly—to give a real feeling of the passage of time. It’s not enough to have Eben grow some stubble, or to abruptly insert a crawl saying “Day 7” or “Day 18.” Whatever its problems were, “28 Days Later” made you think that its characters were actually forced to endure hiding from the infected for long periods; here, the sheriff and his crew apparently hole up in an attic for a week without much ill effect or inconvenience. The whole month-long aspect of the plot never really rings true; it all feels as though it were happening in a couple of hours (unlike Carpenter’s “Thing,” which was claustrophobically—and chronologically—convincing).

And even in a vampire movie, there needs to be that underlying sense of reality to allow a suspension of disbelief. Despite all its craftsmanship, “30 Days of Night” doesn’t deliver that any more than “Hard Candy” did. As a result, it’s certainly bloody, but not bloody good.