Poignant scenes of corteges carrying repatriated soldiers through the streets of Royal Wootton Bassett moved a nation divided in its political standpoint on the wars in Afghanistan and Iraq.

But for playwright Neil Walker, a wider moral question was triggered by the outpouring of emotion and respect for the armed forces in this Wiltshire market town, which over four years honoured 355 fallen heroes with an average age of 22.

It was about society’s duty to the families of those killed in action, as well as raising questions about his own life and links with the military. The 50-year-old, who is the only man in his family for generations not to have joined the armed forces, set off on a journey of discovery which saw him move to the famous town next to the now defunct RAF Lyneham for a year.

He interviewed military families across the UK, serving soldiers and veterans from conflicts spanning the First World War to the present day.

The De Beauvoir resident’s quest to uncover the untold stories behind military loss – in which he collected hundreds of hours of verbatim accounts – now forms the basis of a groundbreaking autobiographical play called Do We Do The Right Thing?

It arrives at the Rosemary Branch Theatre in Shepperton Road, Islington next week, days after thousands of fallen heroes are honoured in Remembrance Sunday services up and down the country.

Mr Walker, of Downham Road, said: “The inspiration was the repatriation gatherings in Wootton Bassett and the large numbers of dead young soldiers coming back.

“I was touched by the age of some of them and was ­really curious why it had attracted so much national attention – why there was this upsurge in support around the armed forces in the community.

“People on all sides of the political spectrum were coming together.

“I wanted to explore the effect of military loss and how that continues through the generations, and the need and the duty society has to give ongoing support to those who have experienced loss in this way. To look at the military as a collection of individuals.”

Directed and co-created by Tommy Lexun, of the Be Frank Theatre Company, the play sees Mr Walker take on the lead role with the stories he gathered being conveyed by actors who are fed the verbatim recordings through earpieces live on stage.

Mr Lexun, 29, who met Mr Walker at the Actors Centre in central London 18 months ago, said: “It’s all about the individual’s response to it: they speak with them, rather than independently. The method has been used before but to do it in parallel with autobiographical stories is a very new approach.”

And, because the play is so closely based on Mr Walker’s own life it has, at times, been testing – especially since he lost his father at a young age after he left the military.

“It has been a very difficult piece at times,” he said. “One particular story, for example, was from a 96-year-old World War Two veteran. It really took me back to my relationship with my own dad.”

The play will run from Tuesday to Friday at 7.30pm.

There will be a regional tour next year to coincide with the British withdrawal from Afghanistan and the 100th anniversary of the start of World War One.