DeuceDavid Simon and his creative crew are used to creating whole cities with their ambitious TV series — and changing the medium along the way. First it was Baltimore in “Homicide,” “The Corner” and the superb “The Wire.” Then post-Katrina New Orleans with “Treme.”

He began mixing the city with a slight period piece in the underrated “Show Me a Hero.”

His latest, “The Deuce” (HBO, 9 p.m.), zeroes in on the height of early 70s sleaze in New York’s Times Square — done so exactingly you almost expect to see Travis Bickle cruising by from “Taxi Driver.”

Like his other series, there are at first so many characters, it almost becomes dizzying at first trying to keep track. What would first seem to be about a couple of pimps, trading funny stories as they keep their eye on fresh prospect runaways at the bus station turns to the array of streetwalkers themselves.

Chief among those, for her Hollywood credits alone, would seem to be the character portrayed by Maggie Gyllenhaal, who at 39 would seem a little old for this kind of role, and yet that’s precisely her character arc — looking into the possibilities of pornography from behind the camera (just as the actress is also a producer on the series).

Busier among the cast is James Franco if only because he is playing both sides of twin brothers — one a ne’er do well (and losing) gambler, and the other a more ambitious barkeep whose fortunes are tied to the mobsters to which his family are beholden.

A success at the bars he opens, and understanding that part of the appeal of a Times Square dive is the sheer variety of the people who attend, he is being groomed for something bigger. And that, too, in the longhand storytelling of Simon and the ace novelist George Pelecanos, is something that will become more clear as the series goes on.

In the first four episodes I can tell you that they make the most not only of the subject matter — HBO, in celebrating premium cable, loves its nudity and sex in service of a story, as much as it loves its violence. And they probably love using all the 70s props and costumes that may have been leftover from the flop “Vinyl” — though that was slightly later in the 70s.

But who knows how long of a time period “The Deuce” will cover? Already it has every indication of being an absorbing, crowd-pleasing hit that will be head and shoulders above any Sunday night fall competition. By now Simon and company are masters at creating episodes of TV that build on the characters and story even as they create these vivid portraits now not only of a place, but of a time as well.

And while some people cheered when 42nd street was cleaned up to make way for the Disney Store and franchise restaurants to corral the tourists, most know there was something lost when the sleaze and its characters were removed. “The Deuce” has found it again — to the delight of the younger actors.

“As a young actor,” Franco told reporters at the TV Critics Association summer press tour, “my kind of Bible was the American films of the ’70s, and in particular, my favorites were all the films that came out of New York, the Scorsese films, the Lumet films, and films like ‘French Connection’ and ‘Mean Streets’ and ‘Taxi Driver’ and ‘Dog Day Afternoon.’

“So I was already well researched, or at least had a very particular view of that time and place, and then I thought it was, for me, such a great thing to not only get to enter that world that I came up just dreaming about, but I got to do it with these guys who are all about realism.

“I could kind of combine my romantic notions of old New York with, you know, these guys that are ‘just about the facts, ma’am,’ and I think it created a really exciting kind of combination that crackled and had real meaning, that there was a point to go back and look at that time.”

The research part was right, Pelecanos said.

“In addition to doing a tremendous amount of research, we have consultants that we hired from all those categories,” he said. “We have former porn actors, actresses, directors. We have police, journalists, and they’re with us the whole time. They see the scripts before we publish them. They see the scripts and give us notes. That’s continual.

“My biggest fear,” Pellecanos said, “is somebody watching this and saying, ‘That’s bullshit. They got it wrong.’ So we’re very diligent about that in trying and make sure that we get the right story.”

But asked whether it was playing into criticism of HBO using nudity, sex and mistreatment of women in their most prominent series, Gyllenhaal said it was important to look at those things.

“I think it’s become clear, in a way that maybe it wasn’t totally clear a year ago, that there is a huge amount of misogyny in the world,” she said. “I think we thought we were in a better place than we were. And here we have this opportunity to pick it up and lay it on the table and to do it in a way that’s thoughtful and smart, I think, and also real.

“That includes having to see some things that look violent and uncomfortable. But I think, if you don’t put that on the table and take a really good, clear look at it, nothing will change, nothing will shift.

“To me, I feel like playing a prostitute who does go through very, very different things, as a filter through which to look at women in our relationship to sex, to power, to cash, to art, is maybe the most interesting one of the most interesting ways to go into really exploring the state that we’re actually in right now.”

And if you’re criticizing “The Deuce” for sexual commodification — that is, in fact, the story they’re portraying, Simon said.

“That’s what the product was,” he said. “That is what has been sold to the point where now, in America, we don’t sell a can of beer or a Lincoln Continental without sexual connotation and sexual imagery that encompasses the world of porn that we’ve inherited and that we’ve created. That’s what the show’s about.”