“It’s a little morally challenged,” Mr. Ayer said, “but we know we can get away with it.”

A year later, it’s time for audiences to render their own verdict on “Suicide Squad,” the next entry in Warner Bros.’ film series based on DC Comics characters, which makes vicious felons of its all-star cast, including Mr. Smith as a coldblooded mercenary named Deadshot, Jared Leto as the cackling archfiend the Joker and Ms. Robbie as his murderous partner Harley Quinn.

“Suicide Squad,” which opens Aug. 5, follows a roster of second-tier criminals — Lex Luthor need not apply — who are manipulated by the government into forming a team. Dispensable and desperate to earn their freedom, the misfits suddenly become invaluable when they’re the only ones who can save the world from catastrophe.

The same could be said for “Suicide Squad,” the film itself, which comes just four months after “Batman v Superman: Dawn of Justice,” the critically reviled (if commercially successful) superhero showdown, directed by Zack Snyder, that opened up the wider DC movie universe and was supposed to leave fans eager for more.

Now it is up to “Suicide Squad” to rescue the reputation of this nascent franchise and keep viewers excited about further installments. To do so, the movie will have to make the most of its lineup of lesser-known characters (which includes members of Batman’s rogues gallery), a couple of cameos from Ben Affleck’s Caped Crusader and its darkly comic story line that seeks the good in some very bad people.

“They’re isolated figures with, let’s say, negative self-image,” explained Mr. Ayer, who wrote “Training Day” and directed the brutal action dramas “Fury” and “End of Watch” from his own screenplays.