We were playing around with a lot of ideas for sitcoms but they didn’t seem real. So we thought, how about what we talk about between ourselves – our kids and the idiotic things that happen in our households? Is there a way to do a family show – which is, in a way, the most trite subject on TV – that makes it a bit more real? That got us to the documentary-style idea. And we wanted the families to be united in some way, so we made them three parts of a whole.

Comedy had become this thing that was easily consumed, but ultimately not very nutritious. There was lots of snarkiness and cynicism but nothing uplifting, nothing good for the soul. No protein! We wanted our show to have some heart, which left us open to criticism that we were being sentimental. But we wanted moments of drama and emotion.

‘We knew we wanted to have multiple families, to bounce back and forth’ … the cast of Modern Family. Photograph: Bob D'Amico/Getty Images

When it came to casting, I had worked with Ty Burrell, who plays Phil Dunphy, on a couple of things, and couldn’t understand how he had been floating around as long as he had without being on a hit show. Appealing, good-looking, so funny – it just doesn’t happen that often. We wanted him, but the network didn’t. But we shot a scene with him and to their credit they saw what he has and said: “We were wrong.”

It was similar with Sofía Vergara, who plays Gloria. A beautiful woman who is funny and also kind of a natural clown? We were pretty much sold.

Rico Rodriguez (Manny) hadn’t done a lot of acting. At castings you usually see a procession of Hollywood kids with sparkly teeth and moms waiting in the wings mouthing their words along with them. But he didn’t have that at all. He was just a very bright, likable kid with a raw quality that seemed real. He’s learned as he’s gone on and got better and better, but there’s that core innocence and sweetness about him that we liked from day one.

Pierce Wallace and Rico Rodriguez in a scene from season seven. Photograph: Peter 'Hopper' Stone/ABC via Getty Images

The mockumentary format felt current, in an age when reality shows were – are – so popular. Plus I had just done an experimental low-budget pilot and shot it documentary-style and really fell in love with the form. From a production standpoint, it allows us to move so much faster. You get the spontaneity of being able to shoot both actors at the same time and not letting jokes get stale while you do coverage. Our hours are great; everybody’s happy.

When it came to constructing the family, there were so many points we could have made. We knew we wanted to have multiple families, to bounce back and forth between them and connect them. We talked about all sorts of different permutations. Three siblings? One single, for the dating stories? But I had worked on Just Shoot Me!, and Chris and I had both worked on Frasier, and we loved the idea of a father with adult kids. He could be starting over. Then we wanted cross-cultural aspects – the father’s new wife could be African American, Hispanic, Asian, for example.

I see a lot of pilots, and what people do is create characters that work for that initial episode, but once that story’s over they don’t know what to do because they haven’t clear conflicts or relationships. It took us about six weeks to figure out who everyone was, before we even looked at plot. Then our casting director Jeff Greenberg saw about 1,400 people for the 10 roles and we saw about 200-300 of them.

Watch the trailer for Modern Family

We had already cast Jesse Tyler Ferguson as Mitch and were trying to find him a “mate”. Eric Stonestreet (Cameron) was a surprise. He wasn’t who we were picturing. That happens a lot. His audition performance was very still, very precise. Nobody beat it. We kept coming back to him.

Chris and I were nervous about kids. At one point I said: “Argh – maybe we should make this an animated show!” But we started seeing them and were blown away by the quality of the choices we had. We struck gold.

There’s always a lot of excitement when you start shooting, but people are very nervous. There’s so much at stake and you don’t know – are we working on something that’s going to shoot for a few days or will this be the next 10 years of our lives? I remember the last day of the pilot so well. We were in the backyard of Mitch and Cam’s house and I was watching the monitors and I turned to Chris and said, “You know, this is really good! I think we could have something here.”