Though it certainly won’t please purists, this second Guy Ritchie picture treating Sir Arthur Conan Doyle’s cerebral detective as a period action hero is an improvement on its 2009 predecessor. “A Game of Shadows” still suffers from Robert Downey, Jr.’s smugness as Holmes and from Ritchie’s penchant for explosive set-pieces (and for punctuating the action with abrupt switches to slow-motion). But the director indulges his predilections a bit less oppressively this time around, and while Downey isn’t any more convincing, perhaps his crudely comic characterization is growing less irritating simply because it’s now more familiar.

In any event, what really marks “Game of Shadows” as superior to the first film is that it’s actually more faithful to Doyle’s tales in narrative terms. The 2009 picture was a silly “Indiana Jones” sort of farrago cobbled together by a quartet of scribes. It pitted Holmes and Watson (Jude Law) against Lord Blackwood (Mark Strong), a nobleman who gave himself over to occult forces in order to gain immortality and conquer the world, with a secret society of other ambitious bigwigs assisting his plan. Also involved was the beautiful and duplicitous Stella Adler (Rachel McAdams), though she was actually in cahoots with an even more sinister figure—Holmes’ ultimate nemesis, Dr. Moriarity.

Adler reappears in “Shadows,” but only long enough to be dispatched by Moriarty (Jared Harris) and his henchman Sebastian Moran (Paul Anderson). That makes Holmes enlist the aid of Watson even though the good doctor is on the verge of marrying his great love Mary Morstan (Kelly Reilly). And before you can say “the game is afoot,” the duo are off on a continental chase to foil Moriarty’s dastardly plan—to start (and then profit from) a world war—accompanied by an unusual partner, gypsy fortuneteller Simza Heron (Noomi Rapace).

Calling up Moriarty, one of Doyle’s great creations, was an inspired decision on the new screenwriters’ part, especially since Harris invests him with such coolly nasty charisma (and Anderson is no slouch in the menace department, either). Indeed, the conversational sequences between Moriarty and Holmes are the best things in the movie—including the culminating confrontation at Reichenbach Falls (though, of course, it’s turned into something much more conventionally virile). Naturally a final twist is added to explain away the detective’s apparent demise, though the unaware Watson is nonetheless shown typing the famous last line of “The Final Problem.”

But though the script goes into contortions to explain in flashback how Holmes has outwitted Moriarty, in a long explanation more reminiscent of Christie than Doyle, “A Game of Shadows” concludes quite satisfactorily. Less happy are the big, bombastic moments—an opening fistfight between Holmes and a gang of thugs, an expansive battle on a moving train (with Holmes dressed in drag, no less), a prolonged torture-and-escape sequence set at a German munitions plant (in which Ritchie’s love of slow-motion is dreadfully overused). There’s compensation, however, in a set-piece involving a Paris production of “Don Giovanni,” which is so excitingly mounted that even an explosion can’t ruin it.

And there’s further pleasure to be had in the presence of Stephen Fry, who brings a touch of genuine elegance and wit to Sherlock’s brother Mycroft, another welcome Doyle addition. Though one might have done without an ill-advised scene of the man appearing au naturel, Fry handles even this uncomfortable moment with practiced aplomb. Law repeats his feisty Watson from the first film, and Rapace holds her own as a woman with every bit as much athletic ability as the men who surround her. She looks great when dolled up, too.

“A Game of Shadows” reunites the technical crew from the first film—production designer Sarah Greenwood, art directors Niall Moroney, James Foster, Nick Gottschalk and Matt Gray, set decorators Katie Spencer and Alison Harvey and costume designer Jenny Beavan, along with cinematographer Philippe Rousselot—and they all do equally superb work this time around. Hans Zimmer’s alternately cheeky and booming score is a plus, too.

Ritchie’s is hardly your father’s Sherlock Holmes. But unlike his first attempt, which rivaled “The Wild, Wild West” in pointless extravagance, this one comes across as an acceptable action movie in the modern mode.