Steve Carell's character in The Way Way Back was inspired by co-writer and director Jim Rash's real-life experience with his stepfather, he has revealed.
Jim and his friend Nat Faxon wrote the comedy about teenager Duncan, played by newcomer Liam James, who goes on a family holiday with his mum (Toni Collette) and her new boyfriend, played by Steve, who is horrible to him behind his mum's back.
In the film Steve's character asks Duncan to rate himself out of ten as a person, and then tells him he's a three.
Jim, who also cameos in the film along with Nat, said: "I was called a three by my stepfather. One year on our summer vacation he asked me what I thought I was, and I told that story to Nat. So that was a verbatim scene that we started the movie with and just let it theme the rest of it.
Nat quipped: "I didn't write any of that stuff. Just the comedic parts were mine and the sad, lonely parts were Jim."
The duo, who co-wrote Oscar-winning film The Descendants, were delighted to have Steve and Sam Rockwell on board.
Jim revealed: "We needed Steve for his innate likeability, to give Trent that undertone of what makes Pam attracted to him and why his friends hang out with him, but also make him this fully realised tragic male character, who has his own complications, despite being a little tactless when talking to kids."
Sam plays Owen, the wise-cracking owner of the antiquated Water Wizz water park, who takes Duncan under his wing.
Nat said: "What Sam did in the film is above and beyond what we could even have hoped for. He's such a wonderful actor with such a range, and he plays a lot of seedier characters, but when you meet him he really is closer to Owen than any other people he plays."