Spoiler alert for a few plot lines from “The Way Back.”

Art imitated life in more ways than one at the premiere of Warner Bros.’ sports drama “The Way Back,” held Sunday afternoon at the Regal LA Live downtown.

“One of those weird parallel things happened in this movie,” said Ben Affleck, who stars as a high school basketball coach struggling with the death of his child, the demise of his marriage and binge-drinking habits. “In the story, the coach gets more from the players than the players get from him ultimately. I feel that way about the young men who play those players.”

But the similarities on everyone else’s mind is the newly sober Oscar winner’s portrayal of a character in active alcoholism — a real-life role he has decades of experience embodying.

“For me, it takes an emotional connection to the character,” Affleck said. “He’s a recovering alcoholic, he’s going through family strife, a divorce. But also there were things I couldn’t imagine. One was being good at basketball — I’m not. You try to bring your own life experiences to the parts that you can and use your imagination on the other parts.”

As it turns out, the toughest challenge of this role was not the drinking, but rather something unimaginable for Affleck — the loss of a child.

“I’m not even comfortable contemplating that,” he said. “That was the most affecting and difficult part — trying to go to a place where you imagine something as tragic as that. How do you keep going? What do you do? How do you pick yourself up? That’s a real situation that people face — and one that was hard to explore.”

He added, “My goal with this was to make something that would feel enduring and lasting. For those who may be moved by the idea that you can face hard things and get better? Yeah, I’m really proud of that.”

Affleck’s co-stars praised his commitment to the role.

“He went right from rehab to this movie,” co-star Al Madrigal told Variety. “I wasn’t whipping out a flask on the sidelines, but Ben had it handled. He has a good sense of why he is not going back [to drinking] — because he’s doing this for his children and he wants to be a guy that they can look up to.”

Producer Jennifer Todd recalled when the script was sent to Affleck with an offer to star and direct.

“Maybe they thought for the right reasons it would connect with him,” Todd said. While Todd acknowledged that actors typically gravitate toward characters that seem like a stretch, she told Variety that isn’t always the case. “If they feel there is something that speaks to them that they can mine in a deep emotional fashion, then yes, you can go there. I thought it was brave of Ben to want to play something that felt familiar.”

Janina Gavankar plays Affleck’s estranged wife in “The Way Back.” And she, too, knows what it’s like to lose a loved one to the grip of addiction. “I have been in a relationship with someone who is an alcoholic,” she told Variety. “It was harrowing. I identified so much with [my character] and how much she loved this man — but could not help him.”

She said she found the experience therapeutic. “Ben and I did the exact same thing with our roles,” Gavankar said. “What we had been through, what we were currently going through, how that was similar to our characters and how we were both going to be unafraid of showing that together in our work.”

Michaela Watkins, who plays Affleck’s sister, called it a “great joy” to play people she’s too afraid to be herself.

“To get to the point in his career for Ben to play somebody who’s got some parallels with his life? I think that’s the bravest,” Watkins said. “That’s the scariest thing you could ever play.”