In the fifth episode of Showtime’s “Your Honor,” Judge Michael Desiato (Bryan Cranston) finds his family dog unresponsive in his home and rushes him to the vet, telling them to do whatever they have to to save him. It is a moment of selflessness, serving to remind the audience that he has redeeming qualities, and is a good person at heart, despite the fact that for the last four episodes he has gone so far to cover up a hit-and-run his son committed that another teenager took the fall and his family has been destroyed because of it.

Despite the old adage of those in Hollywood avoiding working with children and animals because of the complications they add to productions, lately more and more television showrunners have been including canines as characters in their series. Some, such as the CW’s “In The Dark” and CBS’ “SEAL Team,” rely on these working dogs for intricate plot points, as they portray service and support dogs. Even more common, though, are canine characters as pets, as in “Your Honor,” who say something important about the human characters around them without the need for expository dialogue.

“If you want to represent real life and be universal, doing a family show, I think you need a dog,” says “Punky Brewster” executive producer Jim Armogida. “It brings a nice energy to the dynamic. If the only thing our dog does in the scene is sit on a chair and is just there, it still adds a nice layer of verisimilitude; it adds something to the menagerie.”

On series from CBS’ “B Positive” to Peacock’s “Punky Brewster” and Syfy’s “Resident Alien,” the presence of a dog in the life of a central character can help depict just how big-hearted that person is. On the former, Gina (Annaleigh Ashford) may party too hard sometimes but her ability to care for a sheep dog named Cannoli proves she is responsible and caring and really will come through in giving her old high school classmate Drew (Thomas Middleditch) the kidney she promised him in the pilot episode; Punky (Soleil Moon Frye) not only adopted two of her children and is on her way to fostering another, but she also is a dog mom; and in the latter, Sheriff Mike (Corey Reynolds) “has a hard time getting close to people, but he doesn’t have a hard time getting close to this little dog,” says showrunner Chris Sheridan.

In “Resident Alien,” Sheriff Mike is in charge of the safety of a small town in Colorado and he has a rare murder to investigate in the first season. Although he “comes across as very strong-willed and, at times, cold,” Sheridan continues, the writers wanted to show that he did have “warmth and capacity for love.” Enter Cletus, a small mixed breed dog that Sheridan believes is at least part French bulldog. “We added the dog to, in some ways, soften him,” he says.

Similarly on “B Positive,” Cannoli (played by Zeus) is opening up the neurotic and rigid Drew. “The idea was to have Gina’s life start to impose on Drew’s space, and a 100 pound dog seemed like a good place to start,” creator and co-showrunner Marco Pennette says. Quickly, Cannoli “was the first character Drew showed any real warmth toward.”

“I think a dog adds humanity to any character,” adds Kari Lizer, creator and showrunner of “Call Your Mother” on ABC.

In the case of “Call Your Mother,” the dog, a Golden Retriever named Ripper (played by a Golden named Orbit), belongs to Danny (Patrick Brammell), a man from which the titular character Jean (Kyra Sedgwick) rents a space and in whom she finds herself interested, romantically. Lizer notes that she wrote the dog as Danny’s because “when trying to create romantic chemistry, a man with a dog is automatically 40% dreamier,” but she admits that the quick bond Jean formulates with Ripper showcases her need for connection and intimacy now that her adult children have moved thousands of miles away and have not been cluing her in on their lives.

“Jean turns to Ripper when she feels like her children no longer need her. I think a lot of people can relate to relying on the comfort of a dog — or other pet — when their nest is empty, their heart is broken, they find themselves alone,” Lizer explains.

As episodes go on on these series, there will be times when these dog performers are called upon to perform special tricks or learn new behaviors, which require off-set training for the dogs and more time allotted during production of those scenes to make sure the show is getting what it needs. But because their primary function in the story is to be character-defining for some of their human co-stars, casting often comes down to the look of the dog, even more so than its ability to take direction.

“We were definitely aware that what you expect is this Sheriff to have a large German Shepherd or something, but to me it twisted it in an interesting character way that this man who is so strong and stands up to everybody has a smaller, cuter little dog. It struck me as funny and a good character piece,” Sheridan says of Cletus on “Resident Alien.”

Lizer admits she is just a “sucker” for a Golden Retriever, while Pennette points out that because he grew up with a sheep dog, “there was a part of me that was feeling nostalgic” in casting one on his show. Nostalgia played a big part in casting Sampson, a 1-year-old Golden Retriever, for “Punky Brewster,” as well, considering the titular character had a Golden Retriever named Brandon on the original series.

For “B Positive,” size mattered when it came to casting Cannoli because “we wanted a dog that was large enough to create funny moments with Drew, but also cuddly,” says Pennette. For “Punky Brewster,” a chemistry test with the leading lady was the main factor in selecting the specific Golden.

“We had them just do a few behaviors — I wouldn’t even call them tricks — just, would the dog follow Soleil? Would the dog hit a mark?” says Jim Armogida. But, “it was more important how comfortable they were with Soleil. We had the dogs come and meet with Soleil. Some of them immediately were running to her and getting pets and completely comfortable and others weren’t. You look at their energy to see if they’re calm around sudden movements or noises.”

Once the dog is cast, it is extremely rare that production is able to find a second dog who looks similar enough to have it act as a double, should the one they hired be unable to perform certain behaviors on cue, on-camera. Instead, these showrunners sometimes have to adjust what they had in mind for their canine character the same way they would for certain human characters.

Sheridan, for example, shares that the titular character of the alien (played by Alan Tudyk) really broke open for him once he had Tudyk in the role, while in the case of Cletus, scenes that originally had him sitting in the office while Sheriff Mike talked to him became “Sheriff Mike having to have the dog on his lap because if the dog wasn’t on his lap, the dog would run away.”

“You need to set your expectations with animals,” explains “Punky Brewster” executive producer Steve Armogida. For that show, “we’re prepared to move on and shoot without the dog if we can’t get what we need,” he admits.

But because once a show introduces a dog as a character, it makes scenes “more authentic” when “the dog’s presence is felt,” Pennette says, these shows are working hard to include these canine performers as much as they can.

“Any time you’re working with animals there’s an x-factor, but we still do it, and the reason we still do it is because is what we get outweighs the [complications],” says Sheridan.