CHICAGO (AP) -- For a series that has sold 5 million copies and is poised to become a major motion picture franchise, Veronica Roth's "Divergent" had humble beginnings.
"I wrote the first one in my jammies in my parents' house as a senior in college," said Roth, 25. "I didn't really know if it would go anywhere, but I thought it was worth a shot."
The third and final book, "Allegiant," comes out Tuesday, ending the dystopian series that follows heroine Tris through a walled-off Chicago where 16-year-olds must be tested and choose between joining one of society's five factions. Come Monday night, Harry Potter-style midnight release parties are planned across the country. The Hollywood version of "Divergent," starring Kate Winslet and Shailene Woodley, will be released in March.
After the first book sold, Roth said the publisher told her they were interested in the larger series.
"I was like, 'Great! I have one for you and I have ideas,'" she said during a lunch interview at a Chicago pub. She submitted outlines for what would become "Insurgent," the second book, and "Allegiant."
She promises fans a clear resolution for Tris in "Allegiant," but she's not spilling any spoilers. (Even though a handful of copies shipped early, prompting Roth to warn fans on her blog to "be very wary" of what they read online.)
"I don't want to ruin it for anyone," she said.
But Roth did offer some context, saying fans should be prepared to delve into Tris' consciousness.
"It's a little bit of a different kind of book than the first two," Roth said. "It's a little less action-heavy, a little more cerebral in Tris' mind."
Roth wrote the third book at her apartment on Chicago's North Side and in a nearby coffee shop. She attended Northwestern University, where she studied creative writing with teacher Brian Bouldrey. He said Roth's honors project was a story about a girl searching for her father at a Christian heavy metal concert.
Roth quickly showed herself to be a writer who understood plot and managing multiple characters to keep readers involved in a story.
"Veronica is an example of somebody who, really, all she needed was somebody to bounce this stuff off of and permission to take risks," Bouldrey said. He credits Roth for being part of the dystopian fiction trend that includes series like "The Hunger Games."
Roth said dystopian stories are attractive because they reach in two different directions.
"You're interested in the forward rest of the narrative, but you're also interested in the backstory," Roth said. "How did the world get to be this way?"
And it's no accident that the main character in her book is a heroine, like Katniss in "The Hunger Games." Roth said she started writing the book from the perspective of Four, the main male character, but it wasn't as compelling.
"When I started writing it from (Tris') perspective it was so much more surprising and so much more interesting," she said. "As I wrote the series all of the prominent and most interesting characters I created, with the exception of Four, were women."
Roth loves that boys aren't afraid to read stories with lead characters who are girls. But she said she thinks teens are attracted to dystopian books because of the relevance the characters have in those worlds.
"The characters in these dystopian books tend to have a lot of agency and even though they're young have an extraordinary, sometimes unbelievable, amount of control and influence in the worlds that they live in, which I think is a powerful thing for a teenager to read," Roth said. "It's a difficult time."
The formula has added up to mega-success. It doesn't seem to faze Roth, who said she didn't see it coming.
"How do you predict that?" she said. "It seemed impossible."
It may even mean screen time for Roth, who fans could spot as an extra when "Divergent" debuts. The movie filmed over the summer in Chicago and Roth was on set at least once a week.
"I kind of just hung out and watched and ate Fruit Roll-Ups," Roth said, emphasizing that she wasn't pushy with filmmakers.
"Sometimes I'd help with especially setting up the movie, so that it leaves room for the third book," she said. "Because at that time only I knew what was going to happen."
She still is just one of a few who knows how "Allegiant" plays out. But the ending of Tris' story marks a new beginning for Roth.
"I think I'm going to take a little break and just kind of play around with some ideas," she said. "I do love writing for teens, so I don't see that changing anytime soon."
Bouldrey said he expects Roth to try something new.
"I feel like she's smart enough and advanced enough that she might use that success to take some chances," he said.
And while fans will start the last chapter of "Divergent" world on Tuesday, Roth said it will be sad to start letting go.
"It's been a part of my life for so long and such a huge life-changing part of it too," Roth said. "But I don't know, I'm excited kind of what comes next and kind of what characters and worlds are out there."