It was October 2007, a month before filming began on The Lovely Bones, when Fran Walsh realized she had miscast her male lead.

The co-writer/producer, along with director Peter Jackson and the rest of the filmmakers, had cast Ryan Gosling and Rachel Weisz as parents of 14-year-old Susie Salmon, whose murder and journey through the in-between powers Alice Sebold's novel and the film. Although Gosling, then 27, had grown a beard and packed on 20 pounds to appear more convincing as the father of a teenager, he dropped out because of what was reported at the time as creative differences.

But Walsh says that everyone agreed he was miscast.

Ryan came to us two or three times and said, 'I'm not the right person for this role. I'm too young,' she recalled. And we said, 'No, no, no. We can age you up. We can thin your hair.' We were very keen.

It wasn't until we were in preproduction and we had the cast there that it became increasingly clear: He was so uncomfortable moving forward, and we began to feel he was not right. It was our blindness, the desire to make it work no matter what.

That desire to make Bones work has powered the filmmakers through several obstacles on the path to awards season. Case in point: Mark Wahlberg, who is a decade older and the father of three, quickly was signed to step in for Gosling.

He has seven or eight siblings, and he understands the chaos of family, Walsh said. He really anchored the story. He gave a solidity to the storytelling from our point of view.

Before Bones could become a Jackson film, the director needed to secure the film rights from FilmFour. The film unit of London-based Channel 4 first boarded the project in 2000, when Bones was an uncompleted manuscript.

Sebold's haunting novel about the impact of a teenage girl's brutal murder went on to become a worldwide bestseller upon its publication in 2002, and Hollywood suitors beat a path to FilmFour's door.

Jackson, for his part, was eager to return to an intimate drama after the megabudget spectacles of The Lord of the Rings trilogy and King Kong. His enthusiasm for Lovely Bones was initially met with skepticism by FilmFour, which wanted to develop it with a British director.

The parties came to an unusual agreement: Jackson wanted to bankroll a rights deal and a lengthy development period at his New Zealand-based Wingnut Films, rather than deal with a studio and its time pressures. In return, the director agreed to make Bones his next movie after 2005's Kong.

So you feel a lot of care will be taken, but you won't be out there eternally, not knowing whether you'll have a movie, Jackson's manager Ken Kamins said of his pitch.

Jackson said it was important for him not to be on any set time-table. We write as many drafts as we want until we're happy with it, he said. Bones took a year or two, some of it accomplished while finishing Kong.

It's very much an adaptation of the book, Jackson said of the shooting script. But we changed a lot of it. The book almost goes right into the murder of Susie, but for a film, we felt that her murder would be more powerful if we'd gotten to know her and her family, so we used the murder as a traditional end of a first act.

We also played around, in a way that we can do on film that Alice couldn't do with the book, with the identity of the murderer. We didn't want to immediately tell people who the murderer is, although it isn't a whodunit. We were able to use cinematic devices: We showed him in a crowd of people but never showed his face for the first few times.

Jackson, Walsh and Philippa Boyens completed the script in April 2007, set a beginning budget of $65 million and began the hunt for a studio partner. All studios were invited to bid except New Line, which Wingnut was challenging in court over Rings royalties. Kamins asked suitors to produce a marketing plan, and in early May, he received bids from DreamWorks, Universal, Sony and Warner Bros. DreamWorks won with a reported $70 million bid.

Producers cast Saoirse Ronan as Susie, Stanley Tucci as her murderer and Weisz and Gosling as her parents. Once Gosling was replaced with Wahlberg, filmmakers shot autumn scenes in Pennsylvania, then moved to summery New Zealand for more exteriors, blue-screen shooting and postproduction. There, Jackson and his team were faced with the challenge of re-creating Sebold's description of the in-between, Susie's stopping-off point on the way to heaven.

The challenge of the story line is that she's not able to move on into heaven because she can't let go of the living and also she's still under the control of her killer, Jackson said. Her body hasn't been found, and she has to free herself of the killer even after she's been murdered. It was very difficult to do on film because it's in her subconsciousness, really. It's the land of dreams.

Jackson and his team got some extra time to pull off the visuals thanks to a release-date shift. Bones initially was slated for a March premiere, but spring break seemed an inappropriate time for such dark subject matter. In November 2008, Jackson showed a cut of the film to executives at Paramount, which had inherited the film after the studio's split from DreamWorks. It turned out to be a critical juncture.

At that point, they decided to hold the film back to December 11, and that was a blessing for us, Jackson said. It meant we had the one thing we'd never had before, which was time in postproduction.

Promising not to increase the budget, Jackson asked for the film back to tinker with it in post-production. That year and a half enabled the filmmakers to drastically enhance the film, crafting a lush yet unsentimental version of Susie's in-between.

We started to experiment, and we drifted away from the scripted version: We moved scenes around, Saoirse did new voice-over, we found a better structure that's not the structure we wrote, Jackson said. It has better pacing, better emotion, and it makes people cry more than before. It was a real lesson for us in what decent time in postproduction can give you.