“DodgeBall” is as juvenile and lowbrow as the game itself, but it’s also surprisingly funny. The debut feature from writer-director Rawson Marshall Thurber certainly won’t win any prizes for sly wit or subtlety (James Thurber this fellow certainly is not), but like the Farrelly brothers’ “Kingpin,” it proves a likably goofy riff on the conventions of sports movies, and it boasts a fine ensemble cast that proves capable of seizing all its opportunities for broad farce and running with them–on and off the “court.”

The premise of Thurber’s piece is about as pure an example of old-fashioned hokum you’re likely to encounter all year. Peter La Fleur (Vince Vaughn) is the laid-back, wisecracking owner of a run-down neighborhood gym called Average Joe’s. The joint is in hock to the bank, and White Goodman (Ben Stiller), the supremely self-absorbed, obnoxious owner of a flashy joint called Globo Gym who’s had run-ins with Peter in the past, decides to buy up the note and shut the place down. The only way Peter and his passel of eccentric regulars can think of to get the dough needed to keep their hangout open is to win an upcoming dodgeball championship and use the prize money to pay off the debts. The Las Vegas competition will, of course, end up in a showdown between Peter’s team and a group of huge rivals headed by Goodman himself. It will also involve the obligatory romantic interest, Kate Veatch (Christine Taylor), a banker White hires to go over Peter’s books but who joins the Average Joe team after Goodman clumsily makes a move on her, and a staple of the genre–the crusty old coach who comes out of retirement to whip the hopeless players into shape. In this case it’s a guy named Patches O’Houlihan, who’s played in an old school training short by Hank Azaria but shows up fifty years later in the form of grizzled, wheel-chair bound Rip Torn.

This is all just the thinnest skeleton on which to hang a string of loud, dopey gags in which the extravagant characters Thurber’s created circle around the unflappable La Fleur. Lots of them involve the hapless Average Joe’s guys getting clobbered repeatedly by balls (or just the word “balls,” of course)–or in some cases by wrenches thrown at them in practice sessions by the amiably maniacal O’Houlihan. It’s difficult to explain why these bits of violent farce aren’t offensive, but they’re really not. That’s probably because the cast has been so cleverly assembled. Vaughan plays La Fleur like an overaged frat brother, and his low-key, slightly underhanded charm is appealing; Taylor is perky without being grating, and Torn lays on the comic gruffness efficiently. But it’s the Average Joe’s roster of players that really keep things chugging along: Justin Long as the geeky high-school kid who’s always wanted to be a cheerleader, Stephen Root as an even dorkier fellow with a mail-order bride, Joel David Moore as a gawky clerk, Chris Williams as the fastidious black guy, and Alan Tudyk as a dude who, for some reason, dresses up like a pirate. The players are all good enough to make this bunch of oddballs agreeable. There are also amusing contributions from Gary Cole and Jason Bateman as the “ESPN-8” commentators of the televised matches; their riffs are pretty obviously modeled on the superior ones by Trevor Beckwith and Fred Willard in Christopher Guest’s “Best in Show,” but Cole in particular has some great lines, and Thurber’s mounting of the various stages of the competition in the style of the old fighting montages from crummy martial-arts flicks, complete with absurdly flamboyant teams, is dead-on. The production design by Maher Ahmad, costumes by Carol Ramsey and photography by Jerzy Zielinski help here, too. There are also some well-chosen cameos by such unlikely types as William Shatner, David Hasselhoff, Chuck Norris, and Lance Armstrong.

On the other hand, the Stiller side of things isn’t nearly as successful. White Goodman is, in his own way, a funny character, his obtuseness matched only by his vanity; and the impeccably coiffed hair and spandex-centered outfits are eye-catching. But Goodman is essentially a sketch figure whose eccentricities are hard to sustain over feature length, and Stiller remains at full throttle throughout, with exhausting results. Nor are the heavily-muscled troupe surrounding Goodman all that funny, even if one is a steroid-fed amazon from old east Europe. As a result the entire Globo Gym part of the comic equation doesn’t quite hold up its end.

Still, there’s enough good stuff in “DodgeBall” to make it, erratic and uneven as it is, closer to “Kingpin” than to “BASEketball” among sports-based farces. Though the trailer might make you try to avoid the movie as much as an uncoordinated, bespectacled tyke does P.E. class, if you give it a chance you may find yourself laughing a lot more than you’d expect.