On a planet in the far reaches of space, Jean-Luc Picard, the storied captain of the Starship Enterprise, ran into a being who said she was the devil. She could make people disappear in a flash of energy. The ground shook at her command. Picard was skeptical. In all of his voyages, he had never encountered absolute evil. The universe’s creatures—humanoids, tiny robots, assemblages of light—were all capable of change, or at least of revelation. Surely, there must be a way to find the good in this powerful being, or otherwise a way to unmask her. In recent years, Picard’s optimistic spirit has been hard to conjure, not just in the world but on TV. The success of shows such as “Breaking Bad” and “Veep” proved that audiences could be interested in morally bankrupt people without seeking their redemption. But, in the landscape of gritty realism that has surfaced in the decade since, a once daring aesthetic gesture has lost its edge. The audience, fatigued by the powerful opportunists that threaten us during the day, finds it harder to sit transfixed by rudderless immorality at night.

That may be why the “Star Trek” creator Gene Roddenberry’s twentieth-century idealism is on the rise again, wafting up from shows such as Michael Schur’s philosophical sitcom “The Good Place” and Seth MacFarlane’s “The Orville,” a Trekkie-approved homage to “Star Trek: The Next Generation.” In the original “Next Generation,” Patrick Stewart plays Picard, the commander of a starship on a mission of exploration and of a crew whose altruism he can take as granted. The show was one part Margaret Mead among the Samoans and one part undergraduate ethics course, and it derived its tensions not from the battle scenes or from the protagonist’s tragic flaws but, rather, from moral and logical quandaries that tugged the audience from scene to scene: If a ship arrives through a time rift from a historic battle that saved the lives of billions, do you send it back to finish the skirmish, even though its crew will almost certainly die? Most dilemmas were resolved quietly. A laser gun (shaped like an electric shaver) might go off once an episode. Suspense would build as Picard, stern and sometimes shouty, slowly arrived at a way to respect all forms of intelligent life, no matter the circumstances. As for the earth-shaking devil, Picard defeats her not with choreographed kung fu on a high precipice but with due process in a courtroom, revealing her to be a con artist exploiting the latest in seismic technology.

Stewart eventually grew tired of the formula of “Star Trek: The Next Generation,” and of his close identification with the character, but he has returned to playing Picard again, in a new CBS All Access series, “Star Trek: Picard.” He seems to have been lured back by the franchise’s bread and butter: social and political issues. The seventy-nine-year-old English actor, also an executive producer on the show, has said that he wants science fiction to confront a world plagued by Trump and Brexit, by endless wars and immigration crises. “I am angry, disappointed, and embarrassed by our decision to leave the Union,” he told NPR recently.

In the new show, the captain, softened by age, reëmerges in a very dark time line. His beloved android lieutenant, Data, is dead. The United Federation of Planets, the organization that governs Picard’s corner of the galaxy, has fallen under the sway of forces both xenophobic and corrupt. Synthetic life forms have set Mars on fire and are now banned. A supernova destroyed the home world of the Romulans, the Federation’s historic enemies, setting off an interplanetary refugee crisis that has shaken the population of Earth. Picard’s values have fallen completely out of joint with those of his government. In repose on the French vineyard where he grew up, and far from the off-kilter situations that threatened the Enterprise, he no longer speaks in clipped commands (“Speculate,” “Report,” “Make it so”) but muses over the way his advanced years and the gloomy political situation have cowed him. “Nursing my offended dignity. Writing books of history people prefer to forget,” he says, chiding himself. “I haven’t been living. I’ve been waiting to die.”

Like a sci-fi Jimmy Carter, Picard has retracted his personal universe into small moral acts. He has taken in two Romulan refugees. They banter and fix breakfast and remind him to wash his hands. Picard’s outlook hasn’t changed, only his sense of what an old universalist, protective of life in all its forms, can still do in a world suffering from a void in moral authority. And, yet, soon after we meet him, Picard is suddenly feeling hopeful, again.

The CBS executives that brought Picard back to us are optimistic, too: they announced the second season of “Star Trek: Picard” before Season 1 even aired its first episode. And Stewart has been going around collecting his old cast members for cameos, just as the reanimated Picard goes around collecting a new crew for one last mission into space. Stewart recently beamed over to the set of “The View,” in his nicest striped jacket, to invite Whoopi Goldberg to join him for the next season of “Picard.” He had good reason to think she’d say yes. Three decades earlier, at the height of her fame, Goldberg called Roddenberry to lunch and told him she wanted to be on “Next Generation.” He cast her as the barkeep Guinan. For half a dozen seasons, Guinan advised the crew members on everything from how to flirt to how to find humanity in the nearly irredeemable collective known as the Borg, a hive of creatures that violently turned every species they encountered into half-mechanical automatons.

Goldberg’s relationship to the show is a testament to its moral and political impact. As a little girl in the sixties, she fixed her eyes on Lieutenant Uhura, the communications officer first played by Nichelle Nichols, in the original “Star Trek” series. “There’s a black lady on TV,” Goldberg exclaimed to her mother. “And she ain’t no maid!” Nichols herself nearly quit the show after one season, but was encouraged to hang on by another early “Star Trek” fan: Martin Luther King, Jr. “You turn on your television and the news comes on and you see us marching and peaceful, you see the peaceful civil disobedience, and you see the dogs and see the fire hoses, and we all know they cannot destroy us,” she recalled King telling her, “because we are there in the twenty-third century.”

The role-playing of diversity in the many iterations of “Star Trek” didn’t always go well. Some species, like the Klingons or the Romulans, were often reduced to a static set of characteristics, “a kind of intergalactic racial profiling,” as the novelist and “Picard” showrunner Michael Chabon recently put it. Chabon, along with his co-writers, have made attempts to change that. More recent “Star Trek” films and shows, such as “Discovery,” have added intraspecies variety—not every Romulan is conniving and not every Klingon has a dark complexion. “Picard” also departs from more benign “Star Trek” rules to conform to the new tendencies of streaming television. The dialogue (“Dude, I’m a fellow in Artificial Intelligence and Quantum Consciousness”) and habits (one character stuffs a futuristic pen with homegrown “snake leaf” and vapes from it, moodily) often seem more at home in the twenty-first century than the twenty-fourth. There are gratuitous fight scenes and some antihero grittiness, too: most of the new faces that surround Picard are premium-cable scoundrels and Daniel Craig–era Bond villains, full of worldly resentments, overcooked ideologies, and self-centered intentions. What’s unique is that they’re about to be swept up in Picardianism, the hokey but perhaps not yet worn-out utopian world view that longs to recognize common ideals across the galaxy, while also preserving its differences.

Picard did not come away without damage from all his investigations of alien strife. He has had his mind repeatedly hijacked by the concerns of other beings. The Borg once assimilated him. “Have you ever . . . been a stranger to yourself?” someone asks him, in the first episode of “Picard.” “Many, many times,” he replies. Watching Picard and his crew explore the galaxy has always been as much about finding differences in the realms beyond our solar system as about finding the possibility of difference inside ourselves. Even as new Star Trek shows make the universe a shade more grim, what stays the same are the principles that guide our captain—the respect for all forms of intelligence, and the thrill of the unknown that is the very foundation of hope.