Castrovalva is the first serial of the 19th season of the British science fiction television series Doctor Who, which was first broadcast in four twice-weekly parts on BBC1 from 4 to 12 January 1982. It was the first full serial to feature Peter Davison as the Fifth Doctor. The title is a reference to the lithograph Castrovalva by M. C. Escher, which depicts the town Castrovalva in the Abruzzo region, Italy.

In the serial, the alien time traveller the Doctor is led into a trap when his arch-enemy the Master (Anthony Ainley) uses the mathematical abilities of the Doctor's travelling companion Adric (Matthew Waterhouse) to create Castrovalva, a town whose dimensions fold in on itself.

This was the first Doctor Who story not to air on Saturday nights. With Peter Davison taking over as the Doctor, the BBC chose to move the show from its usual Saturday night slot, where it had been since its launch in November 1963. For this new Doctor Who series, the show moved to airing two new episodes per week, on a weeknight prime time slot instead. For Castrovalva, it aired new episodes on a Monday and Tuesday evening.

Plot

After his regeneration at the end of Logopolis, the Fifth Doctor is still weak, and his companions, Adric, Nyssa, and Tegan take him to his TARDIS. Upon arrival, the Master's TARDIS materialises in front of Adric before departing, leaving him in a supposedly dazed state. Inside, the Doctor is delirious but asks to be taken to the "Zero Room", a room cut off from the universe, to allow him to recover. Adric seemingly programmes the TARDIS to take them to safety, then follows the Doctor. In the depths of the TARDIS, the Doctor loses track of Adric, but eventually succeeds in replacing his clothes and finding the Zero Room.

Tegan and Nyssa discover a terminal on the TARDIS that describes how to use the machine. They discover they are travelling rapidly to a pre-set time and destination, "Event One", the Big Bang, a trap set by The Master. After seeing a brief image of Adric caught in a web attempting to warn them, the women manage to bring the Doctor to the console room in time for him to jettison a quarter of the TARDIS' mass to provide enough thrust to escape the gravity field. They soon discover that the Zero Room was part of the jettisoned mass, so with the help of Nyssa the Doctor builds a temporary coffin-shaped zero cabinet from the Zero Room's doors. Tegan discovers information on the town of Castrovalva, an ideal place for the Doctor to recover, and directs the TARDIS there.

In the forests outside Castrovala, Nyssa and Tegan have difficulties in transporting the Doctor, and become separated from him; the Doctor is captured by a ritualistic hunting party from the citadel, while the women are forced to climb a rocky cliff to reach its entrance. The Doctor is cared for by Shardovan, a librarian and academic, Mergrave, the town's physician and the elderly Portreeve, before Nyssa and Tegan arrive. After a night's sleep, they discover strange aspects of Castrovalva; if they go out of the town through any of its exits, they find themselves in a particular plaza in the town, and a tapestry in the Portreeve's rooms changes and reflects events of the outside world. The Doctor understands that they are trapped in a "recursive occlusion", and Castrovalva is fake. The Portreeve reveals himself as the Master, and shows them the trapped Adric in a web of electrified cables, whom he had kidnapped and replaced with a mathematically generated replica. The Master has been able to use Adric's mathematical genius to create Castrovalva as well as alter the TARDIS, creating the terminal on the console that led them here. Realising the true nature of Castrovalva's reality, Shardovan swings from a chandelier into the Master's web and destroys it at the cost of his own life, freeing Adric and causing Castrovalva to fall apart. Seeing all is lost, the Master flees to his TARDIS, which cannot escape the collapse. The Doctor and his companions flee from the town with the help of Mergrave, while The Master is trapped by the townspeople and is seemingly unable to escape as the town collapses in on itself. As the time travellers return to the TARDIS, the Doctor indicates that he has fully recovered from his regeneration ordeal.

Continuity

While he is still disorientated, the Doctor addresses Adric as "Brigadier" and "Jamie", Tegan as "Vicki" and "Jo", mentioning Romana, the Ice Warriors and K-9 as if they were in the vicinity, as well as adopting mannerisms or figures of speech characteristic of his four previous incarnations.

Production