In the ten years he’s been directing movies, Ben Affleck has shown a rare ability to choose projects artfully and wisely, hitting creative and commercial growth rings with each new outing. His first film behind the camera, “Gone Baby Gone” (2007), established Affleck as a serious filmmaker with a flair for mood and performance and locale. In the soulful heist drama “The Town” (2010), he proved he could fashion a real yarn, even as he traced the fate of characters with a life below the surface. “Argo” (2012), of course, was Affleck’s home run: not just a movie that triumphed at the Oscars but one that caught the national mood — it was time to look back at the 1979 Iran hostage crisis — in a way that converted a (somewhat) true story of hot-button politics into a sizzling conversation piece.

That’s a sterling track record, which is why I’m far from alone in stepping up to a new Ben Affleck film with a tingle of anticipation. But his latest movie, “Live by Night,” a stylish and bloody gangster drama set in Boston and Tampa during Prohibition, hasn’t exactly been setting the awards season ablaze, and when you see it you’ll know why. Based on a 2012 novel by Dennis Lehane, the film is sharply written and crafted, lavishly photographed, impeccably acted, with lots of twists and turns — yet for all that, it somehow lacks zing. I say “somehow” because the flaw, or limitation, or whatever it is about “Live by Night” isn’t obvious. It’s like seeing the ghost of a terrific movie: All the pieces are in place, yet as you’re watching it (or thinking back on it afterwards), there doesn’t seem to be quite enough there there.

In “Live by Night,” Affleck plays Joe Coughlin, the dashing rogue son of a Boston Irish cop (Brendan Gleeson), who falls into a life of crime after getting the moral center knocked out of him by fighting in World War I. He starts by ripping off banks and card games, at which point he’s offered a job by Albert White (Robert Glenister), a hard case with scary teeth who runs the Irish Mob in Boston. Joe signs on despite the fact that he’s having a passionate affair with White’s girlfriend — a cynical chippie played with brash down-market style by Sienna Miller. That Joe is willing to carry on this relationship right under a mobster’s nose tells us two things about him: that he shrugs off risking life and limb; and that he’s a born romantic. When the affair is discovered, his life and limbs are indeed busted apart, but the fire in his heart still burns.

After serving three years in prison, Joe goes to work for Albert’s Italian crime-boss rival, Maso Pescatore (Remo Girone, suggesting Don Corleone played by Bela Lugosi), who orders him to go down to Tampa and run a multi-million-dollar bootlegging racket in Cuban rum. It’s in Florida that Joe settles into his life as a killer and profiteer who runs roughshod over the competition, because whatever fear he once had was beaten out of him. When he informs a go-between that his days with the Pescatore family are over, the poor lackey (played with lived-in Southern charm by the 48-year-old — and still terrific — Anthony Michael Hall) can’t believe what he’s hearing; the way Joe uses words to smack him around reminds you that part of the fun of the gangster genre is listening to threats made this blithely. Joe, along with his loyal runt of a sidekick, Dion (Chris Messina), stakes out his territory with the fierce cunning of a wolf. He knows how to cozy up to the chief of police, Irving Figgis (Chris Cooper), a pious Christian who rationalizes organized crime as a branch of Southern tradition, or how to face down a member of the Ku Klux Klan, or when to speak with bullets or the butt-end of his shotgun.

But here’s the thing about Joe: For all his Mob rule, he’s really an upstanding guy who wants his cut, wants everyone to be happy, and hasn’t stopped looking for love. Early on, he meets Graciella and Esteban Suarez (played by Zoë Saldana and the music star Miguel), a Cuban-émigré sister and brother who import the rum that’s distributed up north. Graciella, whom Joe has already locked eyes with at the train station, tells him that they aren’t going to be lovers. And so, of course, we wait for the two of them to fall into bed.

They do more than that: They fall in love. With no complication! Graciella isn’t a diva, a glorified moll. Saldana, speaking in a light Cuban accent, infuses her with a refined sensuality and makes her the soul of devotion; she even plans to open a shelter for women. And though Joe’s criminal career takes him into dark areas, the whole reason he’s doing it is to keep his soul in the light. Which raises the question: Are we rooting for Joe to be a successful ’30s crime king? Or are we rooting for him to be a good man? The film wants you to do both, but it’s trying to have its blood-soaked rum cake and eat it too.

A movie gangster can — and should — be a morally complex figure; it’s not like they all have to be Tony Montana. But watching “Live by Night,” it’s hard to shake the feeling that Affleck, who wrote the movie as well as directing it, was drawn to the material because it allowed him to express something personal — his desire, perhaps, to hold onto things of ultimate value (e.g., his family) in the face of his own propensity to walk on the wild side. He has tried to craft a moral tale of a gangster’s journey, but in “Live by Night” what that comes down to is that he’s telling the story of a vicious hoodlum who is actually a Boy Scout.

The first local to challenge Joe’s authority is RD Pruitt, a loathsome racist and half-crazy outlaw goon played by Matthew Maher, who uses his lisp and leer to create a real Southern-fried creep. He’s the kind of guy who’s begging to be rubbed out, but he happens to be the brother-in-law of Cooper’s police chief, so he’s got protection. This forces Joe to deal from the bottom of the deck: He has in his possession racy photographs of the chief’s daughter, Loretta (Elle Fanning), whose trip to California to become an actress didn’t work out so well. The collision of racism and raunchy scandal and blackmail suggests the kind of witches’ brew that James Ellroy used to cook up, yet the more Joe sinks into the mud, the cleaner he becomes. He springs those photographs on the chief with a touch of honest regret (really? Joe is someone who shoots his enemies in the head). And once RD and his KKK cronies have been neutralized, Joe sets about his master plan to open a huge casino, with the hope that gambling will be legalized.

He runs into the most ironic of stumbling blocks: Loretta, back from her descent into depravity, has become a born-again crusader against sin, and that includes gambling. She turns the whole town against him. Joe is given a direct order by Maso to “deal” with her, but he can’t. He’s too decent (or something); it’s like his tragic flaw. But it’s a flaw that comes off as a touch sappy, and it saps the movie of power.

You could fault Affleck’s performance, but he’s become a more commanding presence under his own directorial hand — he’s focused and sharp here, and looks great in those creamy period suits — and I’m tempted to say that Affleck the actor is subtly undercut, in this case, by Affleck the behind-the-camera shaper of his own image. A different filmmaker might have encouraged him to go to more ominously unexpected places. There’s a lot of surface energy to the pileup of incidents in “Live by Night,” but there’s still something cautious and staid about the material. Lehane’s story, though driven by currents of vengeance and “dangerous” passion, is all a little too worked out. Joe can be ruthless when he needs to, but he never does anything that shocks us (the way ambitious underworld dramas like the “Godfather” films, “L.A. Confidential,” or “The Sopranos” have hinged on shock). More to the point, he never does anything that shocks himself. “Live by Night” is full of incidental pleasures, but it’s so meticulously engineered it only pretends to have room for reality.