Retired army major Jonathan Sims knows exactly how it feels to be trapped in a damp, dark cave, blocked in by an impenetrable barrier of water that is rising with each passing hour. He spent 10 days trapped in a flooded Mexican cave in 2004, before being rescued by Rick Stanton, the British cave diver who found the boys in Thailand last Monday.

“I remember feeling overjoyed when Rick surfaced and I saw his face. It was a great relief,” said Sims. For the past fortnight, ever since he heard that the young football team and their coach had gone missing in a cave, Sims has been reliving the nightmare of his experience. “My heart is with those children. I have been thinking about them a lot.”

While the parents, relatives and friends of the Thai boys face an agonising wait to see their sons, there is no doubt that even if the young men are rescued, their ordeal will be far from over. Any physical injuries they have suffered should heal quickly, but the effects on their mental health could last far longer.

Unlike the boys, Sims is an experienced cave diver and, as a former ammunition officer who served in Kosovo and the Falklands, is used to finding himself in difficult and dangerous situations. But even so, the moment he realised he was trapped was “absolutely soul-destroying”, he said. “That first sleepless night, there were these booming, crashing sounds as the water flooded the cave passages even further. All through the night, we could hear the noises getting louder and louder. It made us feel... nervous.”

Using their water-powered lights, his party of six men – most of them fellow British soldiers taking part in a training exercise to explore the cave – rationed out their meagre food supplies, stripped naked to cope with the tropical heat and cut a piece of paper into 52 squares so they could play cards. “The key thing is your mental state. If you start to panic, it’s a disaster.”

They found themselves dreaming of food. “We were very hungry. We kept talking about what we were going to eat after we got rescued, to keep up our morale, and we told each other our life stories. I think what will keep those boys going is that they are in there with mates.”

Nottingham University professor Stephen Regel, director of Nottinghamshire’s NHS Trauma Centre, is of the same opinion: “Social support is a protective factor following trauma and adversity. The fact that the children were all together in one place, not alone, separated or injured; that they are a football team with a level of camaraderie, along with an adult who can keep them buoyed up, and reassure them: all of that will make a significant difference. It means the children are less likely to develop psychological problems later on.”

He believes that the boys, who range in age from 11 to 16, may have been able to take a stoical approach to their captivity. “There’s a cultural element to take into account. These children come from a strong Buddhist society, which encourages coping strategies children don’t have in the west. But the longer they remain in there, the longer they may need to readjust when they get out.”

Les Hewitt took up caving after being trapped in a flood in Yorkshire.

Twenty-six years after Les Hewitt was trapped overnight in Sleets Gill Cave in North Yorkshire by a flood, he still has dreams about being stuck in a room that is slowly filling with water. “I’ll never forget sitting there in total darkness, hearing the drip, drip, drip of the water, knowing it was rising and surrounding me. I was a grown man, and I was very frightened. Those children must have been terrified.”

As he waited for the water to creep up and drown him, he started to hallucinate and considered ways of killing himself. “If I’d had a gun, I would have shot myself.” Talking about it in detail brings back memories that make his voice tremble, although – like all of the men who were trapped with Sims in Mexico – he actually took up caving as a sport afterwards. “I got obsessed with it for about two years. I think it was the euphoria I felt when I was rescued. It was such an intense experience.”

He has no doubt that the football team will be affected by what has happened to them for the rest of their lives. “Those boys will have nightmares about it forever. But children are very resilient and will believe what adults tell them.”

Regel speculates that the children may actually cope better with the situation than an adult would. “Children have a tendency to see things in black and white. It was probably an adventure to go into the cave, and I suspect the divers will turn the rescue into an adventure, too. The children will also undoubtedly feel reassured by the firm leadership and sense of authority the divers would have, as navy Seals.”

Martin Grass, chairman of UK representative body the Cave Diving Group, who has been involved in many cave rescues, believes that is exactly the approach these divers are likely to take. “Hopefully the kids will see the diving training as part of the adventure. But the divers will be feeling the pressure. There will be concerns about the air supply and a build-up of CO 2 in the cave.”

Facebook Twitter Pinterest Martin Grass in Swildon’s Hole, Somerset. Photograph: Dave Ryall

Sims still remembers the shock of being greeted by 2,000 journalists when he emerged from the cave. “Our rescue was comparatively easy – it was 300 metres of a quite simple dive. Rescuing the children will be really technically challenging because there’s a combination of swimming, walking and diving.

“What I do hope is that they let Rick make the decisions, because he really knows what he’s doing – and he never panics about anything. He’s totally cool, calm and collected in a professional way. He will know from our rescue that getting the first one or two out, and then having that information relayed back, will have a big psychological impact on the rest.”

If anything goes wrong during the rescue attempt – the death of Saman Kunan, a former navy Seal diver who last week ran out of oxygen on his way back to the surface, highlighted the immense risks – that will change the meaning of the experience entirely for the children, Regel predicts. But if all goes to plan, he thinks the children will deal with their experience well.

“They seem in good spirits and I think they will have more resilience than the average person would expect of them. The challenge will be when they leave and have to cope with all the press attention. They’re going to be celebrities – and that is worrying if it means they don’t get space to process what happened, to be with their families and make sense of it. The sooner they can get back to their normal routine, the better their recovery will be.”