Harold Ramis's Caddyshack is widely considered to be one of the all-time funniest comedies ever assembled. Starring such comedic titans as Bill Murray, Chevy Chase, and Rodney Dangerfield, the film about a young golf caddy (Michael O'Keefe) desperate to win a scholarship and turn his life around has been listed #71 on AFI's 100 Years...100 Laughs and #7 on AFI's Top 10 Sports Films. It's also listed #2 on Bravo's "100 Funniest Movies."

RELATED: The 10 Best Caddyshack Quotes That'll Have You Laughing

Caddyshack opened on July 25, 1980, and would go on to gross roughly $40 million against a $6 million budget. As the film enjoys its 40th anniversary, here are ten behind-the-scenes facts about the making of Caddyshack.

The Film Was Inspired By Real-Life Caddy Experiences

Caddyshack

While the screenplay for Caddyshack was written by Harold Ramis, Brian Doyle-Murray, and Douglas Kenny, the story was directly inspired by Doyle-Murray's time as a caddy at a golf club when he was younger. Several scenes in the film were lifted directly from his experience.

For example, the elderly Havercamp couple who can barely strike a golf ball was directly inspired by a similar couple Doyle-Murray (who also stars as Lou in the film) experienced as a country club caddy. Doyle-Murray's younger brothers Bill and John, as well as Ramis, also worked as caddies as young men.

Most Of The Best Scenes Were Improvised

Bill Murray in Caddyshack

Caddyshack was initially conceived as a basic coming-of-age tale about teenage caddies Danny (Michael O'Keefe) and Tony (Scott Colomby). But due to the wild, improvisational nature of bit players Murray, Chase, and Dangerfield, their planned cameos were expanded into the protagonists.

Many of the movie's most memorable scenes were improvised and ad-libbed on the spot. Carl Spackler's (Murray) "Augusta" speech was totally improvised, as was Murray's pitchfork "Dalai Lama" scene. Also, the dinner sequence in which Al Czervik (Dangerfield) insults the guests was completely ad-libbed by Dangerfield.

Florida's Weather Caused A Lot Of Problems

Caddyshack

To avoid studio notes and executive interference, Caddyshack was filmed in Florida rather than Los Angeles. The stifling heat in Florida during the eleven-week shoot in autumn of 1979 caused several cast and crew members to arrive on set late, or not at all. Mixed with an environment of hard-partying every night after filming, the cast and crew became exhausted.

At one point during filming, a hurricane hit Florida and ravaged the set so badly that production was delayed for multiple days. The cast and crew were staying at a hotel nearby, where the floors were covered with earthworms in the aftermath of the hurricane.

Don Rickles & Mickey Rourke Were Almost Cast

caddyshack-webb-noonnan

Prior to Rodney Dangerfield being cast in the film, the legendary comedian Don Rickles was heavily considered for the role. In the end, producers hired Dangerfield on the strength of his multiple appearances on The Johnny Carson Show.

For the lead role of Danny Noonan (Michael O'Keefe), another Irish actor was considered. Mickey Rourke was initially considered to play the role of Danny Noonan, but was ultimately rejected by the studio brass who claimed he was simply "not funny enough."

The 18th Hole Explosion Was Mistaken For An Airplane Crash

The 18th Hole Explosion

While filming Caddyshack near the Ft. Lauderdale International Airport in Florida, the production was constantly interrupted by low-flying airplanes. In one instance, a pyrotechnic stunt forced a commercial airline to report a crash to Air Traffic Control. Bill Murray's brother John was responsible for alerting Ramis of incoming air traffic on set.

RELATED: The 10 Best Golf Movies, According To IMDB

For the climactic 18th hole scene in which Carl blows up the golf course, a giant hill was constructed so that the real country club did not incur such damage. When the hill was detonated, the FX crew created such a large explosion that a low-flying commercial airline mistook the stunt as airline wreckage and reported the incident as such.

The Original Cut Was Over 4 Hours Long

The cast of Caddyshack

Believe it or not, the original cut of Caddyshack ran four and a half hours long, with the famous bits going a lot longer than one would expect. For one, Bill Murray's iconic "Cinderella Story" improvisational diatribe lasted roughly 30 minutes alone. When Orion Pictures saw the overlong cut, they implored editor William C. Carruth to reshape the movie around the comedic performances of Murray, Chase, and Dangerfield.

More than two hours of footage were cut, losing the main plot involving Danny and Maggie in the process. Producers were still unhappy with the narrative, as it played like a series of loose comedic vignettes rather than a coherently plotted comedy.

The Gopher Was Added At The Last Minute

The Gopher In Caddyshack

As a result of the lack of narrative structure in the truncated edit, producers added the entire Gopher storyline only after the movie was nearly completed. Against writer Doug Kenny's wishes, the Gopher was added to give the plot a more consistent throughline.

A mechanical Gopher puppet was created by Jeff Burke for a cost of $5,000. The scenes involving the Gopher were filmed on a sound-stage and done well after principal photography was completed. This accounts for the discrepancy in film quality between the underground Gopher scenes and the rest of the movie.

The Baby Rut Scene Was Inspired By The Writer's High School Days

The Baby Rut Caddyshack Scene

As per most of the events seen in the film, the infamous Baby Ruth scene was directly inspired by an incident that writer Brian Doyle-Murray witnessed in high-school.

RELATED: The 5 Best (& 5 Worst) '80s Comedies

The scene entails a teenager flippantly throwing a candy bar into the swimming pool, which mortifies every swimmer except Spalding and Spackler. Doyle-Murray remembered witnessing a similar occurrence in high-school and incorporated into the script. Looking closely, the candy bar reads Baby Rut, with the H left out to avoid product placement costs and/or lawsuits.

Rodney Dangerfield Was Inexperienced With Filmmaking

Rodney Dangerfield in Caddyshack

With only a few acting credits to his name at the time of making Caddyshack, Rodney Dangerfield was extremely unfamiliar with the filmmaking process while on set. Harold Ramis had to carefully guide him through his performance.

According to Chris Nashawaty's book Caddyshack, the first scene Dangerfield filmed was Czervik's arrival in the pro golf shop. Ramis called "Action!" three times, all of which resulted in Dangerfield remaining still. Finally, instead of yelling "Action!" Ramis said, "OK Rodney, now do your bit." Rodney proceeded to give a flawless take, including the improvised line about getting a free bowl of soup. From then on, Ramis would simply say "OK Rodney, now do your bit" for the remainder of the shoot.

The Spackler/Webb Showdown Was A Last-Minute Addition

The Spackler/Webb In Caddyshack

Bill Murray's role as Carl Spackler was filmed in just six days. When Ramis realized the two biggest stars in the film (Murray and Chase) did not share a scene together, he, Kenny, Murray, and Chase met for lunch to write the now-infamous showdown between Carl Spackler and Ty Webb.

Murray and Chase had a notoriously rocky relationship as cast members on SNL but were extremely professional during their one scene together. This scene is often considered the funniest part of the whole movie.

NEXT: 10 Best Bill Murray Movies, According To IMDB