Don't panic: The long-awaited film adaptation of Douglas Adams's beloved science-fiction cult novel is not the disaster it might have been. There are inspired performances and belly laughs. Adams's tricky tone -- imagine the Pythons rewriting ''Star Wars" -- has made it onto the screen. The answer to life, the universe, and everything is still 42.
Yet ''The Hitchhiker's Guide to the Galaxy" is not the interstellar home run it might have been. Some of the film's most inspired scenes involve an Infinite Improbability Drive, which pops travelers from one side of the universe to the other and briefly transforms their spaceship into a giant apple, or a rubber duck, or a chrysanthemum, before letting it resume its normal state. The movie's like that, too: visually playful and often good fun, it never settles on a convincing narrative shape.
Still, it's impossible to dislike a film where the hero, a mild-mannered Englishman named Arthur Dent (Martin Freeman, from the BBC's ''The Office"), traverses the universe in his bathrobe because Earth was destroyed before breakfast. It turns out that while Arthur was fretting about a planned highway bypass running through his house, a Vogon Constructor Fleet is about to put a galactic bypass through the planet as a whole. Earth perishes not with a whimper or a bang, but a soft, silvery whoof.
By good chance, Arthur's best friend, Ford Prefect (Mos Def), is an alien researching Earth for the famous Hitchhiker's Guide to the Galaxy, and so pulls the hapless human into space and onto a Vogon ship. The Vogons look like slimy potato sacks designed by the Henson Creature Shop -- which is pretty much what they are -- and they write poetry bad enough to liquefy a listener's brain.
How Arthur and Ford come to travel on the Heart of Gold, a spacecraft commandeered by galactic president and preening idiot Zaphod Beeblebrox (Sam Rockwell), will be overly familiar to anyone who has read Adams's 1979 novel and its four sequels in the ''increasingly inaccurately named Hitchhiker's Guide Trilogy" or listened to the late-'70s radio series or watched the 1981 BBC miniseries or played the 1984 videogame or read the early-'90s DC comics. Those without a clue may be better off.
Adams had the gall to die in 2000 after completing a first draft of the script; Karey Kirkpatrick (''Chicken Run") finished the job and music-video director Garth Jennings shepherded the results to the screen. Which means that while ''Guide" is infused with the profound playfulness of its creator, there's frustratingly little follow-through. The film opens with the transcendent dolphin musical number ''So Long, and Thanks for All the Fish" and shortly thereafter presents us with an all-yarn action sequence. These scenes put a manic grin on your face that slowly and surely fades.
But what's good about the film is good indeed. The animated Guide sequences, designed by the London-based design outfit Shynola, are fast, clean, and clever -- just the sort of crisp anarchy Adams relished. The oddball casting by veteran Susie Figgis pays off: I'd never thought of rapper-turned-actor Mos Def as a slapstick comedian, but he gets Prefect's hapless aplomb just about right, and he does a mean double take. Alan Rickman provides the clinically glum voice of Marvin the Depressed Robot, even if that's Warwick Davis running around in the suit, and John Malkovich shows up briefly as a religious leader named Humma Kavula. Jason Schwartzman literally channel-surfs by in one scene.
''Guide" fanatics may be outraged, however, that Zaphod doesn't have two heads, side-by-side, as in the book; instead, they're stacked one atop the other, with the bottom one popping out like a yammering id every so often. (The effect is like having Owen and Luke Wilson in the same body.) The upside is that Rockwell pulls out all the stops as a fatuous galactic leader with half a brain, a down-home accent, and the knowledge that elected presidents are mere political diversions. Any similarity to current world leaders is a matter of your own convictions, but the sting's there if you choose to feel it.
Elsewhere, the sting is sadly missing. ''Guide" loses momentum as it boinks from planet to planet, and the romance between Arthur and his fellow earthling Trillian (Zooey Deschanel) is actually allowed to become serious. Perhaps this represents kowtowing toward box-office inevitability, but it also represents kowtowing away from Douglas Adams, who never in his life allowed sentiment to gum up the works.
But Deschanel is a sweetie, as always, and there are rich scenes amid the clutter, one involving a ''point-of-view" gun that does just what it says (threatened with it, Deschanel gets off one of the best slow-burning one-liners I've heard in a while). And, startlingly, ''Guide" trips into a moment of honest grandeur when Slartibartfast (a rather hesitant Bill Nighy) gives Arthur a tour of the factory floor where planets are built, and, for an instant, the movie becomes something more than the sum of its amusing, distracted parts.
''Hang the sense of it and keep busy," says Slartibartfast, diffidently offering Arthur his guiding philosophy of life. ''I'd rather be happy than right." Off beyond the edge of the universe, you just may hear Douglas Adams laughing.
Ty Burr can be reached at email@example.com.