The TARDIS materializes on a space station operated by a cybernetically enhanced humanoid and occupied by hundreds of people in suspended animation. Moments after the Doctor, Fitz and Compassion leave the TARDIS, however, an emergency strikes and the people in the life support capsules begin dying. Uncertain what is happening and separated from the TARDIS by emergency bulkheads, the Doctor pushes Fitz into the nearest life support capsule and climbs into another with Compassion. The capsule is filled with an anaesthetic preservative fluid which puts Compassion to sleep, but the Doctor remains conscious and finds that the capsule’s systems are trying to interface with his mind. When the capsule is unexpectedly expelled from the station, the Doctor orders it to return home, and it changes course and splashes down on a nearby planet -- but when the Doctor emerges he is immediately shot by soldiers armed with tranquiliser guns, and he and Compassion are taken to a secret Facility for questioning.
This is the planet Skale, where patriotism and paranoia focus upon geographical location rather than on skin colour or ideology. Narkompros, the head of the Facility, is in charge of a secret attempt to ensure Parallel 59’s superiority in the ongoing space race, but the arrival of the Doctor and Compassion suggests that one of the other Parallels has found a way to penetrate the Bastion security system. The technicians report that the Bastions are beginning to fail, apparent proof that the intruders managed to sabotage the network, and Narkompros is driven to his automatic medical unit for drugs to help him deal with the stress. The intruders’ claim to be innocent time travellers is dismissed out of hand, as is Compassion’s claim to have dreamt of a grey void while travelling in the capsule; however, while most of the Facility executives believe them to be spies for another Parallel, the jittery medical officer Jedkah is convinced that they are in fact alien invaders from the planet Haltiel, despite the fact that Skalian probes of that distant world seem to indicate that its life forms possess only rudimentary technology. To rule out the possibility that they are aliens, security chief Karl Dam decides to have them put through the genetic analyser, but when Compassion is placed in the machine it explodes. The Doctor and Compassion take the opportunity to flee, but the Doctor chooses to give himself up again to prove that his intentions are non-hostile; however, Compassion refuses to do so, and when the Doctor notices that she is still entirely undamaged after their ordeal, she flees from him rather than face the disturbing questions to which even she has no answers.
Meanwhile, Fitz has fallen on his feet in Mechta, a state-owned convalescent utopia where people are sent to relax and recover from personal traumas. Although like most people he can barely remember how he got here, he soon settles into a routine and begins an affair with the lonely Anya, who is feeling neglected by her politically active husband Nikol. Feeling guilty, she convinces Fitz to support Nikol’s doomed campaign to prove that hostile forces on their homeworld are suppressing the truth about their conditions. Fitz has already started drifting away from Anya and into a relationship with the younger Filippa, but to appease his conscience he joins Nikol’s campaign, bringing along his friends Serjey and Low Rez for moral support. Nikol takes Fitz to the administrative offices at Central and demands access to his medical files, but is told that he does not have the authority to view them and is expelled when he insists. Fitz, who is still trying to come to terms with the changes he has experienced in recent months, doesn’t want to admit that there could be anything wrong with Mechta, but even he must concede that something is amiss when Low Rez is given his Notification, although clearly unfit to be released back into normal society. Furthermore, a child at the centre where Fitz works has claimed to see shadows out of the corner of his eyes, and Fitz is beginning to catch glimpses of these lurking presences as well...
While hiding in the Facility’s shuttle bay, Compassion meets Rojin, a resistance fighter disguised as a guard. As the Project nears completion the security budget has been cut, and a contact within the Facility has given Rojin a dead guard’s ID disc. Rojin helps Compassion escape and takes her back to meet the rest of his cell, and she pretends to be a fellow resistance fighter, hoping to enlist the cell’s help to return to the Bastions and reclaim the TARDIS. Before she can learn more about their intentions, however, the cell is attacked by guards from the Facility, and although Compassion rescues Rojin and gets him to safety she then learns too late that she should have done no such thing. The attack was staged by Rojin and the cell’s leader, Tod, to get Rojin back into the Facility to make contact with their ally, in such a way that the guards would feel they were accomplishing something and would not make a more determined assault on the cell. But now, thanks to Compassion’s interference, Rojin’s girlfriend Karron has been captured instead.
Dam and his assistant Jessen place the Doctor in a virtual simulation of Parallel 59’s capital city, and walk him through a series of simulated encounters with suspected resistance fighters; however, this attempt to trick him into recognizing his allies fails, and the Doctor learns far more about Skale’s political situation than the interrogators do about him. He also realizes that the simulation systems incorporate organic technology, just like the dying cybernetic organism he briefly saw on the Bastion. He is sent back to his cell to recover from the experience, and while there is secretly contacted by Jedkah, who is desperate to gain scientific immortality by proving that all the current theories about Haltiel are wrong. The Doctor agrees to help him in exchange for answers to his own questions, and Jedkah eventually, and reluctantly, admits that if the Doctor had not changed the capsule’s course he would have ended up in Mechta. In exchange for proof of the Doctor’s origins, he agrees to give the Doctor the co-ordinates of Bastion 634 and of Mechta, where the Doctor hopes to find and rescue Fitz.
The Doctor is brought before an emergency council meeting to explain himself, and learns to his horror that the cybernetic controllers of the Bastions require a sterile atmosphere to survive; merely by arriving on the Bastion, he and his companions are responsible for the controller’s death and the cascading malfunctions which are now threatening the lives of every occupant of the Bastions. The Doctor offers to help stabilise the failing systems to correct his mistake, and the desperate Narkompros accepts -- but as the Doctor sets to work he comes to realize that his arrival in fact only exacerbated an already existing fault in the network. Meanwhile, the false ID used by Compassion is identified as that of a dead guard who is still registered as alive in the Facility records, proof that a traitor is at work. Dam assignes Jessen to the case, and she soon determines which terminal was used to generate the false staff records -- and is forced to arrest technician Makkersvil, with whom she had been having an illicit affair.
Narkompros orders Chief Supervisor Yve to ensure that the Facility shuttles are prepared in case it becomes necessary to send someone to the Bastions, but while doing so she apparently triggers a trap set in a disused shuttle and is horribly burnt in the ensuing fire. Due to the lack of security guards Dam is forced to take the Doctor along on his investigation to keep an eye on him, and the Doctor soon finds proof that Yve did not trigger a deliberate trap at all, but accidentally short-circuited a device intended to emit an electromagnetic pulse and scramble the controls of the shuttles, rendering them useless. Makkersvil had the opportunity to plant the circuit before his arrest, and he was operating the genetic analyser when it exploded and allowed Compassion to escape. Jessen thus goes to interrogate him, and while doing so provokes him into making a break for it. He is gunned down by a guard, but much to Jessen’s disappointment he survives and is sent to the medical bay; however, knowing that he will be interrogated once he recovers, he waits until he is alone and rewires his diagnostic terminal to make it appear that he is worse off than he actually is.
Trying to cheer up Low Rez before he departs, Fitz tries to set him up with Denna, a woman they meet on the tram -- but she turns out to be more interested in Fitz. While trying to decide what he should do about Filippa, Fitz accompanies Nikol and Anya on a midnight raid on Central, but he and Anya end up stuck in the lift for the night when they discover that it has no controls on the inside. Too many questions have been raised for Fitz to ignore, and the shadows in the corners of his vision are growing more numerous -- but when he shares his concerns with Filippa she decides to join Nikol’s group to see for herself. Unwilling to risk her meeting Anya and learning about their affair, Fitz tries to dissuade Filippa from joining up, and after a blazing row he storms out on her -- and heads straight for Denna’s. He feels guilty about cheating on her afterwards, and in any case Filippa ends up meeting Nikol and joining his cause, the day the red car comes to take Low Rez off to the spaceport. The group decides to wait until Central lets out for the night and then follow the employees home to question them about their work, but the man Fitz is following locks his door, lowers the blinds and refuses to respond to Fitz’s knocking at the door. Just as Fitz is getting frustrated, one of the shadows he’s been seeing appears right before his eyes -- a horrific bleeding black cancerous mass which then vanishes into thin air. Fleeing from the horrific vision, Fitz finds his way to the bar that Denna frequents, but is caught with her by Filippa -- who furiously informs Fitz that she has just received her own Notification...
Despite the Doctor’s best efforts, it appears that the damage to the Bastion network is now irreversible, and as Narkompros’ backers press him for assurances that all is under control, he feels his condition worsening despite his Medik’s assurances that he is in good health. The Facility’s chief scientist, Terma, receives word that the network’s condition does seem to be improving, but orders the operators to withhold the news from Narkompros until it is clear what is happening. Jessen then reports that the captive Karron has apparently committed suicide in her cell, and Narkompros, deciding that the Doctor can achieve nothing more, orders Dam to begin in-depth interrogation techniques and torture. The Doctor uses his respiratory bypass system to fake his own death, and revives in the morgue -- just as Jedkah arrives to take tissue samples from him. Jedkah faints dead away, convinced that he’s just seen a Haltien invader rise from the dead, and the Doctor ties him up and sets off to explore -- just in time to catch Jessen trying to kill Yve and frame Makkersvil for the murder. Jessen, caught out, admits that she is the traitor; her family has been exiled to the Bastions for political reasons, and Jessen will to anything it takes to bring down the evil network and put an end to the illusion of Mechta...
Although Fitz was the only one to experience a vision, the others in the group were also unable to contact any Central employees. An unprecedented number of Notifications have been issued recently, and Nikol whips up a mob of worried citizens and marches upon Central, demanding access to their files. Controllers appear as if from nowhere to usher the mob away, but Fitz and Serjey manage to get past them to the lift -- which opens up to reveal all of the Central employees, packed en masse into the lift and staring dead ahead without moving. Central is a sham; nothing happens in the administrative offices and the employees are not even real people. Serjey, unable to cope with this revelation, returns home, insisting that this all must be a part of the therapy. Filippa finally realizes that Fitz and Anya were having an affair and leaves him, while Anya and the defeated Nikol return home to await Nikol’s red car. Fitz is feeling particularly uncomfortable at this point -- but he soon starts to feel even worse when he is wracked with unaccountable pangs of thirst and hunger. Everybody in the city is starting to suffer from the same symptoms, and the administrators and doctors have all vanished as if into thin air, leaving the frightened citizens to fend for themselves...
The Doctor is horrified when Jessen and Makkersvil reveal that the Bastions are in fact a psychic minefield; only Parallel 59 knows the safe paths, and any ship from a hostile Parallel which passes too close to one of the Bastion capsules will be destroyed by an atomic explosion. The Bastions require an organic component to function, just like the simulation the Doctor was walked through earlier -- but only an intelligent mind will do for such a complex task. The Bastions have thus been populated with the Parallel’s undesirables -- six hundred thousand handicapped people or political troublemakers placed in suspended animation in a shared virtual reality known as Mechta. Jessen, feeling that the unfortunates are as good as dead already, has been working with Tod’s resistance cell, who plan to launch a mineship at the Bastion network and take out enough of them to cause a catastrophic chain reaction and shut down the lot. The Doctor, however, will not stand for this, and instead suggests that he pilot the mineship to Bastion 634, recover the TARDIS, and use it to release the Mechtans from their illusory paradise and return them home.
The Doctor, Jessen and Makkersvil head for the shuttle bay to await the arrival of Tod’s team, who remain unaware that Jessen killed Karron to prevent the terrified girl from breaking under torture. The Doctor, however, notices that the damaged shuttle where the fire started has not been removed, and investigates to find a brand new communications console inside. He activates it, and learns that it is linked to Narkompros’ quarters -- where Terma has arrived to watch Narkompros’ final moments. For some time, Narkompros has been working for a global consortium of power-hungry old men who intended to control the Bastions once the Project was complete, but Terma has known about it all along -- and has surreptitiously reprogrammed Narkompros’ Medik to dispense poison tablets to him, intending to take his place in the consortium. As Narkompros dies, however, feedback from the communications unit reveals the presence of intruders in the shuttle, and Terma sends Dam and his guards to capture them just as Compassion and Tod’s group arrive to rescue Karron and the Doctor.
Dam is injured in the firefight with the rebels, but the Doctor, Jessen and Makkersvil manage to escape with most of the other rebels. Terma orders that the captured rebel be tortured until he reveals the location of the rebel cell’s base; meanwhile, the desperate Jedkah tries to warn Terma that the Doctor has risen from the dead and is no doubt summoning reinforcements from Haltiel even as they speak, but Terma, busy securing his authority as the new head of the Project, ignores his wild claims. He sends a patrol out to the rebels’ base to recapture the Doctor, who has convinced the rebels to let him remove the explosives from their mineship and pilot it to Bastion 634 to recover the TARDIS. As the countdown to launch begins, however, the approaching Facility transport runs into the rebels’ minefield, and wreckage from the explosion jams the blast doors. Tod gives his life to clear the wreckage away under enemy fire, and the doors open just in time, allowing the ship to launch safely. The rest of the Bastion network is coming back on-line more quickly than expected, but due to the Doctor’s earlier efforts Bastion 634 is not responding -- and Terma therefore decides to isolate it from the rest of the network. While he’s at it he also changes the security protocols -- and when the mineship arrives the Doctor and Compassion, already beginning to run out of air, find that they are unable to dock with the station.
Things are going horribly wrong in Mechta. Everybody in the city is suffering from inexplicable pains, and now ordinary people are vanishing into thin air. Nikol is dragged off to the red cars, and Denna and Serjey vanish from inside locked rooms. Even the city itself appears to be dying, as the cancerous shadows which Fitz had seen earlier leech the life from the buildings and parks. Fitz is reunited with the weakened Filippa at the departure zone, but although she refuses to leave without him the red cars will not take two people at the same time. The desperate Fitz ties a blue car to Filippa’s red car, ensuring that he will be dragged along behind her, but as they depart, monstrous dark shadows coalesce from thin air and begin to consume the rest of the population. It appears that Fitz and Filippa have escaped this fate -- but the city dwindles behind them the sky grows dark and fills with stars, and Fitz’s surroundings fade away, leaving only a grey void...
Compassion uses her earpiece to access the Bastion’s control systems and allow their ship to dock, but she then passes out from the strain. The Doctor leaves her to recover, but the Bastion’s organic controls attempt to interface with her of their own accord -- and a hostile presence within the network tries to kill her. She manages to communicate with the Doctor and shows him what lies in wait behind the Bastions; hidden by the same sensor shield which has prevented the other Parallels from spotting the Bastions is a warship from Haltiel, and only the Doctor’s earlier attempts to correct what he thought were programming glitches have prevented it from seizing control of the Bastion network itself. Terma ignores the Doctor’s attempts to warn him of the danger, leaving the Doctor with the nasty choice of either allowing the Haltiel Presence to gain control of the Bastions, or of shutting down Mechta and killing everyone still connected to it. Before he can decide, Terma cuts out Bastion 634 from the rest of the network -- allowing the Haltiel Presence to seize control. The Haltiel Presence will not permit the people of Skale to spread their paranoia and hatred further, and as a demonstration of its power, it drops several Bastion capsules on Parallel 6’s Great City, destroying it and killing two million people.
At the Doctor’s request, Compassion frees as many people as she can from this malfunctioning Bastion -- but only six others apart from Fitz have survived. She then accesses the Presence’s computer systems and escapes with the relevant military data, disconnecting before the Presence can kill her. The Doctor tries to send the information to Terma, but the catastrophic failure of the Project has driven him into a state of denial; fortunately, Dam has been listening in from the medical bay, and sends the information on to Jessen. The Presence homes in on his signal and drops a capsule on the Facility, wiping it from the face of Skale. The Doctor gets Fitz and the survivors to the TARDIS, but is too late to save anyone else; Parallel 90 has launched missiles at the new threat, and the Haltiel Presence has thus declared war on Skale and dropped all six hundred thousand of the remaining capsules. Jessen and the rebels manage to get their data out in time to launch a strike against the Presence, driving it away, but Skale has been devastated, and the Presence may only have retreated in satisfaction that the threat of Skale’s space age has been negated. The Doctor returns the survivors of Mechta to rejoin the survivors of Skale, hopefully to rebuild a better world without national boundaries; and amidst the destruction he finds one small spark of hope, as Fitz learns that Filippa is one of the few whom the Doctor was able to save.