Their story gripped the world: determined divers racing against time and water to rescue 12 boys and their soccer coach trapped for more than two weeks in a flooded cave deep inside a northern Thai mountain.

The ordeal in late June and early July 2018 had barely ended when filmmakers began their own race to get the nail-biting drama onto cinema screens. The first of those projects will premiere this weekend, when director Tom Waller’s “The Cave” shows at the Busan Film Festival in South Korea.

The film was shot over three months earlier this year and has been in post-production since then. The 45-year-old Thai-born, British-raised filmmaker said the epic tale of the Wild Boars football team was a story he simply had to tell.

The boys and their coach entered the Tham Luang cave complex after soccer practice and were quickly trapped inside by rising floodwater. Despite a massive search, the boys spent nine nights lost in the cave before they were spotted by an expert diver. It would take another eight days before they were all safe.

Waller was visiting his father in Ireland when he saw television news accounts of the drama.

“I thought this would be an amazing story to tell on screen,” he said.

But putting the parts together after their dramatic rescue proved to be a challenge. Thailand’s government, at the time led by a military junta, became very protective of the story, barring unauthorized access to the Wild Boars or their parents. Waller often feared his production might be shut down.

His good fortune was that the events at the Tham Luang cave in Chiang Rai province had multiple angles and interesting characters. Especially compelling were the stories of the rescuers, particularly the expert divers who rallied from around the world. He decided to make a film “about the volunteer spirit of the rescue.”

Other people proposed telling the story from the point of view of the boys, and Netflix nailed down those rights in a deal brokered by the Thai government.

“I took the view that this was going to be a story about the people we didn’t know about, about the cave divers who came all the way from across the planet,” Waller said. “They literally dropped everything to go and help, and I just felt that that was more of an exciting story to tell, to find out how these boys were brought out and what they did to get them out.”

Waller even had more than a dozen key rescue personnel play themselves.

Waller said they were natural actors, blending in almost seamlessly with the professionals around them, and helped by the accuracy of the settings and the production’s close attention to detail.

“What you are really doing is asking them to remember what they did and to show us what they were doing and what they were feeling like at the time,” he said. “That was really very emotional for some of them because it was absolutely real.”

Waller said his film is likely to have a visceral effect on some viewers, evoking a measure of claustrophobia.

“It’s a sort of immersive experience with the sound of the environment, you know, the fact that is very dark and murky, that the water is not clear,” he said.

“In Hollywood films, when they do underwater scenes, everything is crystal clear. But in this film it’s murky and I think that’s the big difference. This film lends itself to being more of a realistic portrayal of what happened.”

Some scenes were filmed on location at the entrance to the actual Tham Luang cave, but most of the action was shot elsewhere, Waller said.

“We filmed in real water caves that were flooded, all year-round,” he said. “It is very authentic in terms of real caves, real flooded tunnels, real divers and real creepy-crawlies in there. So it was no mean feat trying to get a crew to go and film in these caves.”

“The Cave” goes on general release in Thailand on Nov. 28.

