Window of Opportunity (Stargate SG-1)

"Window of Opportunity" is the sixth episode from season 4 of the science fiction television series Stargate SG-1, and first aired on the American subscription channel Showtime on August 4, 2000. The episode is based on a time loop scenario, with SG-1 team members Colonel O'Neill and Teal'c repeatedly reliving the same ten hours after a mission on a planet. Since the rest of their team and all personnel at Stargate Command are unaware of the happenings and do not remember the time resets, O'Neill and Teal'c are forced to find a solution on their own.

Penned by Joseph Mallozzi and Paul Mullie, "Window of Opportunity" was the writing duo's second script, and their first episode to air. Mallozzi and Mullie later became executive producers of both Stargate SG-1 and Stargate Atlantis. The episode's unusual story style caused an unexpected shortage of footage during filming, which director Peter DeLuise compensated for by shooting additional scenes, many of which were humorous. "Window of Opportunity" is widely regarded as a fan favorite.

Plot
On a mission on P4X-639, a planet experiencing strong solar activity, the SG-1 team encounters an alien archaeologist named Malikai (Robin Mossley). When a geomagnetic disturbance hits its peak, the Stargate activates simultaneously on the planet and on Earth, and a flash strikes Malikai, Colonel O'Neill (Richard Dean Anderson) and Teal'c (Christopher Judge) near an Ancient altar. Moments later, O'Neill finds himself in the Stargate Command (SGC) cafeteria in the middle of a breakfast conversation with Dr. Daniel Jackson (Michael Shanks) and Major Carter (Amanda Tapping), who claim to have no knowledge of the planet. O'Neill and Teal'c later express familiarity with the events, and they are checked and certified to be in perfect health. Before SG-1 can resume their planned mission to the planet, an unscheduled offworld activation of the Earth Stargate, accompanied by flashes, transports O'Neill back to breakfast.

While the events at the SGC repeat themselves, Daniel makes first progress in the translation of writings in the photos of the ancient altar. SG-1 return to the planet where Malikai lets slip he too remembers what's happening, but O'Neill finds himself back at breakfast before the altar's activation can be stopped. With the help of O'Neill's and Teal'c's explanations, Carter devises a plan to break the time loop by preventing an incoming wormhole, which fails. Meanwhile, Daniel attempts to translate the altar's writing loop after loop, but his memory is reset each time along with everyone else's, and he cannot possibly translate it all within just a few hours. Ultimately, O'Neill and Teal'c realize the only solution is to learn and remember the alien language themselves. After many loops of teaching, Daniel makes an offhand remark about events that occur during each loop having no consequences once the loop is over, which inspires O'Neill and Teal'c to indulge in wildly outrageous behavior as a means of dealing with the boredom and frustration of being caught in repeating time. The pair play golf through the active Stargate (much to General Hammond's irritation in at least one loop), Teal'c takes action against the painful starts of his loops by slamming the door back in the face of the airman who accidentally hit him with it in the beginning of each loop, O'Neill tries pottery-making (clearly improving with each progressive loop), bicycles through the base, and just before the end of one loop, resigns from the Air Force whilst wearing an outrageous sweatshirt for the sole purpose of grabbing Carter and kissing her in the seconds before the loop resets.

After what is later believed to have been at least three months, Daniel is finally able to reconstruct the planet's history with the finished translations: the Ancients had attempted to escape a mysterious plague by building a time machine but never got it to work properly. Upon returning to the planet, SG-1 learn of the death of Malikai's wife, whom Malikai wants to visit in the past with the help of the time machine. O'Neill's experience of his son's death convinces Malikai to shut down the device before yet another new loop can start. Back at the SGC, O'Neill, Carter, and Daniel have their first breakfast after the loops, and O'Neill answers Daniel's question about unusual activities in the loops with a long look at Carter.

Production
"Window of Opportunity" was the second Stargate SG-1 script by Joseph Mallozzi and Paul Mullie, and their first episode to air. The writing duo's first script, "Scorched Earth", would air three episodes later. Choosing "Ad Infinitum" as the episode's working title, Mallozzi and Mullie originally pitched "Window of Opportunity" as a darker story from the finished episode. SG-1 would encounter a world whose scientists work feverishly on preventing an imminent apocalypse, but after being unable to find a solution in time, they initiate a time loop that would trap the SG-1 team. Executive producer Brad Wright however noted the similarities to the Star Trek: The Next Generation episode "Cause and Effect", and writer Robert C. Cooper suggested a lighter direction similar to the feature film Groundhog Day, which O'Neill would briefly reference in the episode. To simplify continuity in the shooting process, Brad Wright encouraged chaos-theory-type fluctuations in the story as early as in the episode's concept meeting. Director Peter DeLuise asked the prop department to glue the Froot Loops to O'Neill's breakfast spoon to have the same loops in the same spots in each take.

According to Paul Mullie, having Froot Loops as O'Neill's breakfast was not scripted, and he is unsure if the loop reference was intentional. This was contradicted by script coordinator Cath-Anne Ambrose who said "I had to get Froot Loops cleared [by the company that makes them], and so the guy calls me back and says, 'Well how do you feel about Eggo Waffles? Would you consider using Eggo Waffles instead of Froot Loops?' So I go to these guys [the writing department] and ask, 'How do you feel about waffles?' And they're like, 'No! It's Froot Loops! It's a time loop! No!' Waffle sales were down."

The off-world scenes were filmed on an interior sound stage, using occasional lens flares and off-camera fans to simulate weather. A matte painting by the in-house visual effects department later served as a sky replacement for the used greenscreen. The Vancouver-based company GDFX was responsible for almost all visual effects shots, some of which were re-used within the episode to save money. Other visual effects clips were re-used from previous episodes. "Window of Opportunity" was the first episode to feature a rear-screen projection in the briefing room. To speed up the shooting process, scenes were filmed in thematic blocks instead of in a story-chronological order, and short sequences were re-used to help the audience with a visual recall in new scenes. Sound effects were later added to give the wooden altar prop the impression of being made of stone.

It became evident by the third day of production that the episode was going to run significantly short, partly caused by the time-efficient filming style. The scene in which Daniel informs Jack and Teal'c of the opportunity to do whatever they like, was a late pitch by Brad Wright, who had also had the idea for some time to show someone golfing through the Stargate. Preliminary discussions about computer-generating the golf ball to not break the US$100,000 Stargate prop were later overturned, and the actors used a real golf ball. Many of the other humorous scenes in "Window of Opportunity" were improvised on set during filming. With juggling being one of Richard Dean Anderson's earlier careers, director Peter DeLuise filmed the juggling sequence in a last effort to fill the episode's time slot. "Window of Opportunity" has no deleted scenes.

As the first episodes of season four addressed the attraction between O'Neill and Carter, its after-effects were chosen to be still noticeable in "Window of Opportunity". The progressing frustration of Teal'c, "the man of infinite patience", is shown by his Kel'no'reem'ing (a fictional meditational state) during the briefing. The episode's main guest star was Robin Mossley as Malikai; Mossley would play a different character in the season 10 episode "Morpheus". Several crew members make cameo appearances in "Window of Opportunity". Nicole Forrest, the show's head of accounting and director Peter Woeste's wife, appears as Malikai's wife on a photographic device. One of Anderson's stand-ins on SG-1, Bill Nikolai, plays the technician in O'Neill's bicycle scene. Director Peter DeLuise briefly appears as an airman who helps Daniel recover from being repeatedly knocked down by Sgt. Siler in each loop. Siler himself is played by stunt coordinator Dan Shea. The name of writer Joseph Mallozzi appears as the author of the book that O'Neill and Teal'c use to study the Ancient language.

Reception
In his book Approaching the Possible, Jo Storm saw the episode's title hinting at an "inevitable" story line about the sexual tension between O'Neill and Carter that has been looming since the beginning of the series. The characters "break[ing] the rules of conduct for their jobs" (fraternization) made the episode "seem completely unnatural", while it allowed the writers to explore possibilities in the narrative. Jo Storm also credited the writers for breaking the "boring" convention of getting either only one or all teammembers caught in a time loop. The producers enjoyed having O'Neill and Teal'c instead of the usual intellectual combination of Carter and Daniel solve the puzzle. Peter DeLuise regarded the episode as "funnier" and "more lighthearted" than usual episodes.

A season 4 DVD review by digitallyobsessed.com gave "Window of Opportunity" 4 out of 5 points, calling it an "enjoyable", "charming", and "unique" episode and "one of the series' most entertaining stories". Other reviewers found the episode "hilarious" and "a fine example of SG-1 at its humorous best". The 2000 XPosé Yearbook ranked "Window of Opportunity" as the second-best episode of science fiction television in the year 2000. A sampling of fan opinions on space.com in 2001 showed the episode as a "clear favorite". In a fan poll conducted in 2007 on the Sci-Fi Channel's website, "Window of Opportunity" was voted the "best episode ever" out of thirty-two preselected Stargate SG-1 episodes, and the majority of participants in a 2007 SG-1 fan poll on MSN Canada named the episode their "favourite of all time."