The War Machines is the tenth and final serial of the third season of the British science fiction television series Doctor Who. Written by Ian Stuart Black and directed by Michael Ferguson, it was broadcast on BBC1 in four weekly parts from 25 June to 16 July 1966. In the serial, the First Doctor (William Hartnell) and his travelling companion, Dodo Chaplet (Jackie Lane), arrive in London shortly after the Post Office Tower was constructed. They meet secretary Polly (Anneke Wills) and sailor Ben Jackson (Michael Craze), and work to stop the sentient supercomputer WOTAN from invading London with its deadly War Machines.

Story editor Gerry Davis employed the academic Kit Pedler to develop the story idea, and scriptwriting duties were assigned to Pat Dunlop, who soon asked to be removed; he was replaced by Black, who also wrote the preceding serial. The War Machines is the programme's second serial set entirely on contemporary Earth. It marked the final appearance of Lane as Dodo, and the first appearance of Wills and Craze as Polly and Ben. Filming included extensive location shooting from May 1966, and the episodes were recorded in Riverside Studios from June to July.

The War Machines received an average of 5.2 million viewers across the four episodes, an improvement over its predecessor but low compared to the previous year. Reviews were largely positive, with praise for the setting, concept, performances, and new companions, though Dodo's departure was criticised. The videotapes and film prints were wiped by the BBC in the 1970s but subsequently recovered from collections, with some cuts for censorship. The story was novelised by Black, and the serial was released on VHS, DVD, and as an audiobook.

Plot The TARDIS lands in London, near the Post Office Tower, where the First Doctor and his travelling companion, Dodo Chaplet, meet Professor Brett, the creator of WOTAN (Will Operating Thought ANalogue). In four days, WOTAN will be linked to other major computers across the world to take them over. Dodo goes with Polly, Brett's secretary, to the Inferno nightclub, where they meet Ben Jackson, while the Doctor attends a Royal Scientific Club meeting about WOTAN, led by Sir Charles Summer. Before Brett can depart for the meeting, he is hypnotised by WOTAN. Major Green, the chief of security in the Tower, is also hypnotised, and sends WOTAN's control signals to Dodo at the nightclub via telephone.

Using its hypnotic control, WOTAN enlists a workforce to construct twelve robotic War Machines around London. One of these machines is built in a warehouse in Covent Garden, close to the nightclub. The next day, the Doctor telephones Brett at the Post Office Tower, and is nearly possessed by WOTAN. Thinking the Doctor is now controlled, Dodo reveals that the War Machines are being constructed in strategic points in London. The Doctor breaks WOTAN's control over her, and she is sent to stay with Sir Charles's wife to recover. The Doctor sends Ben to investigate the area around the nightclub, where he discovers a War Machine, now fully assembled. Ben is detected by the Machine and caught by the now hypnotised Polly. Ben learns that the War Machines are to attack the next day. He escapes and alerts the Doctor and Sir Charles. Polly is sent back to the Tower to be punished by WOTAN.

Under Sir Charles's instruction, an army task force investigates the warehouse. They are forced to retreat, but when the Doctor stands before the Machine, it stops, having not been completely programmed. Following reports of another War Machine taking to the streets, the Doctor traps the Machine in an electromagnetic forcefield and reprograms it to destroy WOTAN. Ben goes to the Post Office Tower and drags Polly out of WOTAN's room as the Machine enters and attacks the computer. WOTAN is destroyed, halting the other ten War Machines and breaking the hypnosis. Ben and Polly meet the Doctor at the TARDIS and explain that Dodo has decided to stay in London. The Doctor thanks them and heads into the TARDIS, shortly followed by Ben and Polly as it dematerialises.

Production Conception and writing

After assuming their roles as Doctor Whos producer and story editor in early 1966, Innes Lloyd and Gerry Davis sought to phase out historical serials in favour of contemporary science-fiction, following the lower figures and mixed responses to The Myth Makers (1965) and The Massacre (1966). Davis sought a scientific consultant for the programme and met with several academics—including Alex Comfort, Eric Laithwaite, and Patrick Moore—but felt their ideas were restricted by reality; conversely, Kit Pedler (an academic at the University of London with television experience) was more flexible, enthusiastic about science fiction. Davis considered a story in which the recently opened Post Office Tower "took over"; while most prospective writers had routine ideas, Pedler's concept of a rogue computer felt exciting, and an outline was created after one meeting. Pedler was paid per episode ().

Scriptwriting duties for the story, titled Doctor Who and the Computers, were assigned to Pat Dunlop, a staff writer at the BBC; Davis commissioned him to write the four scripts by 4 April 1966. After completing a draft for the first episode by mid-March, Dunlop asked to be removed from the serial to work on scripts for United! and consulting for Dixon of Dock Green. Davis subsequently assigned the story to Ian Stuart Black, who had recently completed his scripts for the preceding serial, The Savages (1966). Black was the first writer (and one of only three in the programme's original run) to pen two consecutive serials. He was formally commissioned on 15 March with the same due date, but soon given more time to accommodate Davis and Lloyd's changes to the companions; Black delivered the four scripts to Doctor Who and the War Machines on 21 March, 30 March, 7 April, and 28 April, respectively.

The War Machines was the first time the lead character had been directly called "Doctor Who"; Black believed it was his name, not "the Doctor", and Davis did not alter this in the scripts. The serial was the programme's second set entirely on contemporary Earth, after Planet of Giants (1964), and it established a story type that became commonplace with the programme in the early 1970s. It was Davis and Lloyd's first original story, having adopted the preceding serials from their predecessors. Michael Ferguson was assigned the serial's director; he had previously worked as assistant floor manager on The Daleks (1963–1964), on which he had controlled the Dalek's arm in the first episode. In preparation for The War Machines, Ferguson watched the film Machines Like Men on 25 April, spoke to representatives at ICT Limited on 28 April, and visited IBM in Hammersmith. The War Machines was the first Doctor Who story to feature a sentient supercomputer, later a science-fiction staple.

Four pieces of animation were created as opening title credits for each episode, with sound effects taken from a BBC effects disc. The pulsing sound effect for WOTAN was a generic mechanic sound effect, also used in Goldfinger (1964). Raymond London was assigned the serial's designer, his first work for the programme. The War Machine prop was designed by Shawcraft Models; only one was made, with its identification number swapped in different scenes to indicate a higher population. The machine was operated by Gerald Taylor, who had previously operated the Daleks since their first appearance in 1963 and the Zarbi in The Web Planet (1965). Taylor also provided the voice of WOTAN, using a stock effect with heavy echo and distortion. Lloyd told London that he considered the War Machines a potential replacement of the Daleks for the programme. Costumes were handled by Daphne Dare and Barbara Lane, and make-up by Sonia Markham. Polly's outfit was sourced from Marimekko by actress Anneke Wills, as the BBC did not use designer clothing. The serial used stock music to offset its budget due to the extensive film sequences.

Casting and characters

The War Machines was the first instance of the Doctor (portrayed by William Hartnell) participating in everyday activities, such as hailing taxis and visiting institutions, rather than interacting with historical figures or futuristic civilisations. The serial marked the final appearance of Jackie Lane as Dodo Chaplet; Lloyd chose not to renew Lane's contract, following the recent departure of Peter Purves as Steven Taylor in the preceding serial. Lloyd wanted two contemporary companions to make the programme relatable, partly inspired by the popularity of The Man from U.N.C.L.E. and the James Bond films. Ben and Polly are 24-year-olds from Swinging London, the former an able seaman with the Royal Navy and the latter an intelligent but impulsive woman whose trendy outfits echoed Julie Christie and Marianne Faithfull. In the first outline, Ben, named "Rich", initially quarrelled with Dodo before they became attracted to each other.

Anneke Wills and Michael Craze were cast as Polly and Ben by early May and offered contracts for four serials (18 episodes) on 25 and 26 May, respectively. They sought to discuss the characters with Hartnell and Ferguson. Wills recalled that her husband, Michael Gough, had enjoyed his time working on the serial The Celestial Toymaker (1966), though he warned her that Hartnell may be difficult to work with. She considered playing the role with a posh debutante accent, but the idea was soon dropped. Craze temporarily lived with Wills and Gough for six weeks after being cast, unable to find other accommodation; Wills and Craze became lifelong friends. Hartnell tried to help the new cast settle in, but they had different approaches to working; Craze struggled to relate to Hartnell.

Ferguson cast several guest actors he had worked with, as the BBC did not use casting directors. William Mervyn was the serial's primary guest star, cast as Sir Charles Summer. The character, originally named Sir Robert, was inspired by Inspector Lestrade in the Sherlock Holmes stories: unimaginative and opposed to receiving advice. Ferguson had recently directed Mervyn in an episode of The Flying Swan (1965) alongside John Cater and John Boyd-Brent, who he cast as Professor Krimpton and the army sergeant, respectively. He had also worked with John Harvey (who portrayed Professor Brett) on several projects. Ferguson cast Dwight Whylie as a radio announcer as his voice was immediately recognisable; the head of presentation at BBC Radio, Andrew Timothy, agreed to release Whylie for recording on 7 June. Ric Felgate, then Ferguson's brother-in-law and husband to Cynthia Felgate, was cast as an American journalist. Mike Reid appeared uncredited as a soldier; he had previously appeared in the film Dr. Who and the Daleks (1965) and later found fame as Frank Butcher on EastEnders from 1987 to 2005, including in the Doctor Who charity special crossover Dimensions in Time (1993).

Filming