In his most recent film, “Looking for Comedy in the Muslim World,” Albert Brooks can be seen as a stand-up comic trying to entertain an audience in India. He tells a few jokes. Nobody laughs. He wonders why. Then he has the bright idea that maybe the crowd simply can’t follow him. How many people in the auditorium understand English, he asks? Every person in the audience raises a hand.

There you have it: an only slightly exaggerated vision of Mr. Brooks’s thankless career on screen. For decades he has been creating, playing and directing characters whose gloom is justified by their failures, despite the great deadpan dialogue they deliver and the groundless optimism to which they cling.

A small but loyal audience deems Mr. Brooks brave, brilliant, obsessive, fanatical and pricelessly funny even when he falls flat. A much larger crowd, the “Finding Nemo” audience, knows him as the cute, fretful voice of an animated fish. He now finds himself courting a new demographic: people who like alarming books.

With “2030” Mr. Brooks has made the nervy move of transposing his worrywart sensibility from film to book. Two things are immediately apparent about his debut novel: that it’s as purposeful as it is funny, and that Mr. Brooks has immersed himself deeply in its creation. “2030” is an extrapolation of present-day America into the not-so-distant future, and it is informed by the author’s surprisingly serious attention to reality. Unlike the fantasy writer who foresees a gee-whiz future full of alluring gimmicks, Mr. Brooks has dreamed up escapism about problems we cannot escape.

“2030” has a large cast of characters, like the Nobel laureate who cured cancer and the American president who will change his country in profound, irreversible ways. It also has frightening prescience. A 9.1 earthquake hits the Pacific Rim, with devastating consequences. The dollar’s run as the world’s reserve currency is long over. Debt is the era’s overriding issue on both the personal and the political levels, because the cancer-free elderly have stopped dying on schedule. The young bitterly resent the old, and the old have good reason to be fearful.

And yet the news isn’t all bad. International politics have become much more benign, or at least less savage. Certain businesses, like the creation of fake friends and fake children, have thrived. Tracking devices are so ubiquitous that “you had to make an effort not to know where people were,” he writes. And birthday parties have become just awful, now that holographic movies of the celebrator’s life have become routine. “It was,” he says “like boredom squared.”

As a sign of the times the White House has undergone an interesting makeover. It now features historic mid-1950s furniture and an animatronic Abraham Lincoln who greets visitors to the Lincoln Bedroom. This Lincoln can speak and even answer the most awkward questions. When John Wilkes Booth is mentioned, the Lincoln robot is programmed to look puzzled, pause and deliver a laugh line: “I don’t know who that is. Remember, you’re talking to me while I’m still alive.” This drives tourists wild.

At a leisurely pace that suggests he truly enjoyed spending time in this imaginary future, Mr. Brooks assembles characters whose lives will eventually intersect. There is America’s first half-Jewish president, Matthew Bernstein, whose mother was Roman Catholic. (“But if you’re running for president of the United States, even living on the same street as a Jew makes you one,” Mr. Brooks writes.) There is Susanna T. Colbert, the great-looking 70-year-old former chief executive whom President Bernstein finds irresistible. She is recruited as Treasury secretary because the smart ex-Goldman Sachs guy who held the job insisted on spending a third of the year working from his farm on Nantucket.

There is Brad Miller, an 80-year-old who had a nice condominium in Los Angeles until that city was flattened by the quake; now he’s homeless in a huge tent where the Rose Bowl used to stand, wondering if there is still any such thing as insurance money. There is an attractive youngish Chinese businessman named Shen Li, whose innovative health care business has worked wonders in China, where the elderly are still revered, not resented. There is Kathy Bernard, Mr. Brooks’s prime example of all the disaffected young who grow up bearing a huge financial burden. “They were the first ones riding the pendulum back, and they hated it,” he writes.

Who elected Mr. Brooks Cassandra? Why should his prophecies be taken seriously, let alone presented as major elements in a halfway serious book? The answers are that his prognostications are not so farfetched for futuristic fiction; that he has worked them into a real novel, not a tricked-up movie treatment; and that a little humor goes a long way in this often bleak genre. “I don’t want to be the one to break it to you, but the future ain’t that funny,” he said in an interview in The New York Times last year. Funny thing: in “2030” it mostly is.

“2030” is headed for an epiphany, but Mr. Brooks is in no great rush to get there. He takes time to dote on his characters. He sets up their romances and solves their problems, even finding Kathy a surrogate father figure after her real father dies (and leaves her with crippling medical bills to pay). When the time does come for him to end this story, the strain shows; some events seem abrupt and artificial. The omniscient role of novelist hands him a tougher plotting job than his films have presented. He doesn’t have the pitilessness it requires.

But his comedic voice can still be heard, loud and clear. About President Richard M. Nixon’s tape-recorded slurs against gay people and Jews: “My God,” he has Bernstein muse, “had Nixon never seen a Broadway show?” About the longevity problem: “What should we do next? Get rid of all the species that live a long and healthy life? Maybe we should kill all the turtles and chop down the redwoods.” About a Los Angeles with a newly Chinese personality: Hey, why does everything smell better? And about “one of the greatest inventions in all of human history”: Who thought up the S-shaped rope line?

It gives people the illusion that they’re getting somewhere when they’re not. Mr. Brooks has always seen progress that way.