That's the banging at Miles's door, which jolts him awake and signals the start of Alexander Payne's terrific comedy, "Sideways." Someone needs Miles (Paul Giamatti) to move his car, which he has parked in an awkward spot. But more significantly, this is a moral wake-up call. The rumpled, depressed and extremely hung-over Miles needs to get his act together.

For the time being, however, Miles has to take care of someone else. His old college friend Jack (Thomas Haden Church) is getting hitched and wants Miles to accompany him on a last hurrah, a road trip through the Santa Ynez vineyards of California.

It sounds pleasant enough. But no sooner are they on the road when Jack confesses his real agenda. He wants to sow his wild oats before the wedding, and he wants the same for Miles, who's getting over a messy divorce. Miles, who was looking forward to a few days of wine drinking and golf, is appalled.

They couldn't be more different, these two. Miles is tightly wound, misanthropic and is desperately awaiting word from the publishers about his darkly convoluted first novel. Jack's gregarious to the point of goofy. He's a sexual predator with a telegenic smile. Miles, a wine connoisseur, holds his pinot up to the light, thrusts his nose inside the glass and takes in the bouquet. Then with great deliberation, he takes a sip. Jack tips his glass vertically and chugs.

(Rex Pickett, the author of the book on which "Sideways" is based, has said the difference between Miles and Jack is the difference between pinot and cabernet. The first is complicated, layered and difficult. The second is hardy and easily pleasing. Jack chooses to be indiscriminating. Miles, still beat up over that divorce, chooses to be disappointed.)

Director Payne and co-writer Jim Taylor, the team that gave us "Election," "Citizen Ruth" and "About Schmidt," have not only made the funniest, most assured film of their partnership (see Film Notes on Page 39), they've harvested one of the most pleasurable movies of the year. The characters are so enjoyably matched, you'd follow their endless squabblings anywhere. Add the scenic wonders of Santa Ynez, and two fiercely independent women who enter both men's lives, and you've got an irresistibly potent combination.

Jack sees his target almost immediately. Her name is Stephanie (Sandra Oh) and she happens to be friends with Maya (Virginia Madsen), a waitress who's been on Miles's radar for quite some time; he travels through this region often and likes to stop in at her restaurant, the Hitching Post. When Jack arranges a double date over dinner, there are romantic stirrings all around. It's the beginning of great anticipation for everyone, but also the onset of trouble. Jack "neglects" to mention his upcoming nuptials. And Miles, sworn into silence, fumes quietly, while he also battles unresolved fury at his ex-wife.

The women are ready for new beginnings. The guys need work.

There are so many good things to point to: great performances from the central foursome, for starters. Oh and Madsen are terrific on screen; they bring powerful balance to this battle of genders. "Sideways" isn't just a road picture about two hilarious losers, it's a great comedy about men and women. And the conversations between them are written with affecting care and depth. There's one particular scene between Miles and Maya, when both express their delight over wine drinking that perfectly explains what kind of people they are and how they belong to each other, if only Miles would get it.

Giamatti is a comedic gem, a walking rain cloud of despair who steals cash from his mother and refuses, absolutely refuses, to drink the wrong wine. Church, best known for his character Lowell Mather in the television show "Wings," is a revelation. He turns a cad into an unforgettable and, dare I say, lovable rogue. Those eyes brim over equally with lust and childish innocence. When a despondent Miles tells Jack he can't even commit suicide because he's not published yet, like the Hemingways of the world, Jack tries his best to be helpful. The guy that wrote "A Confederacy of Dunces," he reminds Miles, killed himself before he was published. So Miles could still.

Gee, thanks, Jack.

Payne hasn't just gone for verbal humor. There are sight gags galore. I hate to give too many away, but there's one that may amuse -- and haunt -- me to my dying day: It's an angry, tubby and very naked man chasing after Miles and Jack, brandishing his fists. Why he's so angry and what kind of trouble the two road pals just got into, well, you'd be happier and much more amused finding out for yourself.

SIDEWAYS (R, 124 minutes) -- Contains some violence, obscenity, sexual scenes, nudity and pot smoking. At Landmark's Bethesda Row and Loews Georgetown.

Jack (Thomas Haden Church, left) and Miles (Paul Giamatti) take one last road trip full of wine and women in the comedy "Sideways."