Michael Bay has never been accused of subtlety, and though it represents a serious turn after such fare as the “Transformers” movies, “13 Hours: The Secret Soldiers of Benghazi” is hardly a shrinking violet of a movie. Brash, loud, corny and—especially toward the close—cheesy in its use of special effects, the retelling of the tragic events of September, 2012, when a terrorist mob attacked an American consular facility in Libya, killing Ambassador Chris Stevens and three other Americans in the process, represents a sincere effort to be true to the facts that unfortunately falls prey to the director’s innate action-movie propensities.

Based on the book that Mitchell Zuckoff wrote based on the recollections of the surviving members of the security team contracted to protect the CIA station in the dangerous city, the film spends its first forty-five minutes introducing the players—primarily Ambassador Stevens (Matt Letscher), the arrogant station chief Bob (David Costabile), and the security personnel. The most notable among the latter are gruff Tyrone “Rone” Woods (James Badge Dale) and his amiable friend Jack Da Silva (John Krasinski), who’s just returned from a visit to his wife and daughters. Others include Mark “Oz” Geist (Max Martini); John “Tig” Tiegen (Dominic Fumusa); Kris “Tanto” Paronto (Pablo Schreiber); Dave “Boon” Benton (David Denman); and Glen “Bub” Doherty (Toby Stephens)—all of whom are sketched in broad strokes.

Before the hour mark, all hell breaks loose at the consular compound, and in the course of the assault Stevens and one of his aides, Sean Smith (Christopher Dingli) will lose their lives. Despite Bob’s dithering, Rone leads his crew, which is actually assigned to protect the CIA annex a mile away, in a counter-attack to save Stevens and his security detail, and they manage to bring the survivors back to their walled facility, which soon comes under attack by the militants. They have to hold out on their own, since the nearest rescue force is in Tripoli, four hundred miles away, and suffers all sorts of delays getting there. The rest of the US military seems paralyzed to respond, as is shown in a few brief inserts and mentioned in offhanded comments by the defenders.

“13 Hours” is not overtly political. There’s no direct mention of Hillary Clinton or the charges that have been leveled against her, nor of President Obama, though at one point a montage reports that POTUS has been informed of the situation. Toward the close one of the security men notes, disgustedly, that initial news reports are mentioning a protest at the consulate before the attack—something that critics now characterize as an effort to whitewash the situation. On the surface, therefore, this is not a polemic. Underneath, of course, the picture is contemptuous about the overall lack of protection not only at Benghazi and other State Department sites, and of the failure of the US to rush assistance to Libya after the assault had begun. Even the ultimate extraction of the survivors is portrayed as half-hearted and subdued. So a political subtext is operative here even though the movie never degenerates into a screed.

But if Bay’s film isn’t a campaign document, it’s certainly an unabashed piece of gung-ho patriotism, an old-fashioned cowboys-and-Indians story brought into the twenty-first century, with night vision glasses and automatic weapons replacing simpler weapons in what ultimately amounts to a modern-day version of “The Alamo” with a happier outcome. Bay is in his element over the course of the movie’s last hundred minutes, bringing visceral excitement to the squad’s dangerous journey to and from the consular compound and the prolonged defense of the annex. Neither the topography nor the chronology is made terribly clear, but in a way that accurately reflects the chaos of the situation, leaving the viewer as lost and uncertain as the men were, trapped in a hail of bullets.

Unfortunately, the throwback quality extends to the dialogue. Perhaps these guys actually talked in the macho clichés they intone here, but if so it doesn’t translate well to the screen, where the lines fall with a thud. The writing gets even worse when the guys get ruminative (repeatedly referring to Joseph Campbell, for example) or saccharine (in talking about their families and dreams). Bay’s penchant for the obvious extends to visuals—a tracking shot in which a tattered US flag flies at Stevens’ compound during the assault is topped at the end of another of it lying forlorn in a swimming pool. Of course the director can’t resist the new tools at his disposal even when they cheapen his serious approach: as in “Pearl Harbor,” he resorts to a CGI-created bomb’s eye perspective of mortar shells falling on the annex in the final assault. It’s a poor, and miscalculated, effect, one that wrenches the viewer out of the realistic point of view the movie has been trying to maintain despite its bombast.

Still, the comparison to old John Wayne pictures is apparent in that “last stand” sequence as well, in which our stalwart heroes pick off attacker after attacker as they move stealthily toward the walls. There’s a touch of video-game atmosphere added to the sequence through the green-and-red halos of the night-vision glasses, but it still hearkens back to the innumerable scenes of white-hatted cowpokes blasting away Indians riding around a stranded stagecoach in old B-level second features.

That comparison points up the fact that, like Native Americans in movies of the fifties, Libyans like the militia leader played by Andrei Claude are portrayed in awfully simplistic terms, as sinister types lurking in the dark and intent on doing damage. (There’s one exception, the loyal, pro-American translator Amahl, played by Peyman Moaadi, but he’s treated as a semi-comic character dragged into the thick of things). When large numbers of them are shot during their assaults on the annex, it’s treated triumphantly, and a final shot of their families mourning over their corpses doesn’t really compensate. By contrast, the deaths of two of the American security men are depicted in as valorous and tragic. The fact that all the action is presented from the perspective of the security personnel explains that, of course, but especially in the jingoistic terms in which Bay presents it, the result can be unsettling.

It remains to say that the performances are basically functional but more than capable as such, with Dale and Krasinski in particular hitting the appropriate notes; and that the crafts team, headed by cinematographer Dion Beebe, uses the Malta and Morocco locations to good effect. Lorne Balfe’s score adds a sense of urgency to the proceedings.

But while “13 Hours” aspires to be another “Black Hawk Down” or “Zero Dark Thirty,” Bay proves unable to measure up to Ridley Scott or Kathryn Bigelow in balancing seriousness and excitement.