Writing The writing of this episode took over ten months, from the initial pitch by
Harlan Ellison to the final re-write by
Gene Roddenberry.
Steven W. Carabatsos and
D. C. Fontana, both story editors on the show, undertook re-writes of the teleplay, and changes have also been attributed to producer
Gene L. Coon. The experience led to animosity between Ellison and Roddenberry for the rest of the latter's life, in particular over a dubious claim by Roddenberry that Ellison had the character
Scotty dealing drugs in one version of the script. The episode went over budget by more than $50,000 and overran the production schedule. Mistakes were made in the set design with an instruction for "
runes" misconstrued as a request for "ruins". With
Matt Jefferies ill, Rolland Brooks designed the set and the Guardian of Forever, to the surprise of Jefferies on his return.
Initial pitch and outlines Harlan Ellison was one of the first writers recruited by Gene Roddenberry for
Star Trek. Roddenberry was aiming to have the best science-fiction writers produce scripts for the show and had identified Ellison immediately. At the time, Ellison had been nominated for the
1965 Writers Guild of America Award for Outstanding Script for a Television Anthology with his script for the
Outer Limits episode "
Demon with a Glass Hand"; he went on to win. Rather than being assigned a pre-written premise, Ellison was allowed to develop his own and propose it in a 10-page outline. Ellison had read a biography of evangelist
Aimee Semple McPherson, and thought that it would be an interesting idea to have Kirk travel back in time and fall in love with a similar woman of good intent, but someone who must die in order to preserve the future. Ellison considered that it would have a heartrending effect on Kirk. (pictured in 1986) In March 1966, Ellison pitched the idea to Roddenberry, who accepted it. A week later, he turned in his first
script treatment. Producer
Robert H. Justman later recalled that he thought it was brilliant. When writing it, Ellison did not have as many restrictions as some of the later writers; he was hired prior to the series
bible being created. The first version introduced Lieutenant Richard Beckwith, who is sentenced to death after he kills a fellow crewman when he is threatened with the exposure of his involvement in the
illegal drug trade. Ellison had included this element, since he expected the starship to be like any other military unit, having at least some unlawful people. Beckwith is then escorted to the surface of a nearby planet alongside Kirk, with Spock to carry out the
execution by firing squad. Because of the planet's atmosphere, they have to wear
environmental suits. On arriving, they find an ancient civilization and the remains of a city — this was Ellison's "city on the edge of forever". It is inhabited by several men, the Guardians of Forever, who protect an ancient time machine. Kirk then asks to see the
history of the United States on the machine, and as it reaches the Great Depression of the 1930s, Beckwith dives into the projection and vanishes. The guardians inform Kirk that history has been altered, and upon returning to the
Enterprise, they discover that the vessel is now crewed by renegades. They fight their way back to the transporter room and return to the planet, where the Guardians allow Kirk and Spock to pursue Beckwith into the past. They are informed by the Guardians that Beckwith prevented the death of Edith Koestler, and as in the final version, Kirk falls in love with her; in this version, however, he does so knowing that she must die in the end. Emotionally, he cannot stop Beckwith from attempting to save KoestlerSpock has to do it. Roddenberry had asked for the ship specifically to be placed in danger, and so Ellison added the renegade element in response. Beckwith is captured but again escapes into the projection and ends up in an endless loop of an exploding Nova sunhe screams, and dies forever without end. Roddenberry disagreed with some of Kirk's actions in the first draft, and he asked Ellison to rewrite the treatment without pay. The redraft took a further five weeks, after which Roddenberry gave more notes and Ellison took another two weeks to respond. When a version was received on May 13, Roddenberry and the executives at Desilu and NBC were all relievedthere had been concerns over the amount of time taken, as scripts were being pitched, written, and approved in the time taken for Ellison to revise his outline. This version dropped the environmental suits due to cost, and rewrote the information given to Kirk by the Guardians, making it more general and less
Earth-specific. It also changed Edith Koestler's surname to Keeler. However, the majority of the plot points were unchanged.
Development of the teleplay Justman registered immediate concerns over the potential cost of attempting to film the treatment. He had particular concerns about a time portal effect, a scene involving a
mammoth and the number of exterior and night shoots that would be required. Despite this, Roddenberry asked Ellison to turn it into a shooting script and set aside a desk for him in the assistant director's room, expecting him to attend the office every day until he finished it. Ellison ended up with a smaller office of his own at his request but disliked it sufficiently that he spent the majority of his time on set. He would play loud
rock and roll music in the office, and then leave it for the set. On one occasion story editor
John D. F. Black caught him on set during the filming of "
Mudd's Women" and had him escorted back to the office. The music went on, and Black went back to tell Ellison to turn it down, but the writer had already climbed out the window and left. On other occasions, he worked late into the night and slept on the couch in Justman's office. As the delays added up, the slots assigned to "The City on the Edge of Forever" were reallocated to other episodes. Although this period was later claimed to be of various lengths, Ellison completed the first draft teleplay in three weeks, handing it to Justman on June 7. Black later said that Ellison always had "40 things going" in reference to him doing multiple assignments at once. In response, Ellison said that doing multiple assignments at the same time was simply how screenwriters earned a living in the 1960s. Justman's initial glee at receiving the script was short-lived. He realized quickly that it was unfilmable due to cost, and the characters were not behaving as per the writer's guide. One such exchange between Kirk and Spock had the Vulcan character accusing humans of being barbaric, while Kirk was saying Spock was ungrateful because humans were more advanced than Vulcans. Justman thought it was a good script, but could never be re-written and filmed in time for the first season. Ellison was asked to revise it once more, with the problems blamed on requests from NBC, and submitted a further version a week later. The production team was starting to lose patience, as he was not revising it in accordance to their requests, and he began arguing with Justman over the budget difficulties. On August 15 Ellison turned in a second revised draft to Justman, titled "final draft" on the front cover. Justman wrote a memo immediately to fellow producer Gene L. Coon, saying that after five months, Ellison had failed to reduce the budget requirements for the episode to something that could be filmed. Roddenberry and Justman both spoke to Ellison, seeking further changes, but failed to convince him. William Shatner was sent to Ellison's house to try to get the writer to reconcile. He claimed he was shouted at and thrown off the property, but Ellison said that Shatner had read the script through while sitting on a couch and had left to tell Roddenberry that he liked it. Ellison suggested that Shatner had a personal interest in having the script revised because Leonard Nimoy had more lines than he did in Ellison's version, and had spent the time on the couch counting lines. Meanwhile,
Steve Carabatsos replaced Black as story editor on the show and was told by Coon to fix the script. Carabatsos replaced the new characters with an accident involving McCoy and an overdose of
adrenalin and removed the Guardians of Forever, replacing them with a time travel portal. Ellison subsequently accused him of "taking a
chainsaw" to the script. Roddenberry disliked the new version sufficiently that he convinced Ellison to come back and rewrite it again. On December 19 Ellison submitted a further revised teleplay, dated December 1. Justman suggested in a memo that Roddenberry might be able to rewrite the latest version to one that could be usable. He said that although it was a "fine story" and Ellison was an "extremely talented writer", he felt that it needed to be either rewritten by someone else or scrapped altogether. Taking this advice in hand, Roddenberry rewrote the script over the Christmas–New Year period, handing in a new version on January 9, 1967. His changes included the elimination of the evil version of the
Enterprise and the addition of some comedy elements. Justman was pleased with Roddenberry's changes and told Coon that it was close to being filmable but that he still expected it to exceed the budget for a single episode. Dorothy Fontana was hired as a new story editor, replacing Carabatsos. She had previously been Roddenberry's secretary and was well aware of the script's problems from reading the previous versions. When she arrived at work for her first day in her new role, Roddenberry gave her a copy of his revision and told her to try rewriting it. She later referred to that day as "walking into a hornets' nest", and the script itself as a "live grenade". Among the changes in her version was the introduction of the drug cordrazine. Ellison specifically criticized this change, as his most recent version of the script called for an alien creature's venom to cause the symptoms in McCoy. He said that "Gene [Roddenberry] preferred having an accomplished surgeon act in such a boneheaded manner that he injects himself with a deadly drug!" Justman praised Fontana's version, saying that it was the version that was most likely to be shot. But he suggested that it had now lost the "beauty and mystery inherent in the screenplay as Harlan originally wrote it". He said that he felt bad, because if he had not seen Ellison's earlier versions then he would probably have been "thrilled" with Fontana's version. Still unsatisfied with the script, Roddenberry set about rewriting it once more, titling the result, dated February 1, the final draft. Ellison later called elements of the dialogue in this version "precisely the kind of dopey Utopian bullshit that Roddenberry loved", and added that Roddenberry had "about as much writing ability as the lowest industry hack". Shatner later came to believe that it was actually re-written by Gene L. Coon and only supervised by Roddenberry. Ellison requested via his agent that he be credited on the script only as
Cordwainer Bird. In response, Roddenberry threatened to have Ellison blacklisted by the
Writers Guild of America, and the writer was eventually convinced to be credited by name. None of the other writers involved in the work chose to seek credit for the script, since they agreed with Roddenberry that it was important for
Star Trek to be associated with writers such as Ellison.
Direction and casting (pictured in 1956), was a well-known actress before appearing in "The City on the Edge of Forever".
Joseph Pevney was assigned as the director of this episode. He had previous experience in directing full-length films, and later explained that "The City on the Edge of Forever" was the closest episode in
Star Trek to that same level of work and challenge, stating that he treated it as a film. But he was critical of Ellison's version of the script, saying that he "had no sense of theater" and it was fortunate that Roddenberry re-wrote it. He praised Ellison's level of detail in the 1930s setting, and for the general idea behind the episode. The crew were surprised when actress
Joan Collins expressed an interest in appearing in the series. After her agent asked her if she wanted to appear on the show, Collins, who had never heard of it, mentioned it to her children. When her oldest daughter was enthusiastic about the show, Collins decided to accept the offer from the studio. Casting director Joe D'Agosta called her a "notorious actress", but said that at the time they saw approaches from a wide range of actors and actresses who wanted to appear on the series. Pevney said "Joan Collins was very good in it. She enjoyed working on the show and Bill and Leonard were both very good to her... Using her was a good choice." Collins later incorrectly recalled Keeler as a Nazi sympathiser, an error that has been repeated in biographies of the actress. Ellison said in response that this was not an intended character trait.
John Harmon appeared as a
hobo in "The City on the Edge of Forever" and returned in a more prominent role in "
A Piece of the Action". Although some sources have credited the voice of the Guardian to
James Doohan, it was actually performed by
Bartell LaRue. The actor later appeared
onscreen in the episode "
Bread and Circuses", and provided further voiceover work in "
The Gamesters of Triskelion", "
Patterns of Force" and "
The Savage Curtain". Also returning to
Star Trek in this episode were David L. Ross as Lt. Galloway and
John Winston as Lt. Kyle.
Filming and post production Filming began on February 3, 1967, with an expectation that it would take six days to film. The shoot was completed a day and a half behind schedule on February 14. The overall cost was $245,316, compared to the budget of $191,000 for this episode. The normal budget for episodes during the first season were $185,000. Roddenberry later claimed that around $257,000 was spent on the episode, and said that he could have saved a further $20,000 if he had not insisted on high-quality casting and sets. He also claimed that the original Ellison version would have cost a further $200,000 on top of what was already spent. The shoot began on location at the
Desilu Forty Acres, with Pevney aiming to complete all the location filming in a single day in order to complete the episode in the allocated six days. The site had been used previously for the episodes "
Miri" and "
The Return of the Archons". None of the producers expected him to do so, but with the series already $74,507 in the red and with two more episodes left to film, Desilu had to appear to NBC to be trying to keep to budget. Extensive work was completed during the daylight hours, on the set that had been used for other series such as
The Andy Griffith Show, with Floyd's barbershop appearing in some of the shots. The filming continued into the night, and with Pevney running out of time, he was not sure when to stop. The problem was that other series such as
Rango and
Gomer Pyle had the sets booked up for the next several days, and they were unsure whether they would have time to return and film the missing scenes. After a weekend break, filming resumed on the Desilu Gower Street sets, where
My Three Sons was normally shot. These were used to represent the interior of the mission where Keeler nurses McCoy back to health. DeForest Kelley felt that McCoy should also fall for Keeler; so Pevney shot the scenes with that element included but never included it in the final cut. The following two days were spent on the same sets, while on day 5 the action moved to the bridge set for the
Enterprise. This day's shoot was meant to include scenes in the transporter room and in the
Enterprise corridors, but by now the production was a full day behind and these were pushed to the following day. Partway through day 6, the filming moved to a neighboring set for the exterior ruin shots and the Guardian of Forever, which was used for the next two and a half days. The montage of historical footage was all taken from the Paramount film library, as was the footage of the
Brooklyn Bridge. Harlan Ellison long maintained that the ancient ruins were the result of someone's misreading his description in the script of the city as "covered with runes". When informed that the word "runes" did not appear in any version of his treatments or script (or any rewrites), Ellison responded in
Edge Words, the letter column of
IDW's comic book adaptation of his original script, by admitting that his memory was faulty and that he actually told Matt Jefferies that the set should appear "Ancient, incredibly ancient, with runes everywhere..." He surmises that he perhaps slurred the word "runes" and Jefferies misheard him.
Music There are a number of musical pieces reused from earlier episodes in "The City on the Edge of Forever", including sufficient use of the scores from "
The Cage", "
Where No Man Has Gone Before" and "
The Naked Time" that
Alexander Courage received an "additional music by" credit. Further pieces came from "
Shore Leave", "
Charlie X" and "
The Enemy Within". A partial score was created by
Fred Steiner, his final work of the first season. His work on
Star Trek tended to focus on the use of
violins and
cellos to highlight romantic moments, and he did not use
violas in any of his works on the series. This episode originally featured the 1931 song "
Goodnight Sweetheart", which was originally composed by
Ray Noble with lyrics by Jimmy Campbell and Reg Connelly. For the version used in the episode, the lyrics were recorded by an unknown
session musician. It had been licensed to appear in the episode, and at first, Steiner sought to use motifs from "Goodnight, Sweetheart" as the basis of his score. He wanted this to be subtle and introduce the melody of the song over time, but Justman realized what Steiner was attempting and rejected it on the basis that he did not want the song introduced too early in the episode. Another work of Steiner's that was rejected for "The City on the Edge of Forever" was an alternative main title track using
saxophone and
celesta, which he had hoped would set the episode in the tone of the 1930s. The music recorded specifically for "The City on the Edge of Forever" was recorded in
stereo, which was unusual for the series. This was rediscovered when a 15-disc soundtrack of
The Original Series was being compiled by La-La Land Records, which they hypothesized was because the accompanying vocals appeared on a separate track. By the time "The City on the Edge of Forever" was released in the 1980s for home media use, such as on
VHS and
Laserdisc, the license for the use of "Goodnight, Sweetheart" had lapsed and was instead picked up by a different studio. A new score was composed to replace the song where it was used in the episode; however, the new pieces did not match the existing Steiner works as they used a different orchestral arrangement. Steiner was not contacted or informed of the changes to the soundtrack requirements, and this was instead composed by
J. Peter Robinson. The original intention was not to restore "Goodnight, Sweetheart" to the
DVD release, and issue the DVD with a disclaimer on the box, "Some music has been changed for this DVD." However, the original "Goodnight, Sweetheart" portion was erroneously included and Paramount reportedly had to pay royalties. Since the royalties had been paid, all subsequent releases have included the original "Goodnight, Sweetheart" music and with the 1980s scores omitted. ==Reception==