With “Avengers: Age of Ultron,” the director Joss Whedon has made a film that’s in tune with the political zeitgeist as he perceives it. PHOTOGRAPH BY WALT DISNEY CO./EVERETT

Baseball games have slowed down because, as players’ salaries have increased, the value of each pitch and each swing has increased, as well. When a pitcher gets thirty starts in a season, a hundred pitches each, bucking for a twelve-million-dollar contract, each pitch is worth four thousand dollars. Why rush? “Avengers: Age of Ultron” cost about two hundred and fifty million dollars to make, and Joss Whedon, its writer and director, appears to have taken his time, too—especially with the script. Whedon has done something similar to what he did in “The Avengers”—namely, to make a film that’s in tune with the political zeitgeist as he perceives it. There, it was a post-9/11 revenge fantasy set against a backdrop of unpopular foreign wars. Here, in “Age of Ultron,” it’s the reaction against the long trail of post-9/11 governmental machinations and grand N.S.A.-like projects.

The movie features a pair of new characters in the Avengers’ orbit who start out as their enemies: Scarlet Witch (Elizabeth Olsen) and Quicksilver (Aaron Taylor-Johnson). As humans, the twins, Wanda and Pietro Maximoff, are orphans, whose parents fell victim to a shell that bore the inscription “Stark Industries”—Iron Man’s technological empire. They are the living embodiment of the notion of creating enemies through the very wars, incursions, and drone strikes that are meant to combat them. The Avengers’ battle with these new enemies—Quicksilver, who moves ungraspably fast, and Scarlet Witch, who uses mind control to reveal her enemies’ greatest fears to them—leaves them battered and exhausted, and it spurs Stark (Robert Downey, Jr.) to action.

The best thing about science fiction—and that’s the pigeonhole in which the Avengers series fits—is the making of alternate worlds in which fictitious technology is put to interesting uses, and that’s where “Avengers: Age of Ultron” comes out ahead of its predecessor. Stark summons his fellow-scientist Bruce Banner, i.e., Hulk (Mark Ruffalo), for a new project. The grand finale of “The Avengers” was an invasion of aliens from outer space (which gave rise to Whedon’s most dazzling effects). Now, however, Stark makes a classic military-political error: fighting the last war. Expecting another alien invasion, he seeks Banner’s help in building Ultron, an artificial-intelligence nexus that will virtually surround Earth and render the planet invulnerable to attacks from the outside.

The pseudo-scientific mumbo-jumbo that the enthusiastic Stark and the skeptical Banner toss around in discussing the possibility and desirability of building Ultron is one of the high points of the movie. (It peaks in the first hour or so.) Since the scenes of Ultron’s rising occur so early in the action, I fear no spoilers in describing, with relish, what occurs. Ultron isn’t a physical shield but, in effect, a supercomputer that anticipates threats and wards them off before they can reach the planet—a world-englobing intelligence network. Stark does the equivalent of militarizing the Internet—he takes his own network, J.A.R.V.I.S., and copies and pastes its power into Ultron.

Whedon comes up with some alluring effects, including a floating bundle of zipping lights, to depict the two networks, but saves the best for the twist that follows. Ultron’s intelligence, being artificial, is rather literal. Its quest for absolute invulnerability implies total control, and rather than sharing a virtual mind with J.A.R.V.I.S., Ultron needs to vanquish it. The whizzing abstractions with which the director and his effects team evoke the battle of the brains has all the exhilaration of the climactic battle of “The Avengers,” with even more fantasy-stoking imagination; it brought back the primordial wonder of reading comic books as a child.

Nothing that follows has the same effect, though the upshot of Ultron’s short-term triumph is conceptually elegant. Built to seek a perfect invulnerability, Ultron has no patience with the human race ; its sense of perfection also implies a quest for unchangeability. Ultron takes on a humanoid metallic body (the body and the voice of James Spader) in order to subjugate and destroy humanity and to replace the species with minions made of the rare metal vibranium, on which he seeks to corner the market. (With another political wink, Whedon sprinkles the script with the word “evolve,” to define what humans do and what Ultron’s robots don’t.)

Thus the Avengers are roused to action once again in order to save the world—or, rather, to save human life. But this time, they’re saving it not from predatory outsiders but from a creature of their own making, an avatar of military technology that merely pursues its built-in mission to its logical conclusion. In the first “Avengers,” the enemy came from space—a September 11th allegory. Now the allegory involves an enemy created within, a kind of superintelligence that, becoming independent of human oversight and control, turns on those it’s meant to protect. That’s the politics of “Avengers: Age of Ultron”: the wars that we’re now fighting are against our own defenses run amok. It’s more like “Age of N.S.A.,” extending the concept of the universal data-scoop to define all humans as enemies of the total-security mechanism.

But Whedon adds a noteworthy fillip. Ultron’s war on humankind forces the Avengers into a climactic war against him and his robotic army, in the fictional state of Sokovia (where the signage is in Russian). Ultron will destroy the city-state and its inhabitants, turning it into a meteor, the impact of which will result in human extinction. Here, Whedon confronts the crucial issue haunting all superhero and action films: the fate of civilians. One of the most appalling tropes of action films, whether “Furious 7” or “Indiana Jones and the Temple of Doom,” is destruction-as-backdrop, with bystanders scattered indifferently or killed off-screen as cars skid, explosions explode, and buildings crumble. In “Age of Ultron,” Whedon brings the background to the fore, making the Avengers’ rescue of civilians a key subplot—indeed, a sine qua non for their mission.

The superheroes of “Avengers: Age of Ultron” map their conflicts clearly onto those facing humans today, but the movie is more than its mythology. The characters have two sides—one human, the other, superheroic—and Whedon has worked conspicuously hard to lend their Marvel-ous attributes dramatic density and symbolic resonance. It’s in their nonheroic rendering as people that his efforts fall short: they speak, for the most part, like sitcom simulacra of people, in sarcastic one-liners evoking thought bubbles filled only with a laugh track.

That’s the paradox of superhero movies over all. They have two tones: the artificial, hieratic one of the larger-than-life characters that they’re centered on, and the common, human one, which is meant to render the supernatural adventures relatable. The grand artifice is the very reason for these films; the quest for an ordinary tone as counterpoint is a mark of the times. For all the lip service to religion, modern life has become all too naturalistic. The religious imagination is no longer populated by the colossal characters and exploits of Bible stories (the domestic box office for “Noah“ and “Exodus: Gods and Kings” suggests as much).

The mighty and the heroic, the bigger-than-life, provide the only reason for superhero films, and the people who make them usually seem to have little idea how to depict regular people. (I’m reminded of the producer played by Jack Palance in “Contempt,” who says, “I like gods. I like them very much. I know exactly how they feel.”) The cuteness with which Whedon afflicts the human-types in “Avengers: Age of Ultron” is the same cuteness with which he burdens the Shakespeareans in his film of “Much Ado About Nothing”: living among the gods, Whedon condescends cinematically to the little people. He responds to them with the impulses of a screenwriter rather than those of a person—with his highly abstract synthesis of how people act in movies and television shows rather than how they live in life.