People have “a moral obligation” to be optimistic about the climate crisis because the alternative would be to despair and allow the worst to happen, the novelist John Lanchester has said.

Lanchester’s new book is a dystopian vision of a world after a climatic event called “the change”.

But he told the Hay festival in Wales that it did not mean he was pessimistic. “I’m deeply optimistic,” he said. “My main ambition for the book is to be wrong, and I’ll take any form of wrongness … because we can’t bequeath that world, it would be a shameful thing to do.

“I think there is a moral obligation to be optimistic, because if we’re pessimistic we will despair, and if we despair, this will happen. If we despair we won’t act and we morally can’t let it happen.”

Lanchester said the worst did not have to happen, the Intergovernmental Panel on Climate Change (IPCC) was not saying: “We’re doomed, it’s finished, it’s all over.”

‘“The IPCC conference last year said it was still possible to keep the temperature of the world to within 1.5 degrees of what it was at the end of the industrial revolution and we’ve had one degree already,” said Lanchester. “That’s no paradise. It leaves the oceans still getting warmer for centuries to come.”

But it is “incomparably better” than two degrees, which is the Paris target, he said. “It is tens of millions of lives.”

Lanchester’s book explores intergenerational tensions, with the young blaming the old for the world they now live in, a subject which resonates today. He was asked whether young people should consider not reproducing, a real-world phenomenon known as birth striking.

Lanchester said that would be “heartbreakingly sad”, adding: “I think acting as if we have a future is very, very important. Apart from anything else, it does personalise it. Every stake we have in the future is a good thing, every bit of us that is committed to the future is a good thing. It’s that future that will make us act in the present.”

The climate emergency is something we would all like to deny if it was possible, he said, and is a challenging subject because “most of the people who are going to be catastrophically impacted by climate change aren’t here. They don’t exist. They haven’t been born yet. The people who are going to suffer most are the unborn poor close to the equator. They are the ones whose lives are going to be utterly wrecked.

“That’s why works of the imagination are so important. In effect we are having to imagine these people into being and then act on behalf of their interests. This is a new thing.”

The Wall is the fifth novel by Lanchester, a writer and essayist who is celebrated for his ability to explain hugely complicated concepts in accessible terms. His previous novel, Capital, published in 2012, brilliantly skewered the London property bubble.

Lanchester, who immersed himself in research for The Wall, was asked the big question: what will it take for the world to change in order to prevent the climate catastrophe?

He said his hunch was that a shift in the political momentum would have to come from a shift in the economic momentum. “You’re starting to hear that corporations are panicking, they don’t want to be seen as the baddies.”

Another key factor, he added, would be young people perceiving the climate crisis “as an emergency … not just an item on the to-do list. Those things are going to shift it.”