In the middling ensemble dramedy “Thanks for Sharing,” Mark Ruffalo, Tim Robbins, Josh Gad and Alecia Moore (aka Pink) play members of a New York City support group for sex addicts.

Ruffalo is a tightly controlled environmental consultant celebrating five years of abstinence. Robbins is the wise old-timer of the group. His erotic compulsions are under control and he’s happily married to his high school sweetheart (Joely Richardson), though his anger issues boil up when his recovering-junkie son (nicely played by Patrick Fugit) arrives on his doorstep. Gad is the newbie, an obese young doctor struggling against several varieties of unhealthy appetites.

First-time director Stuart Blumberg (screenwriter of the Ruffalo adoption comedy “The Kids Are All Right”) takes a mechanical approach to dramatizing his characters’ struggles. Ruffalo, irresistible to women, is the opposite number of the slobbish Gad. Moore, who also attends a group for narcotics addicts, is a junior version of Robbins, who is a member of Alcoholics Anonymous. Gad can’t stop overeating. Ruffalo’s potential love interest, played by Gwyneth Paltrow, is an exercise and diet freak with serious body issues. The character arcs intersect so schematically that at times the film feels like a game of 12-step bingo.

The movie is far from a total misfire, though. It’s observant about the sex-saturated media environment that could make a simple walk down a city street into an assault on a sexually sensitive pedestrian’s senses. The list of no-nos for Ruffalo’s character (laptop computers, smartphones, hotel-room TVs) is a telling comment on how all-pervasive provocative images have become in our wired world. His hesitance to open himself up romantically given his history of broken love affairs is touching. Even a warm, consensual session with his new girlfriend, who knows his background, can set off troubling reactions.

Blumberg’s over-tidy plotting is the film’s greatest weakness. The actors deliver bluntly expository dialogue, telling us what we need to know about them and how we ought to feel about it. A better approach would have been to empty out the messy Pandora’s box of addiction problems and let us pick our way through it without editorial prompting.

Only one sequence takes this approach, and it’s the film’s most effective part. Emily Meade plays a fellow sex addict and former lover of Ruffalo’s who reunites with him when he hits a low point. Their erotic play begins mildly, turns harsher and darker, and without warning erupts with the twisted passion that this perverse, irrational subject matter deserves.