The TARDIS speeds through space before being hijacked by Caw, Baltazar’s robotic pet, who drags it down to a nearby planet. Stepping outside the Doctor and Martha greet the creature, who presents Martha with a badge for helping escape from Baltazar’s ship all those years ago.
He explains that having served his sentence in Volag Nok Baltazar is now free, seeking his heart’s desire. He claims that he is now searching for the Infinite, which the Doctor explains is a ship from the very dawn of time when the universe was much smaller; the time of chaos.
It is rumoured that whoever finds the ship will be rewarded with their heart’s desire, and now Baltazar is out to retrieve it. Caw produces a data chip, one of four that will lead the holder to the ship, each one being a link to the next.
The Doctor announces that the ship must remain a legend, and moves to stamp on the device. However Caw explains that Baltazar has a copy and to stop the ship falling into the wrong hands the Doctor links to ship to the console, which directs him to the planet Boukan.
The ship materialises whilst Caw stands outside, revealing Baltazar standing behind the craft. He claims that with the tracker in place the Doctor will lead him to the Infinite, and once he has got his heart’s desire he will have his revenge.
The TARDIS has arrived on the planet Boukan, where the Doctor notes the several artificial suns used to heat up the planet. He and Martha look on at the series of oilrigs in the distance, but are shocked when the giant structures begin to walk towards them.
Suddenly giant torpedo-like objects tied to ropes blast from the sand and burry themselves in the rigs. The ground then begins to shake and suddenly the Doctor and Martha are lifted up into the air on a giant ship, but the TARDIS falls over the side.
The female pirate captain of the ship orders her crew to go forward, and after telling the Doctor and Martha to cling on (which they mistake for an instruction to embrace) the ship begins to pull against the rig, which eventually falls to the ground.
They prepare to siphon the oil and the woman introduces herself as Captain Kaliko. The Doctor explains that in the 40th Century oil is scarce and with the largest companies taking it all and then selling it for extortionate prices the pirates are stealing it and giving it to the poorer colonies.
However despite working for a god cause Kaliko and her first mate Swab are not the friendly type and the captain orders her crew to advance on the pair, revealing them to be skeletons in armour. Kaliko deuces that they must either be oil company spies or pirates themselves, and either way she wants them off of the ship.
The skeletons advance on the Doctor and Martha, brandishing laser swords.
The skeletons advance by Mr Swab stops them, suggesting that if the Doctor and Martha are Oil Corp spies then they should be left in one of the burnt-out rigs. Kaliko agrees and as she prepares to do so Mr. Swab leans over and tells the two travellers they are safe with him.
Soon the Doctor is walking the plank, still stalling for time before Swab makes his move. Suddenly he aims the Sonic Screwdriver and threatens to destroy the ship, but Kaliko is not convinced. He activates the device and sparks fly from the ship as Swab, the real Oil Corp spy, leads a mutiny.
The Doctor explains that he and Martha are not spies, but have arrived to save Kaliko. Nevertheless Swab calls out and the giant oil rig-destroying machines open fire on the ship.
The ship tries to fly out of reach of the laser-fire but eventually it is brought down. Some time later, in the wreckage, Martha searches for the Doctor. Swab confronts her, claiming he is dead. He toys with the idea of stealing Martha’s body but he is inadvertently thrown off of the ship by the Doctor and Kailko, who are still very much alive.
The Doctor finally turns to Kaliko and asks for her earring, alias the second data chip. She scoffs as she realises he is in search of the Infinite, and instead flees in an escape pod. However the vessel is found some time later by the two time travellers by the TARDIS, Kaliko having been murdered by some unknown force.
The Doctor retrieves the data chip and together with Martha he leaves, arriving not long after at their next location, a far away planet bathed in eerie green light. The two advance on their way but without warning are attacked by a swarm of glowing green bugs.
A lizard creature named Meergrass, who is supplying the queen of these creatures with “protection” from an unknown attacker, saves the travellers. Martha however is more interested in the data chip attached to his collar.
He explains to them that the planet is a war zone, and as ships swarm the skies, ready to attack Martha is knocked unconscious by a falling pillar of rock. She awakens sometime later inside one of the towers, which is actually made of dung.
They confront the queen of the insects, who points out that Meergrass is a gunrunner. Suddenly a captured enemy pilot is brought inside, another animalistic creature with glowing green eyes that advances towards them.
The creature is unmasked to reveal a human soldier within; the exterior is a suit of armour. The nervous man begins to panic but slowly regains his composure. The Doctor chides him for trying to wipe out the insect creatures but he reveals that it is they who are the invaders.
The planet, Myar, was once a human colony but was overrun by the insect creatures. The Doctor turns on the queen, who reveals that her race invaded to feed on the fertile land. Meergrass meanwhile prepares to leave, demanding payment for his services.
However the queen refuses and Meergrass revealed that he once worked in a prison; Volag-Nok, the same prison in which Baltazar was held. He is interrupted by the air raid alarm; another human attack is on the way. The queen sends out her soldiers to defend but the Doctor tries to reason with her.
Martha meanwhile asks the captured pilot, Kelvin, what the attack will involve and he explains that the entire city will be disintegrated. Outside, the human ships advance.
The queen asks Meergrass for help but he refuses to on grounds of not being paid. He leaves, taking the arming code for his weapons with him, rendering the devices useless.
The Doctor notes that he and Martha must keep and eye on him, for he holds the next data chip, but firstly he turns to Kelvin, using his suit of armour to establish a communication link with the invaders.
Instead of warning them off he impersonates a pirate and claims that it is he who has been attacking them, not the bugs. Surrendering, he succeeds in stopping the attack and tells the queen to work with the humans, not against them.
With Martha, he flees the hive before the humans arrive to catch them, but on returning outside they find Meergrass, murdered like Captain Kaliko. They take the data chip from his collar and depart.
Back in the TARDIS they use the chip to determine their next location, the prison planet Volag-Nok. They arrive and outside they find themselves on a desolate snowy landscape. Martha notes there is no sign of a prison but the Doctor concurs, and suddenly he is surrounded by narrow beams of light and taken below the planet’s surface…
The Doctor, standing on a small floating platform, descends deep into the planet and Martha soon follows. Hovering robots perform scans on them, registering criminal activity. Martha is found to have no criminal record but the Doctor, whose Sonic Screwdriver is confiscated, is charged with 3005 offences, with 6000 more to be investigated. He is taken away to a cell whilst Martha is taken to see the governor, Gurney.
In his cell the Doctor finds a lonely android. He approaches it and finds that it is in pain, promising to help if he can.
In Gurney’s office Martha protests a mistake has been made, but becomes distracted when she sees a data chip sitting in the stubborn man’s safe. He tells her no errors have been made and examines the Doctor’s record, finding a video of his confrontation with the human invaders on Myar, in which he imitated a pirate. Observing Martha also in shot Gurney assumes she too is a criminal.
In the cell, the Doctor tells the story of his quest for the Infinite whilst examining the android’s insides. He discovers an inhibitor that prevents the creature from committing crime. Believing him to be falsely imprisoned the Doctor removed the device and almost immediately the droid blasts down the cell door.
In Gurney’s office the governor detects the disturbance, and inadvertently reveals that he is not the true governor, the android is. Martha appears pleased at the Doctor’s ability to wreck havoc in such a short space of time and then watches with Gurney as something begins cutting down the door…
The Android from the Doctor’s cell is the culprit and soon finishes the work. He and the Doctor step inside the office and using the Psychic Paper the Time Lord reveals the fake governor to be a previous prisoner, who returned to the prisoner to overthrow the android who lived in a life of luxury whilst he was still being hunted.
He explains that he was sold a computer program that made the android wardens view Gurney as the governor and the true governor as a prisoner. The Doctor correctly guesses that it was Meergrass who sold him this but is cut off when the real warden orders that all prisoners must be destroyed.
The Doctor protests and tries to reverse the command as Gurney opens the safe and shoots the governor. Taking the contents of his safe the ex-convict flees to the surface, closely followed by Martha. The Doctor stops the execution order before going off to find his Sonic Screwdriver.
On the snowy landscape above Martha tries to stop Gurney, who pulls a gun on her, ordering that she take him with her in the TARDIS. Suddenly his face is overcome by bewilderment and when Martha follows his line of vision she sees, to her horror, Baltazar flying toward her from the skies with Caw.
Gurney manages to bring down Baltazar by firing at Caw, hitting him in the chest. He then tries to flee but Baltazar pursues him. Martha walks over to Caw, who apologises for double-crossing her with Baltazar, explaining that it was the promise of gold that caused him to do it.
He claims there is nothing that can be done to save him and the Doctor, who has also returned to the surface, agrees with him. Caw dies but before they can do anything the Doctor and Martha are captured by Baltazar. He takes them back to the TARDIS where inside he reveals that the broach Caw gave Martha when they started their quest is in fact a tracking device, which he has used to track their progress.
The small metallic bird that poses the centrepiece of the badge then comes to life and flies out into the snow outside. Baltazar reveals that it was he who murdered Kaliko, Meergrass and now Gurney, helping the Doctor and Martha retrieve each data chip.
He then orders the Doctor to use the final data chip to locate the Infinite and as Squawk, the tiny bird from the broach, perches on the snow-covered body of Caw outside, the Time Lord connects the four data chips to the console, producing a map leading to the lost ship. Despite warning Baltazar that the ship’s power could destroy him, the Doctor proceeds to enter the correct coordinates into the console.
However, once he has finished Baltazar realises that he no longer needs the Time Lord, and promptly shoots him…
The Doctor awakens on the surface of Volag-Nok, the TARDIS having departed. Inside the ship Martha swears the Time Lord will eventually return but Baltazar is not so sure.
Soon they arrive at the Infinite, the wreck of a space ship now slowly being formed into an asteroid. Martha looks on in amazement as Baltazar explains that the data chips were part of the broken flight recorder, which was spread as flotsam and jetsam throughout the galaxy.
He then sends Martha inside to investigate, telling her to look for the ship’s hold. Falling through a hole in the deck she finds it, but to her surprise there is someone else already there, the Doctor. She tries to ask how he got away from Volag-Nok but he silences her, whilst outside Baltazar is still waiting.
Suddenly the Doctor appears above him, riding on the back of a grown-up Squawk. He attempts to land but is thrown off, and falls unconscious. Baltazar tries to tempt Squawk to join him but the Doctor regains consciousness and intervenes, demanding to know where Martha is.
Inside the ship Martha embraces the Time Lord standing before her but then realises that he is not really the Doctor, he is an invention of the ship relating to her heart’s desire. She seems somewhat embarrassed by the prospect but suddenly screams out as the fake Doctor’s eyes and mouth begin to glow…
The real Doctor arrives and tells her that to destroy the creature she must no longer let it be her heart’s desire, and after declaring that she no longer believes in it, Martha watches as the apparition fades away.
After the Doctor forbids the ship from trying to find his own heart’s desire, he explains to Martha that it has been three years since they last met on Volag-Nok and in that time he has helped Squawk grow up and programmed the governor of the planet run a better prison.
Turning to the burnt out wreck of the ship he explains to his companion that it’s power is dissipating by the day, held together by lingering hopes and dreams, enough energy left to give visitors a slight glimpse into their heart’s desires.
Soon Baltazar arrives, finding a pile of gold waiting for him, with which to rebuild a ship and become scourge of the galaxy once more. Martha tries to tell him the treasure is not real but he is not listening. The Doctor intervenes and using the sonic screwdriver triggers the breakdown of the ship.
The gold disappears and as the infrastructure crumbles the Doctor and Martha flee back to the TARDIS. Baltazar tries to go with them but the Doctor locks him outside as the asteroid breaks up. Inside the time machine the Doctor explains to an unsettled Martha that Baltazar will not have died.
Sure enough, as per the Time Lord’s plans, Squawk picks up Baltazar and takes him to Volag-Nok, where he is once again imprisoned. The Doctor then asks Martha to pick their next location, once again determining the coordinates by picking random numbers. Martha laughs but the Doctor insists:
“When do I ever let you down?”