Seth MacFarlane has become a pop culture phenomenon with animated TV shows (“The Family Guy,” “American Dad!” and “The Cleveland Show”) that riff on the formulas of old situation comedies with lots of scatological gags, raunchy jokes and determinedly anti-PC humor. His sophomorically don’t-give-a-damn approach, which favors machine-gun laughs over plot, has had enormous appeal for the males in the late-teen, early-twenties age bracket that advertisers so avidly court.

In moving into live-action feature territory, MacFarlane has had to devote greater attention to structure than has been his custom, but the sensibility is pretty much the same. In the case of “Ted,” though, his models were apparently movies like “Gremlins,” which he melded with a Judd Apatow-ish tale of a man-child who must learn a bit of maturity to get the girl, and his own scattershot, take-no-prisoners approach to humor. The result has a few genuinely funny moments, but on the whole it’s repetitive and stale.

The first twenty minutes or so are the best thing in the picture. As we’re told by a fulsome-voiced (and occasionally digressive) narrator (Patrick Stewart), in 1985 a kid in Boston named Johnny (Bretton Manley) made a Christmas wish that the teddy bear he’d just received would really come to life. And it does. Now, over two decades later, the once plush-stuffed celebrity, voiced by MacFarlane, has become as much a forgotten oddity as the character Adam Sandler plays in “That’s My Boy,” and he’s a foul-mouthed, lascivious, pot-puffing layabout as well. But he’s still the best buddy of John (Mark Wahlberg), who’s stuck in a menial job at a rental car agency. In fact they still live together, to the increasing discomfort of John’s girlfriend Lori (Mila Kunis), a good-natured sort who’s put up with the arrangement for four years.

There’s the germ of a good idea here in the ephemeral nature of fame in today’s quick-disposal world, but that’s unceremoniously dropped in favor of an ultimatum from Lori—a successful businesswoman who, we’re asked to believe, has no other male prospects beyond John and her ultra-slimy boss Rex (Joel McHale)—that her boyfriend grow up and make Ted move out. Forced to make his own way, Ted gets a job at a supermarket, where we’re further asked to believe that his boss promotes him the more outrageous his conduct becomes. Of course bond between boy and bear proves too strong anyway, and a major faux pas—when John goes off during a date, no less, to join Ted at a party with one of their boyhood idols, Flash Gordon (aka Sam J. Jones, doing an extended cameo only slightly less humiliating than Vanilla Ice’s in “That’s My Boy”)—leads Brooke to break it off with him.

Their reunion, of course, is a foregone conclusion, but to get them there, MacFarlane resorts what is surely his worst script decision. He introduces a sicko dad (Giovanni Ribisi) so determined to procure Ted for his equally creepy son that he resorts to kidnapping. The material involving these two is so ugly and miscalculated—not to mention unfunny—that it should have simply been jettisoned in the editing room. It’s retention was demanded, however, by the fact that it leads to the big chase finale which takes everybody to Fenway Park, where Ted’s “life” literally hangs in the balance. (The locale looked better in “Moneyball.”) You’ll be happy to learn that for a resolution MacFarlane looks to “E.T.” for inspiration before bringing back Stewart for some obligatory (and largely tasteless) “what happened next” nonsense.

“Ted” is R-rated, and deservedly so. It’s filled with more drug humor than a Cheech and Chong movie, and a drinking game mandating everybody to down a shot every time a joke involving farts or poop occurred would put all the participants under the table before the halfway point. There’s plenty of slapstick violence too, including a knock-down, drag-‘em-out battle between Wahlberg and the bear that’s more nasty than funny. Wahlberg is a good sport through it all—including a spoof of the cliché in which a guy gets up publicly to prove his love for a girl—but he plays dumb all too easily. And Kunis is, as always, an agreeable comedienne. Technically things are okay, though frankly Ted just looks like Snuggles (from the tissue commercials) gone to seed.

Oddly enough, the recent movie that this one most resembles is another Universal misfire, “Paul,” about a foul-mouthed alien, which was itself an updating of TV’s “Alf” (directly mentioned here)—and wasn’t very good either. It’s all of a piece with MacFarlane’s practice of endless recycling. What his fans seem to forget is that every stage of duplication involves further deterioration.