"Future Imperfect" is the 82nd episode of the science fictiontelevision seriesStar Trek: The Next Generation. It is the eighth episode of the fourth season. During an away mission on Alpha Onias II, Riker falls unconscious and awakens to discover that sixteen years have passed. He's told that he's now captain of the Enterprise, and that Picard is a Starfleet admiral who travels aboard the Romulan warbird Desius. Doctor Crusher explains that a long dormant virus in Riker's system recently became activated and destroyed his memories of everything that transpired in his life during the past decade and a half. Riker thinks this is a Romulan charade, but the truth is stranger than that.
Riker awakens in sick bay to find that sixteen years have passed. He is now Captain of the Enterprise, Data is his first officer, and Picard has been promoted to admiral, with Deanna Troi serving as his aide. His amnesia, according to Doctor Crusher, is a side effect of a viral infection he contracted during the away mission 16 years before — the last event he currently remembers before waking up. She informs him that his memory of the intervening events may or may not return in time.
Riker also learns that he was married, is now widowed, and has a son (Chris Demetral) named Jean-Luc (named after Picard). He is further startled when Tomalak — a former archenemy of the Enterprise, now a Romulanambassador — beams onto the ship to negotiate a peace treaty with the Federation.
As events progress, numerous inconsistencies arise. The Enterprise computer consistently lags as Riker makes inquiries into his past. Data is unable to answer when Riker rapidly asks him computational questions. And finally, Riker's late wife "Min" is revealed to have been Minuet, the fictional holodeck character he fell in love with in the first-season episode "11001001". Riker realizes that the entire "future" he has been experiencing is a charade and confronts Picard and Tomalak on the Enterprise bridge, where more proof that none of this is real arises; Data cannot make a calculation that he should be able to make with his positronic brain, and then he uses a contraction, which Riker knows full well that he cannot do.
Suddenly, the program freezes and the false future fades away, revealing an advanced Romulan holodeck. "Ambassador" (actually Commander) Tomalak is revealed to be the perpetrator of the deception, the object of which was to trick Riker into giving away the location of a key Federation outpost. The Romulans, Tomalak explained, had been fooled by the intensity of Riker's memories of Minuet and had incorporated her into their fantasy on the assumption that she was real.
Riker is put in a holding area, where he meets the boy whose image the Romulans had used to create his "son". The boy identifies himself as "Ethan". Together, they manage to escape and briefly elude their Romulan guards. However, as the two are hiding from their pursuers, Ethan inadvertently refers to Tomalak as "Ambassador", instead of "Commander". Riker realizes that he is still in a simulation; confronting Ethan over it, he demands that the game end immediately and that he be allowed to leave.
Everything disappears once more, leaving only Riker and Ethan in the cavern the Enterprise away team had originally been exploring. Ethan confesses that he had created the simulations, using sophisticated scanners to read his mind and create the "reality" he experienced. Ethan's planet had been attacked and his people killed; his mother had hidden him in the cavern for his own safety, with all the simulation equipment, before she herself died; and Ethan, all alone, had been yearning for companionship. Riker realizes the peaceable intentions of Ethan, who reveals his true form as a grey-skinned insectoid alien named Barash, and offers him refuge on the Enterprise. Upon contacting the ship, Riker finds out that Worf and La Forge had beamed up without incident, but the Enterprise was unable for some reason to get a transporter lock on him. Barash accepts Riker's offer, and the two friends beam onto the ship.