Every generation seems destined to produce its quota of coming-of-age tales, and this picture from writer-director Jonathan Levine (“All the Boys Love Mandy Lane”) aims to be a touchstone for the early-thirty age group to which he belongs. And there may be some who find it as personally compelling as, say, others once did “The Graduate.” For many, however, the picture will fail to strike the desired tragicomic nerve.

The year is 1994, the place a troubled New York City in which Rudy Giuliani has just been inaugurated as mayor, and the protagonist Luke Shapiro (Josh Peck, looking a lot grubbier than he did in Nickelodeon’s “Drake and Josh”), a graduating high-school senior. A rumpled loner, Luke deals with his outcast status, lack of a girlfriend and the horrid home life created by his parents’ (Talia Balsam and David Wohl) constant quarrels over money by dealing marijuana out of a sidewalk ice-cream cart. One of his clients is wacky psychiatrist Dr. Squires (Ben Kingsley), whom he pays in weed for professional sessions in which the shrink seems more interested in recalling the ups and downs of his own life than actually confronting his patient’s problems. Squires has domestic difficulties of his own: his wife Kristin (Famke Janssen) is turned off on sex. And the doctor is nonplussed by Luke’s revelation that he has a crush on his popular classmate Stephanie (Olivia Thirlby), who happens to be Squires’s stepdaughter.

“The Wackness” covers a summer over which the Shapiro finances crash and the family is forced to move from its prestigious apartment; Stephanie, with her usual crowd off on vacation, takes up with Luke and introduces him to the joys of sex; and Squires and the boy develop an unlikely friendship that even includes a working partnership with the kid’s supplier (rapper Method Man in a pretty convincing cameo). It’s divided by titles indicating the passage of months over the season, ending with a couple of sequences on Fire Island, a steamy one involving Luke and Stephanie and a darkly humorous one between Luke and Squires.

The most talked-about element in all this will probably be Kingsley’s rambunctious, take-no-prisoners turn as the shrink undergoing what amounts to male menopause. He revels in the libidinous, over-the-hill hippie shtick Levine’s written into the role (which includes trysts with both Jane Adams as an erstwhile musician and none other than Mary-Kate Olsen as a Central Park free spirit). It’s another in his recent string of amusingly overboard crowd-pleasing performances.

Peck, by contrast, makes a convincingly laid-back slacker—a far cry from the jittery doofus he plays on the tube but one that he handles decently. His big initiation scene with Thirlby is deftly done, but it means that this is hardly a performance his younger fans should be encouraged to see, at least not for a few years. The rest of the cast is able, but most have relatively little to do, with Janssen especially wasted.

The period look of the mid-nineties is nicely caught by the behind-the-scenes crew, and Petra Korner’s cinematography contributes a convincingly dank, gritty look to the pre-revival streets of the Big Apple. Equally important in creating the right tone is the soundtrack, which mingles a collection of songs from the time with suitably ripe original music by David Torn.

But despite its strong points, “The Wackness” never achieves the sort of visceral connection with the audience that the best rite-of-passage pictures have; even Kingsley’s performance, as enjoyable as it is, is like a vaudeville routine. According to a glossary of nineties slang helpfully included in the press notes, “wack” means “very bad, the worst,” so “wackness” would indicate the worst thing possible. That’s a bit too strong a term for this movie, but it’s on the right side of the ledger.