“The Girl on the Train” is an adaptation of Paula Hawkins' runaway smash novel, which debuted at No. 1 on The New York Times' best-seller list in February 2015 and stayed there for 13 consecutive weeks. Yet even before the book was released, the film adaptation was already barreling forward.

Nearly a year before the book was published, Dreamworks Pictures acquired the rights for producer Marc Platt. By the time the book was coming out, screenwriter Erin Cressida Wilson was turning in a draft of the screenplay.

“Even in a manuscript form, ‘The Girl on the Train' sort of leapt off the pages as a contemporary suspense drama-slash-thriller,” Platt said. “It has all the mechanics of a thriller, but at the heart of it was a great character study. It had three female characters, all flawed and, therefore, conflicted. They feel human to us; they don't feel perfect because they are not.”

Directed by Tate Taylor (“The Help”) and opening Oct. 7, the film stars Emily Blunt as Rachel, a woman emotionally unraveling from the breakup of her marriage and her spiraling alcohol abuse. She rides a commuter train every day past the home she used to share with her husband, who now lives there with his new wife, Anna (Rebecca Ferguson), and their infant daughter.

At the same time, Rachel fantasizes about the lives of a neighboring couple that includes the beautiful, young Megan (Haley Bennett). When Megan goes missing during a period of time in which Rachel blacked out, it sets in motion the unraveling of a series of mysteries.

In the book, the story is told from the alternating first-person perspectives of Rachel, Anna and Megan. The challenge of externalizing the novel's shifting series of unreliable narrators and inner monologues fell to Wilson, who first gained attention with her screenplay for 2002's racy “Secretary” and was more recently a writer and producer on the short-lived television series “Vinyl.”

“Because we didn't know that the book would be a success, we were making the film for the film's sake, not the film and the fan base,” Wilson said.

“I definitely pulled the book in closer,” she continued. “The film is basically the cinematic retelling of the book. It's really not gratuitously different. I really tried to do the book in cinematic language. My favorite line in the screenplay is ‘the camera is drunk.' I tried to do some drunk filmmaking, to get the film to be confused in that way. My other favorite line is ‘I'm afraid of myself,' which I think is the core of the film.”

The major change between the book and the movie is the shift from being set around London to upscale suburbs outside New York City. At the same time, the London-born Blunt retains her English accent as Rachel.

“It seemed like a cool wink and a nod to the true location of the novel,” Taylor said, “and then also how great would it be to add to her isolation and loneliness if she's this Brit all alone that couldn't be further from where she's from, in a crappy apartment with a judgey roommate. So keeping the accent just heightened her situation.”

Besides Blunt, Ferguson and Bennett, the production assembled an extravagantly good-looking cast, including Justin Theroux, Luke Evans and Edgar Ramirez alongside Allison Janney, Lisa Kudrow and Laura Prepon.

“I just wanted the movie to be sexy,” Taylor said. “Sexy's always the way to go. It just is. And let's face it, this is a novel about lying and desire and sex, and how do people use sex as a weapon and a medication and how it can destroy.”

Hawkins was in many ways the ideal author for a film project: supportive, available and essentially hands-off. Hawkins and Wilson finally met in person when they were both on the set for the shooting of a sequence in New York's Grand Central Terminal.

“Once I said to go ahead, it's your project, I thought it best to stay out of it,” Hawkins said. “The book is my thing, the film is theirs.”

mark.olsen@latimes.com