STUDIO CITY, Calif. -- Let's face it: The TV comedy genre needs a major overhaul. Most of the new sitcoms that premiered this year weren't funny. The earliest casualty was NBC's "The Mike O'Malley Show," which was canceled after only two episodes aired.
Sitcoms are in a funk, but a few gems remain.
"O'Malley's" neighbor on the Studio City lot is thriving in its second season. That's where the writers and producers of NBC's "Will & Grace" spend their days concocting stories about a straight woman and gay guy who are best friends in New York City.
A slight breeze blows through the open doors and windows of this quaint production headquarters -- Bungalow 2 on the same lot that housed "Seinfeld," "Roseanne" and "Gilligan's Island." It's as good a place as any -- actually, better than most -- to witness the creation of a sitcom.
On a warm July day, five writers perform surgery on the main plot of "I Never Promised You an Olive Garden," the episode scheduled to air Tuesday at 9 p.m. (unless it's pre-empted by baseball).
The show's creators and executive producers, David Kohan and Max Mutchnick, work with a smaller group of writers elsewhere in the building on the episode's "B" story. This secondary plot features Jack (Sean Hayes) talking to a boy who doesn't yet realize he's gay when Karen (Megan Mullally) goes to meet her stepson's school principal.
In the "A" story, Will (Eric McCormack) and Grace (Debra Messing) are bored with their old friends, Rob and Ellen, and they try to ditch them in favor of two new friends, Kai and Naomi.
"It's like they're cheating on their old friends," said co-executive producer Jeff Greenstein. "They lie to their old friends because they want to go out with their new ones, the lie catches up with them, they apologize and then they do it again. We're trying to play some of the conceit of the wife and the other woman."
Story editors Tracy Poust and Jon Kinnally wrote the episode, but they're not shy about admitting their script needs work.
"When we were writing the script, Jon and I knew the script was not working," Poust said. "Our act breaks are in the wrong place, and we kept saying this has got to change dramatically."
"We knew it would change, but that it would also get a lot better once the room got at it," Kinnally said.
That's normal in the world of sitcom writing.
"Ultimately, everything is a group process," said supervising producer Adam Barr.
The "Will & Grace" staff began planning for the new season in June, breaking seven stories in two weeks. "Breaking a story" means the show's nine writers gather at conference tables in the writer's room to hash out the plots of the episodes.
"We start figuring out what is the beginning, middle and end [of each episode] and begin to break it down into individual scenes," Greenstein said.
A writer or a writing team of two is sent off to come up with an outline for the episode. When that's done, they bring the outline back to the full group to work on it further, then they go off and write a first draft.
On this day the staff is doing a group rewrite, the next step in the process for "I Never Promised You an Olive Garden" (so named because a plot point involves an Olive Garden restaurant in Secaucus, N.J.).
But it's not writing like you might imagine. At "Will & Grace," the job isn't drudgery -- it's a good time. A bunch of clever, funny people sit around throwing out lines and laughing at the suggested dialogue.
They work on an excuse Will gives to Rob and Ellen.
"Actually there's a funny story connected to that elevator," Barr says, coming up with a line for Will.
"Mrs. Glasser has a diabetic poodle," co-executive producer Alex Herschlag adds, continuing the line.
Others join in, trying to pick out the funniest illness for the poodle.
"Epileptic?" Greenstein suggests.
"Rheumatic?" Barr says.
"Manic-depressive," Herschlag says. That's the keeper. For now.
Script coordinator Michelle Spitz sits at the back of the room, typing the constant revisions into a computer. A 32-inch monitor at the front of the room allows the writers to see the changes she's making.
"You have to have a little ESP and hear everybody at the same time and try to figure out where they're ending up," Spitz said.
Where the writers end up during the group rewrite of a script may not be what makes it to air.
"This is the point where we love everything we do," Greenstein said. "Then we see the actors do it and realize that maybe we don't love so much what we did."
After this stab at the script, the writers will give the show one more polish before it's sent to studio brass, network executives and the show's cast, who come in to read through the script. After the actors read the script aloud (called a "table read" in industry parlance), there's a rewrite, followed by a production run-through and another rewrite, then a network run-through and still another rewrite and sometimes there's one last rewrite before taping Tuesday night.
"If there was no shoot night, we would keep doing that forever," Herschlag said.
In July, time seems infinite for the "Will & Grace" writing staff. Once production begins, creating episodes becomes a never-ending machine. The time to work on outlines shrinks or disappears, and smaller groups are formed to write a greater number of scenes at the same time.
For now, the atmosphere is tension-free. The writers crack themselves up working on the farcical scene in which Will and Grace try to get rid of Rob and Ellen. Grace says Will's not feeling well.
"He's got diarrhea," Herschlag suggests for Grace's line.
"You know those Olestra chips?" Barr says, continuing the line.
Someone suggests Rob's response: "Say no more, we understand."
"If anyone understands, it's Ellen," Herschlag adds to Rob's line as the room erupts in guffaws.
Not everyone is thrilled. Poust, whose name will be on this episode as a writer with partner Kinnally, isn't wild about the line.
"I hate to be involved in any kind of poop joke," Poust says. "I hate that stuff, and Jon loves it."
The exchange remained in the script for a number of drafts, but ultimately it was dropped.
"It made it pretty far down the line," Greenstein said by phone last week, laughing when he's reminded of it. "Everyone has done Olestra jokes, and it didn't seem as funny on the last day."
The "manic-depressive poodle" line was cut, too.
It's not as though writing a sitcom is a science; it's an art based on instinct, and sometimes even those instincts prove wrong.
"It can be fantastic on paper and then you see it [performed] and say, 'That's not going to work,' " Poust said.
Often, last-minute changes are made between takes during taping.
"What made us laugh weeks ago suddenly dies in front of an audience that's been bused in," Barr said. "So we huddle and play comedy Hacky Sack until we find something [that gets a laugh]."
A mini-firestorm erupted last month before the season premiere, when socialite Karen told her Salvadoran maid, Rosario (Shelley Morrison), "Hey, you're on the clock, tamale, get to work!"
Hispanic groups learned of the line in advance and were offended. "Tamale" was replaced by "honey" in a last-minute dubbing session before the episode aired.
Greenstein said when it was filmed, the episode included a retort from Rosario ("You are perhaps the most ignorant woman in the country!") to show Rosario gives as good as she gets.
But Rosario's response was cut because the episode ran long.
"We thought it was part of the sparring," Greenstein said. "The counterpunch got cut, and I think that's what people got upset about."
The "Will & Grace" writers say the show isn't just a collaboration among writers, but with the actors. Greenstein, a veteran of "Dream On" and "Friends" and co-creator of Fox's "Partners," said the show is written with an eye for the strengths of the casts.
"We have four exquisitely tuned instruments on this show, and we try to do a good job over the course of the production week to make sure everything we give them is the best possible material for them to perform," Greenstein said.
Messing, who stars as single gal Grace Adler, praised the show's writers, particularly creators Kohan and Mutchnick, who set the tone for the series.
"Max and Dave's voice was very specific," Messing said this summer at an NBC party. "I had read a lot of scripts, and it's incredibly difficult in the very beginning to create characters who are really well-developed, but Max and Dave were able to do that.
"As TV writers, they're very courageous," she continued. "They're not scared to throw out their work. They're very passionate in their search for the funny."
To some critics and viewers, the funniest part of the show isn't Will and Grace, but their sidekicks, Jack and Karen. Kohan and Mutchnick said the supporting characters work best when there's a solid central story for the show's leads.
"Every episode has to be emotionally grounded, and that always starts with the two of them," Mutchnick said. "[Will and Grace] will always be the center of the show."
Kohan said Jack and Karen serve as a sort of burlesque of Will and Grace.
"You don't want those characters going off and having their own separate shows," Kohan said. "Jack and Will are good friends and Karen is Grace's assistant, so without Will and Grace they're untethered."
Greenstein said the series fell into a pattern last season of pairing Jack and Karen that may have "reinforced the notion that there were two different sitcoms going on concurrently. We're trying to mix it up more this year."
"Will & Grace" entered the media spotlight in September 1998 as the first post-"Ellen" sitcom to feature a gay lead character in Will Truman.
Herschlag worked on "Ellen" the season that led up to her coming-out episode.
"She was the first person to have a show like that, she was breaking new ground, and Max and David have said that led the way for this show," he said. "But I think in the last year of 'Ellen,' being in new territory, every show was gay-oriented. What makes ['Will & Grace'] radical is we accept the characters are gay and don't make a big deal about it. We don't shy away from the fact [Will and Jack] are gay, but it's not their defining characteristic."
Mutchnick, who is gay, and Kohan, who is straight, based the show to some degree on their own friendship and on other people in their lives. This season they'll explore the lives of Will and Grace separate from one another. Already Will went on one date, but Mutchnick said the series was never intended to be the story of a gay man in New York City.
"Our goal every week is to write the most entertaining program," Mutchnick said. "If it comes from a date of Will's, great. If it comes from Will doing Jack's taxes, that's what it will be. ['Will & Grace'] is the story of two friends. One happens to be gay, so the writing is informed from that point of view."
For a behind-the-scenes look at the "Will & Grace" set, visit http://homeadvisor.msn.com/ie/homes/vtours for a virtual tour.