Adventure stories set in the British empire are now so unfashionable they don't even have a name, even though they are a distinct genre. They also form a significant part of our literary history and, in their time, some of the best were both wildly popular and, in more than one sense, trailblazers.

Robinson Crusoe, published in 1719, has a strong claim to being the first real novel in English as well as the first colonial adventure story. RL Stevenson's Treasure Island, and H Rider Haggard's King Solomon's Mines – both published in the 1880s when the genre really took off – have some claim, as Giles Foden has argued in these pages, to being the first literary blockbusters. The colonial adventure genre encompassed hundreds of books, from Kipling's Indian writing, above all Kim, the masterpiece of Anglo-Indian literature, to GA Henty's Boy's Own potboilers, AEW Mason's The Four Feathers, Edgar Wallace's Sanders of the River and Talbot Mundy's King of the Khyber Rifles.

These stories told big, primal tales from the frontier, or what Arthur Conan Doyle called in The Lost World, "the big blank spaces in the map". They provided a vast, exotic, canvas, far from increasingly safe and conventional Britain, on which to recast old familiar plots: quests, struggles with evil, tests of strength, exciting encounters with the unfamiliar. Their protagonists were tested and came through. An energetic plot was vital – it is no accident that many of the most famous have spawned multiple film versions.

The books fed the imaginations of western readers who would likely never see Africa, Asia or the Pacific – and yet felt that through these stories they had a connection with them. Robinson Crusoe seduces with its vivid narrative voice, its gripping plot and some of the most memorable images in fiction – most famously the discovery of Friday's footprint on the beach. Treasure Island gives us an intense sense of place, and a poignant coming-of-age story full of moral ambiguity. Kim is at once spy story, coming-of-age tale, picaresque novel, adventure and a slice of Indian society at the end of the 19th century.

Time has brought changes. Many of these books are now unreadable. They were cheerleading for imperialism, and were imbued with an unthinking assumption of the racial superiority of the white colonial adventurer over the colonised native. To the postcolonial critics of the 1970s, the stories were little more than ideological justifications of colonial aggression; examples are almost too easy to find. To contemporary readers, Crusoe's attitude to non‑whites is unpalatable; he sells a fellow shipwreck survivor to slavers, and his relationship with Friday seesaws queasily between friendship and servitude.

In King Solomon's Mines, the protagonist Allan Quatermain presents an explicit racial hierarchy, with rational, scientific Englishmen at the top, the Kukuanas with their "lips not unpleasantly thick" next, and at the bottom, the Hottentots, drunk and ruled, like beasts, by instinct. Kipling says east and west are incompatible, the racial divide cannot be crossed, and he sneers at anglicised "babus", for "aping" British manners (though in Kim he also has the ridiculed babu save the day).

The 1952 adaptation of Robinson Crusoe. Photograph: Allstar/Cinetext

Probably the most offensive of the colonial writers was Henty, a keen imperialist and author of 122 Boy's Own adventures with names such as By Sheer Pluck: A Tale of the Ashanti War. In this novel Henty tells us that "the intelligence of an average negro is about equal to that of a European child of ten years old", but they can be significantly improved by living among white men where "their imitative faculties enable them to attain a considerable amount of civilisation". Henty, widely accused of xenophobia in his own lifetime, had a small renaissance in the 1990s among conservative American home-schoolers who apparently thought his books provided excellent moral lessons in heroism, patriotism and religious observance.

The finest of the postcolonial theorists, Edward Said, went further than other critics. Rather as feminists had begun to talk about the "male gaze" portraying women as passive objects and demonstrating the inequality of gender relations, Said suggested that the mere fact of colonial rule must inevitably compromise the writing of even the most well-meaning of western orientalists. Writers who claimed to love and understand the places and peoples they wrote about must have seen them through a prism of eurocentricity, he argued, whereby they fetishised their exoticism and strangeness, and unconsciously patronised them. Kipling's Kim, Said acknowledged in an introduction to the book, was a masterpiece (though one, he said, that some Indian readers regarded as plagued with stereotypes), but, even so, it presented a complacent and "conscious legitimisation" of British rule and its effects.

In the 1980s, a new strand of postcolonialism, "subaltern studies", not only looked at the history of empire from the standpoint of the colonised and exploited but was practised by scholars in the former colonies. This, like postcolonialism, has had a revitalising effect on the study and writing of colonial and imperial history and literature.

Or at least it has everywhere but in Britain, where we were already embarrassed and guilty about our colonial past, before postcolonialism found a troubling ambiguity in even the most well-intentioned colonial enterprise, and exposed plenty of straightforward brutality and exploitation. It is striking to compare the energetic debates of the last few weeks over how the first world war should be presented – a reflection of our constant fascination with the two world wars – with the near-silence with which we still approach the subject of the empire. Increasingly distant from us, empire is such a knotty, ambiguous subject, in which the British are the bad guys rather than the plucky underdogs, that it has become easier to ignore our imperial legacy than to examine it full in the face.

With a few striking exceptions, such as William Dalrymple and Philip Hensher, contemporary writers have become wary of engaging with it in all its complicated, uneasy-making richness. And yet its legacy is still a matter of intense debate in former colonies all over the world, its consequences as great as, or arguably greater than, those of the first world war.

It is a mistake to neglect our colonial past. We should not want to become like Japan, a nation that deliberately chose to forget the shame of the second world war. Japan has never apologised in the same way as Germany for its actions during the war, and has often seen itself as the victim of the conflict rather than the aggressor. In Britain, we haven't truly processed our colonial history, and we should remind ourselves of it. One way cultures remember and digest the past is through stories, which is why the best of these colonial adventure stories deserve to be reread, in all their awkward ambivalence. In India, recent colonial narratives include Amitav Ghosh's wonderful Sea of Poppies and Tabish Khair's The Thing about Thugs.

It is also why British writers should be uneasy about writing about the empire, but should go ahead and do it anyway. Perhaps their writing will be "compromised", but that's not to say that it won't tell stories that will illuminate parts of the colonial experience, particularly for an increasingly uninformed domestic audience. Postcolonialism throws up difficulties for western writers, but it can also open up new routes into stories about it.

AEW Mason’s The Four Feathers. Courtesy of the Ronald Grant Archive

A few years ago, having previously written only non-fiction, I decided I wanted to attempt a historical thriller. I had been mulling over a character, a detective of a kind, for some years, whom I wanted to put into an unusual milieu. I had also long been interested in the Thugs – the roadside bandits who befriended, then strangled, unwary travellers on the roads of India – and the man who had crushed and chronicled them, a soldier-turned-administrator called William Sleeman. Even in the driest historical accounts the story of the Thugs was almost impossible to believe. Sleeman's grandson claimed they killed more than a million people over several centuries; these days estimates range between 50,000 and 200,000, which are still astonishing numbers. Sleeman said, and believed, that the murders were acts of devotion to the goddess Kali. Almost as striking, it seems that certain native rulers were protecting the Thugs in return for a share of the spoils. Not surprisingly, the Thugs caught the imagination of the British at home (which is how the word "thug" entered the English language), and became a touchstone for colonial justifications for ruling India. They perfectly exposed India's lack of "moral compass", the evils of Hinduism, and the country's inability to rule itself. Sleeman's work, naturally, demonstrated the effectiveness and rightness of British rule.

The Thugs became a classic colonial trope: thrilling, exotic, evil and an ideological justification for colonialism; one which quickly found its way into western fiction, starting with the 1839 bestseller Memoirs of a Thug, through John Masters's 1952 novel, The Deceivers, to Indiana Jones and the Temple of Doom – a film deemed so racist by the Indian government that it refused to allow it to be filmed in India.

What made me want to put the Thugs in my book, and place my character in India, was the fact that since the 1970s some historians had begun to challenge the notion that the Thugs had ever actually existed – or, at least, existed as Sleeman described them. Some suggested they were a convenient fiction, a colonial panic that provided another handy justification for extending British rule. Just as intensely, other historians disputed this. The subject is still hotly debated.

It transpired that in Indian folk memory, Sleeman was – perhaps not surprisingly – a ruthless figure, not at all the benevolent administrator of imperial histories. Though at the time I didn't realise it, both of these narratives had emerged from postcolonial and subaltern studies. There was the traditional colonial version and, right next to it, the postcolonialist rejoinder, waiting for a plot to bounce them off each other. I learned much – more than I expected – from academic theory, and I hope I have managed to breathe some life into a contested, neglected genre.

• The Strangler Vine by MJ Carter is published by Fig Tree on Thursday.