When Lieutenant Barclay is assigned to repair a glitch on the holodeck, he happens upon the program of Professor Moriarty, the Sherlock Holmes character given sentience in a misadventure several years earlier. Frustrated that no progress has been made in finding a means for him to live outside the holodeck, Moriarty rashly leaves its confines, discovering that in fact he can exist in the real world. Soon he seizes control of the Enterprise, coercing the crew to search for a means to bring his love, the Countess Regina Bartholomew, off the holodeck as well. But not all is as it seems. In truth, Moriarty's miraculous entrance into the real world has been faked inside his own holographic simulation of the Enterprise -- where he has trapped Picard, Data, and Barclay in his efforts to commandeer the real thing.
Everyone on the writing staff was fond of the episode "Elementary, Dear Data," and was keen to make a sequel. But Paramount Studios had reportedly upset the estate of Sir Arthur Conan Doyle with the film Young Sherlock Holmes, and confusion as to whether the copyrights on the characters had expired. (An issue which was sparking lawsuits in America as recently as last year.) When this legal feud forced a late rewrite to excise Holmes from a third season episode, a moratorium was declared: Sherlock Holmes would never appear on Star Trek again.
But Jeri Taylor wasn't around during the third season. And by the time she took over as showrunner in season six, she wondered if the problems with the Doyle estate were really as bad as she'd been led to believe. She decided to inquire about the situation, and quickly learned that the dust had settled; the Doyle estate was willing to license the characters to Paramount for a quite reasonable fee. Immediately, the writers went to work crafting a new Sherlock Holmes episode.
...and failed in the attempt. Jeri Taylor was discussing with Michael Piller (now over on Deep Space Nine) how their first idea had fallen through, and Piller had a suggestion. Back when writer Rene Echevarria had pitched his first episode ("The Offspring"), he'd followed up with three other ideas that never took off at the time. One, Piller recalled, involved characters being deceived into taking a holodeck scenario for reality. Perhaps that could be a means to bring Moriarty back for another episode? Echevarria, just recently made a staff member on The Next Generation, was shocked that Piller had remembered the idea after so many years, but was eager to pick it back up and adapt it for a new Holmes adventure.
One of the first decisions made was to bring in the character of Barclay. And while it seems obvious to use him in an episode centered on the holodeck, the idea to include him was actually for different reasons. The writers felt that a character who wasn't around for the first Moriarty episode would need to be involved in this one -- perhaps to explain the accidental "unleashing" of the villain, or perhaps just as a means for delivering exposition to anyone in the audience who'd missed the prior episode. In any case, Barclay slips very well into the story -- though this episode features him far less than any of his prior appearances.
Michael Piller was right: the scheme of a holodeck-inside-a-holodeck is perfect for the character of Moriarty. It's a fiendishly clever scheme, worthy of the real Doyle character. Not only does he force his unknowing prisoners to work on solving his problem, he cons Picard into giving him the means to take control the real Enterprise.
In fact, the only part of the episode that really doesn't track for the character of Moriarty is his love for the Countess Bartholomew. That character is a Star Trek creation, without basis in Doyle's original writings. As such, if the writers want to say that this Moriarty is deeply in love with her, that she was made for him, fair enough. But a better ruse, worthy of the "real" Moriarty (you know what I mean) would have been for even his love to be a fabrication -- for him to have pretended to care for a woman he'd invented, just to play on the sympathies of the Enterprise crew. (Though I admit, it would have made for an unsuitably dark ending, with Moriarty discarding a woman he cares nothing for rather than riding off into the sunset with a loving partner.)
- It's interesting how this whole episode turns on Moriarty's inability to leave the holodeck, when the originally planned ending for "Elementary, Dear Data" was that he in fact could have done so.
- It's also interesting how, a few years later, Star Trek: Voyager would introduce a means for the Doctor to leave the confines of his holographic environment.
- There's a very subtle clue pointing to the falseness of the holodeck scenario. Most episodes of The Next Generation include shots of the outside of the ship to transition between scenes. In this episode, the exterior of the Enterprise isn't seen from the moment Picard, Data, and Barclay enter the holodeck, until the scene after they discover the ruse (right before Moriarty contacts the real Commander Riker).
- While Moriarty's version of Counselor Troi is shown wearing a uniform (continuing formality even after Captain Jellico's departure), the real Troi seen at the end of the episode wears one of her off-duty outfits.
- There are a few minor scene extensions offered as deleted scenes on the Blu-ray version of this episode, but neither really amounts to much. The first attempts to explain why Moriarty remains active even when Barclay tries to shut him off. The second prefaces Moriarty's exit from the "holodeck," with justification of alien species who really do have mind-over-matter powers.