The holodeck is a useful and fun piece of technology in the The Next Generation and subsequent series with a variety of interesting storylines and chances for exploration.
The holodeck is capable of simulating any environment using holograms: projects of light and forcefields and look and feel like real things or even people. This means that, while Star Trek is fundamentally a science-fiction franchise, the holodeck allows for episodes with a different genre theme every once in a while. Westerns, classic Noir, secret agent stories, and even programs set in the middle ages have all been incorporated into episodes with the help of the holodeck.
Most of the time, the holodeck functions normally, allowing the crew enjoyment of a variety of experiences during their off-duty hours. When something goes wrong, however, interesting consequences often result. Holodeck malfunctions are usually caused by outside forces and can result in disastrous, and occasionally hilarious, consequences. Many episodes in the Star Trek franchise have explored what can happen when the holodeck stops working properly, and most of them are considered by fans to be some of the best episodes of all time.
The Practical Joker
Although the holodeck was technically first introduced in The Next Generation, a precursor to the device was featured in Star Trek: The Animated Series. In the episode "The Practical Joker," the Enterprise is forced to hide from attacking Romulans in a gaseous energy field, where the ship unknowingly picks up an entity who inhabits the computer and begins playing practical jokes on the crew. Lieutenants Sulu, Uhura, and Doctor McCoy take refuge in the "recreation room," holodeck-like device, but the recreation room malfunctions, and the three crew are forced to endure a variety of harsh environments before being rescued. "The Practical Joker" is considered the first-ever holodeck and subsequently holodeck malfunction episode in the Star Trek franchise.
The Big Goodbye
"The Big Goodbye" was the first episode of Star Trek: The Next Generation to heavily feature the holodeck. In the episode, Captain Picard and several other crew become trapped on the holodeck with the safety protocols shut off due to a power surge. The rest of the crew scrambles to repair the holodeck while Picard and the others attempt to convince the holograms in Picard's Noir detective program, "Dixon Hill," that everything that is happening is a simulation. Eventually, Wesley Crusher manages to reset the holodeck, allowing the trapped crew to escape. Towards the end, the episode sets up the notion of holograms' ability to gain sentience, something that is explored further in other episodes of The Next Generation and beyond.
Elementary, Dear Data
"Elementary, Dear Data" features Data and Geordi La Forge exploring a Sherlock Holmes holodeck program, but problems arise when Geordi requests that the computer create an adversary who is capable of defeating Data. The request causes the computer to create a version of Professor James Moriarty who is smart enough to realize that he is a hologram. After gaining sentience, the Moriarty hologram attempts to take over the ship, almost succeeding before Captain Picard convinces him to give back control in exchange for Picard bringing his program to Starfleet so that they can find a way for him to exist outside the holodeck. Although he is shut down at the end of the episode, Moriarty is featured in a later episode where he is reactivated accidentally and once again tries to take over the ship.
A Fistful Of Datas
The holodeck malfunction in "A Fistful of Datas" takes place while Data and Geordi La Forge are attempting to see if Data's neural net can be integrated with the ship's computer. Instead, a power surge causes parts of the computer memory banks and Data's positronic brain to swap. This affects the Spaghetti Western-style program that Lieutenant Commander Worf, Counselor Troi, and Worf's son Alexander are running on the holodeck. All the characters in the program begin to look like Data and possess his superior strength and intellect. Worf, Troi, and Alexander end up having to play out the program to get the holodeck to reset so that they can leave. At the same time, Data begins picking up Western mannerisms and phrases until he and Geordi reset his processors.
Emergence
"Emergence" is one of the stranger Next Generation episodes having to do with holodeck malfunction. The plot consists of the Enterprise-D seemingly gaining sentience and subsequently creating its own new lifeform, holding the crew at its mercy in the process. The whole affair wreaks havoc with the ship's systems, including the holodeck, which begins to act out the lifeform's creation through the allegory of an Orient Express program. Some of the crew, including Data, Troi, and Worf, participate in the program while it is running as they attempt to learn more about the lifeform and what the ship is doing. In the end, with the crew's help in obtaining enough Vertion particles for it to survive, the lifeform leaves the ship and all systems return to normal.
Our Man Bashir
"Our Man Bashir" is arguably Doctor Bashir is running in one of the holosuites. Bashir must keep his friends (who have no memory of their real lives) from being killed in the program until the transporter can be repaired. With Elim Garak's help, Bashir ends up saving the day and learns a few things about being a spy along the way.
Heroes And Demons
Captain Janeway sends the ship's holographic Doctor to investigate what is going on. Over the course of his first "away mission," the Doctor manages to negotiate for the release of the crew while playing out the Beowulf storyline as the hero.
Projections
"Projections" is another early Voyager episode starring the Doctor and raises a number of questions about identity. In the episode, a holographic version of Barclay attempts to convince the Doctor that he is actually Lewis Zimmerman (the holoprogrammer who created the Doctor) and that Voyager is a simulation Zimmerman has created to study the effects of isolation on Starfleet crews. As it turns out, the Doctor is actually trapped on a malfunctioning holodeck due to a radiation surge that is causing the program and his memory circuits to degrade. The Doctor is ultimately rescued by Voyager's crew, but "Projections" plays with the audience's perception of unfolding events in some interesting ways.
Worst Case Scenario
The plot of "Worst Case Scenario" revolves around a holonovel about a Maquis mutiny aboard Voyager that has the entire crew intrigued. When the program is revealed to be unfinished, Lieutenant Commander Tuvok confesses that he created it as a training exercise. At the crew's request, Tom Paris and Tuvok attempt to finish the story but instead trigger a malfunction in the holodeck that traps them inside and turns off the safety protocols. It turns out that the malfunction was deliberate sabotage by Seska before she left the ship. Voyager's crew works to disable the holodeck while Paris and Tuvok fight for their lives against the holographic Seska. In the end, Tuvok outsmarts Seska and the program shuts down, returning the holodeck to normal.
Bride Of Chaotica!
Photonic lifeforms attempt to make first with Voyager in the episode "Bride of Chaotica!" where the aliens appear on the malfunctioning holodeck, inside Tom Paris' "Captain Proton" program. The lifeforms do not recognize Voyager's crew as sentient beings and are under the impression that the holodeck characters are the ones in control. When Doctor Chaotica, the villain in the program, starts a war with the lifeforms, Voyager's crew helps them defeat Chaotica by playing along with the story, with Captain Janeway appearing in her iconic role of Arachnia, Queen of the Spider-People, to seduce Chaotica into lowering his defenses.
Spirit Folk
"Spirit Folk" is the last Star Trek: Voyager episode to deal strictly with holodeck malfunction. The plot revolves around the holoprogram "Fair Haven," a 19th-century Irish village that appears in one previous episode. In "Spirit Folk," a glitch caused by the crew's continuous running of the program allows the Fair Haven holograms to begin gaining self-awareness. Several of them notice the odd behavior of the Voyager crew and begin to suspect they are demons. The town captures Tom Paris, Harry Kim, and the Doctor and attempts to interrogate them, but once Janeway tells bartender Michael Sullivan the truth, he helps her convince the rest of the town that the crew is no threat.
Terminal Provocations
Starfleet badge called Badgey. When power is diverted to deal with an attack, the holodeck glitches, and the safety protocols are turned off, causing Badgey to fly into a murderous rage and attack Tendi and Rutherford. The two hide in several different simulated environments to escape Badgey before Rutherford subdues him, just as power is restored and the holodeck resets to normal.
Su'Kal
The Discovery season 3 finale, Saru finally convinces Su'Kal to shut down the program and everyone is rescued.
Since its introduction, the holodeck has provided Star Trek with many opportunities for great storylines. While there are clearly many stories about holodeck malfunction, there are just as many where the holodeck works as it should and provides the crew with exploration, entertainment, training, or discovery. Whatever an episode's plot, if it involves the holodeck, fans know to expect a good story every time.