10 Star Trek Twists You Never Saw Coming
1. The Holographic Recursion
In the Star Trek: The Next Generation episode Ship in a Bottle, Moriarty returns and appears to do the impossible: he leaves the holodeck by sheer willpower alone (his "cogito, ergo sum"). Data later discovers, however, through some left-handed, Holmesian deduction that he, Picard, and Barclay are still on the holodeck. They are, in fact, stuck in a simulation of the Enterprise-D created by the sinister Moriarty, who has also taken control of the real Enterprise.
Eventually, the trapped crewmembers manage to program the holodeck within the holodeck to trick Moriarty into thinking he is transporting out to the real world. As producer Brannon Braga put it, this is "a twisty turny complex mystery" of an episode.
If you couldn’t follow all the ins-and-outs of this play within a play within a bubble of technobabble, then neither could those who worked on the episode. Reportedly, the TNG staff kept track only with the aid of diagrams that they drew during breaks in filming.
Nevertheless, the fact that Moriarty’s transubstantiation is a trick, and that our trio had never actually left the holodeck, is hinted at before it is revealed. For example, there are no external shots shown of the Enterprise-D until the very end of the episode. This is a method often used to indicate that events are happening in the holodeck or inside the mind of a character.