Artistic licence: Dan Stevens (Gilbert) and Emily Browning (Florence) star in Summer in February

How true are “true stories”? How accurate are the historical events in a novel? How far can a writer “go” with the facts? And, anyway, don’t great writers make it all up from scratch?

These questions, which have long interested and troubled me, are brought sharply into focus in Christopher Nicholson’s fine recent novel Winter. The story is set in the mid-1920s, in the last years of Thomas Hardy’s life. While the old man is infatuated with Gertrude – a young actress 60 years his junior (and the model for Tess) – his neglected second wife, Florence, a mere 40 years younger than Hardy, lives in his shadow in their cold home.

It is a bitter life for Florence in which one of her duties is to deal with her famous husband’s daily postbag. One reader of The Return of the Native, a literal-minded lepidopterist, writes to ask which particular amber-coloured butterfly on Egdon Heath the novelist was describing, because the reader has often been on such Wessex heaths and has never spotted this species.

It is the kind of question – understandable if tiresome – that I sometimes get asked after giving a talk. Someone holds up a hand. “On page 197 you say so and so. How do you know this? Where did you get that?” Fair enough, I suppose, as I have based a number of my stories on what you might call the footnotes of history – forgotten or unearthed episodes in the lives of such figures as Rodin, Churchill, Robert Louis Stevenson, W E Henley, Reinhard Heydrich and Alfred Munnings. What the questioner really wants to know is if I am playing fast and loose.

In truth, of course, there was no amber-coloured butterfly, as Hardy (or Nicholson) reflects:

Doubtless the letter-writer would be disappointed by such information; well, but it was the truth. Just like the butterflies, Egdon itself, that vast expanse of heath described at the start of the novel, did not exist and probably never had; it was a piece of fiction that stood at a certain remove from reality. He hated these literary detectives, who failed to grasp the nature of art: that it was a shaping of reality, not reality itself.

Like the lepidopterist, but in a much more damaging way, Florence reads every word her husband writes as a realistic account of his inner self. She cannot begin to understand, though he has often tried to explain, that he is not the “I” and that the I is not the “he”: “The relationship between he and I was close; they were blood brothers, but brothers often differ greatly.”

In his own shaping of reality Nicholson has Hardy at his desk fantasising about eloping with the young actress. For the dry and defensive Hardy, his marriage to Florence is dead. Her neuroses bore him. Caring more for his pen than for his wife, he has settled for domestic silence. However, cover his tracks as Hardy might, “he”, Nicholson suggests, is the “I” of the poems. The “I” is “he”. Usurped and disturbed Florence may be, but she senses what is happening. She knows the fires that burn in her distant and offhand husband.

I was immediately absorbed in Winter. And I stayed in it. I was back at Max Gate in the 1920s. There was pain on all sides and it felt true in the most important sense. I cared for all three central characters, not to mention the dog Wessex. Although I admired Thomas Hardy: the Time-Torn Man by Claire Tomalin – she dealt with the Gertrude Bugler episode in four pages – I was more lost in the world of Nicholson’s short novel than I was in her substantial biography. Fiction had brought things to life for me as only fiction can. Sticking to the facts does not necessarily take you to the heart of the matter, to the truth beyond events. Shakespeare did not stick to the facts when he recast history, nor did T S Eliot in Murder in the Cathedral.

Two of my novels – Wilfred and Eileen (1976) and Summer in February (1995) – were based on real events, and both were “given” to me. They came directly from conversations I had as a teacher, one with a pupil, one with a colleague. Both are set in 1913 and 1914. When I started on the first I felt a little apologetic about writing what could be classed as historical fiction (let alone a true story). I had left university in the early 1960s with the snobbish view that fiction set in the past was insufficiently imaginative. It fed off facts and dead bodies: second-division stuff. All you had to do was mention Sir Walter Scott and roll your eyes. No need to read him, naturally, just look bored.

Because of my friendship with members of the family and the access they had given me, Wilfred and Eileen was delicate terri­tory. Eileen Stenhouse, having married Wilfred Willett in secret, travels to France, alone, to find her dreadfully injured husband and bring him home: a story of almost unbelievable courage on both sides, which had been entrusted to me by their daughter and grandson. In fusing the freedom to invent with a reliance on hard facts, I had to decide where exactly to play it straight, and where I could reasonably embellish. My responsibility to the real Wilfred Willett and the real Eileen Stenhouse at times conflicted with my concern to make the novel as strong as possible.

Twenty years later, when Summer in February came out, I was no longer defensively concerned with categories, and whether the book was historical fiction or a biographical novel or a hybrid genre. I thought then (and still think) that novels should be judged by the quality of their writing, the authenticity of their world, their narrative control and the intensity of the caring you feel for the characters. No one suggests that Colm Tóibín’s The Master and David Lodge’s Author, Author are the poorer for being based on incidents in the life of Henry James. Like Winter, they are creative novels about a creative novelist.

Even so, however urgently the dead call to us, there lingers in the literary world a barely concealed contempt for historical fiction. Hilary Mantel’s first Man Booker Prize win in 2009 prompted grumblings about its literary merit – as if, she wrote, “the past is some feathered sanctuary, a nest muffled from contention and the noise of debate, its events suffused by a pink, romantic glow”. This contempt extends to fiction based on real events. As Hazlitt said, “. . . there is no romance like the romance of real life”, but for many the phrase “a true story” remains as much a turn-off as a turn-on.

As a novelist working from facts, you have a problem straight away. History is suspect, as are the motives and methods of those who write it. Nevertheless, the sources are exactly the same as those of a biographer – that “post-mortem exploiter”, in Henry James’s phrase – would use: diaries, biographies, interviews, letters, looking at old photographs and taking new photographs. If you are going to write about real people as they actually lived, or as your imagination tells you they did, the least you can do is put in the legwork.

The further back in time you go the easier it is. You can write just about anything you like about the Romans and the Elizabethans, and people do. It is much trickier if there is close family still living. A father’s or mother’s real life is more than a “story” to a living son or daughter; it is far more important, more problematic and far more touchy than mere historical material.

When writing Summer in February, I faced the same questions. This novel (released as a film last year) is set in a bohemian artistic community in Cornwall just before the First World War. My challenge was to re-create the tragic love triangle of the painter Alfred Munnings, the soldier Gilbert Evans and Florence Carter-Wood. I read everything I could find but in his three-volume autobiography Munnings did not once mention Florence, let alone their marriage. He had airbrushed her out. Furthermore, there was the problem of how I should interpret some entries in Evans’s diaries, which were kindly shown to me by his son. I was pretty sure where joining the dots would lead: that when she died Florence was pregnant with his child. But proving it was another matter.

There is in most writers something of the secret agent and something of the subversive, too. It is invigorating being on the scent, a stalker of the past, stealing up on something from an oblique angle. Then there are the quiet hours of sitting and waiting, staring and feeling: of being imaginatively with your characters. Both approaches are essential. I try to let things unfold, to leave myself open to surprises. I try not to push.

To return to Hardy: in The Return of the Native he made up the butterflies and he made up Egdon Heath. Similarly, Christopher Nicholson made up the scenes in Winter where Florence and Hardy are reading a letter from a fan asking about the amber-coloured butterflies on Egdon Heath. Hardy and Nicholson, with their historical imagination, have both shaped reality.

The novelist and the dramatist can reach where the historian and the biographer very rarely do. “A work of art,” as Auden said, “is not about this or that kind of life; it has life.”

A new edition of Jonathan Smith’s “Wilfred and Eileen” is published by Persephone Books (£14)