Hong Kong director Soi Cheang's 2014 retelling of The Monkey King, featuring a phalanx of stars including Donnie Yen, Chow Yun Fat and Aaron Kwok, was basically a successful failure.
Although it earned more than one billion yuan (S$220 million) in ticket sales in China, the world's second-biggest movie market, it was widely reviled for its weak story and visual effects.
So with The Monkey King 2, Cheang and his producers set out to overhaul the project.
The sequel, which opens in Singapore on Friday, stars Kwok as the simian superhero Sun Wukong and Gong Li as the shape-shifting White Bone Demon in a more considered narrative. It also features fewer but more polished effects.
Cheang, 44, said in an interview on Monday: "When the first movie came out, there were a lot of bad reviews. Our movie really had problems. The story and special effects were problematic."
He and his bosses at Filmko Entertainment agreed that "if we shoot a second episode and don't resolve the problems of the first instalment, we shouldn't be shooting it".
The second movie, like the first, is drawn from the Chinese literary classic, Journey To The West - in particular, the tale of Sun's three fights with the White Bone Demon and his clashes with his Buddhist master, Tang Sanzang. Tang, unlike the magically gifted Sun, cannot see through the demoness' disguises and thinks Sun is hurting innocent people.
In retelling the story, Cheang - who made a name for himself as the director of crime movies including Accident (2009) and Dog Eat Dog (2006) - said he had to make it more convincing to modern audiences, including himself.
"Sun Wukong is so powerful, why would he keep following a monk? What power does this monk have? I thought we had to change it a little this time."
His Tang, played by Chinese television idol Feng Shaofeng, is not a sanctimonious guy who has all the answers.
Instead, the young monk is "like a university student who's new to society, idealistic and who wants to reform every monster he sees".
And pop star Kwok, who played the Bull Demon King in the first movie and replaces martial arts star Yen in the title role in the second one, now has to play Sun as a former jailbird.
The monkey king was locked up for 500 years for wreaking havoc in heaven in the first film.
He is released in the second movie, only to be sent on a pilgrimage to India with the monk, but he comes to respect his master's idealism and compassion.
Cheang said: "From the start, my bosses and I felt every episode of The Monkey King should have a different person playing Sun Wukong."
Yen did a good job capturing a young monkey's cuteness and purity in the first movie, Cheang added, but the second film needed a more mature monkey king with "more inner drama".
"We really enjoyed Aaron Kwok's performance," the director said, adding that the star brings something different to the role as an actor and a dancer.
In a separate interview, Kwok, 50, said he was "pleasantly surprised" to be asked to play Sun.
But he was also worried about being in an action movie because he had torn a ligament in his left knee during a concert in Guangzhou in 2013.
"But the director knew I was injured and still insisted on using me," he said.
Cheang and action director Sammo Hung worked around Kwok's injury, the star said. For instance, "Sun Wukong isn't pulling a horse and walking this time, as he usually does, but he's flying up", a wire-assisted move that spared the actor's knee.
Furthermore, what he came to realise was that for his role, the acting was more important than the action. He said he drew inspiration from the Planet Of The Apes movies, which he found to be deeply moving, and understood that "Sun Wukong has to have human attitudes and human feelings to seize viewers' hearts".
But for Cheang, part of his battle was pushing Chinese and South Korean special effects companies hard to deliver a banquet for viewers' eyes.
At some of the companies that completed the jobs, "many people resigned, it was really hard", he said.
"We forced them to make changes every day. Every shot was changed more than 10, 20 times. Some were changed 45, 50 times."
He said he had to push them, or he would be letting down more than 2,000 people who had worked on the movie over three years.
His friends had told him not to push his luck and make the sequel, he said. They told him to be content with directing movies such as SPL 2: A Time For Consequences (2015).
But he said he wanted to correct his mistakes and was happy to have been given a chance to get the sequel right.
He said of his bosses: "I was happy that they still had expectations of me."
And he did not question their decision, for fear they would say: "Right, we should find someone else."
By the time The Monkey King 2 premiered in Beijing last month, he had seen it "10,000 times", but remained extremely nervous about how it would be received.
When the closing credits came on, "I didn't know how to react. Aaron Kwok was the first to come up, grab my hand and say, 'It's good.' Gong Li also congratulated me. That was when I was a little more assured".
Since then, he says with a laugh, "the comment I've been happiest to hear is, 'Did the same director shoot both episodes?'"
•The Monkey King 2 opens in Singapore on Friday.