Grade: F

Anyone walking unawares into this fifth installment of Michael Bay’s mindlessly bombastic franchise based on the Hasbro toy line might think that he’d stumbled into a screening of Guy Ritchie’s bomb “King Arthur” by mistake. That could be cause for alarm, except that in the end even that summer stinker was a more pleasurable viewing experience than “Transformers: The Last Knight.” Megatrash as only Bay can make it, this represents some of the most inane drivel ever to (dis)grace the screen—and an obscene waste of money to boot. (The turkey cost more than $200 million, not counting marketing expenses.)

The Arthurian prologue, as it turns out, explains how the Transformers first got involved with humans on earth. It seems that boozy Merlin (Stanley Tucci, wearing a beard that he probably hopes will obscure his identity) convinces a Transformer to give him a powerful staff; it mutates into a fire-breathing dragon that turns the tide of a fifth-century battle Arthur (Liam Garrigan) and his men are waging against a huge barbarian horde. Their victory leads to the creation of the round table and the burial of the staff with Merlin far below ground. The staff becomes the script’s MacGuffin, the all-powerful thingy that everybody is out to possess—including the Quintesson queen (Gemma Chan), who needs it to fulfill her plan to restore Cybertron by destroying earth; she abducts and brainwashes Optimus Prime (voiced again by Peter Cullen) to serve in that effort.

The queen’s plan rouses Sir Edmund Burton (Anthony Hopkins, chewing the scenery with relish while reciting his lines at breakneck speed, presumably to camouflage the stream of nonsense he’s saying), the last representative of a secret society that’s been hobnobbing with the Transformers since the fifth century. He forcibly recruits the two people who can save the planet from calamity. One is our old friend from the previous movie, Cade Yeager (Mark Wahlberg, looking craggier this time around, perhaps as a result of understandable exhaustion), who has taken refuge in a huge junkyard with some of the Autobots—including Bumblebee (Erik Aadahl) and Hound (John Goodman)—being hunted by a new anti-Transformer military force. He is said to represent the “knightly” virtues necessary (as far as one can tell from the chaotic final battle)—to wield Excalibur. The other is snooty Oxford professor Vivian Wembley (Laura Haddock, herself abruptly morphing from prune-faced feminist skeptic to high-flying heroine, as well as romantic interest for Yeager), who—Burton reveals—is the only living descendent of Arthur and thus, the sole person able to unleash the staff’s power.

It would be almost impossible to explain everything that happens subsequently in the script by Art Macum, Matt Holloway and Ken Nolan, because frankly it’s an incomprehensible farrago of numbingly stupid, haphazardly connected excuses for more metal-crushing action. The theft of a submarine museum is involved, which leads to a visit to Merlin’s underground (or is it undersea?) mausoleum. Agent Seymour Simmons (a manic John Turturro) reappears; he discovers an old manuscript associated with Arthur and Merlin. There are scenes of Optimus, who keeps announcing portentously “I Am Optimus Prime,” as though he’s having trouble remembering his name) being tortured by Queenie. His nemesis Megatron (Frank Welker) turns up on occasion, as when he negotiates with Transformer-hunter Lennox (blandly handsome Josh Duhamel) for the release of his nefarious comrades, but he’s a pretty negligible character this time around. Much is made of a talisman given to Cade by a dying Autobot, which apparently identifies him as “The Last Knight.” There are also new characters linked to him—a comic relief figure named Jimmy (Jerrod Carmichael), whose frantic asides offer no relief at all (one of the unhappy facts about the script is that all the jokes are incredibly lame and references like Optimus’ regurgitation of Churchill’s “finest hour” speech borderline offensive), and a spunky little orphan named Izabella (Isabela Moner), who’s terribly annoying. At one point a battle occurs at Stonehenge, the site of which is somehow related to the Arthurian business, and though Chicago escapes destruction this time around (we only see existing rubble there), that ancient circular monument does not.

Mention of the Stonehenge sequence brings up the variable quality of the visual effects, since one long shot of the site represents so bad a modeling job that it looks as though it might have come out of a Lego box. Otherwise CGI is continuously slathered over everything with such abandon that it makes it nearly impossible to judge Jonathan Sela’s cinematography, which is further handicapped by the need to cater to the IMAX 3D format and by the editing credited to (though “blamed on” would be more accurate) Mark Sanger, Roger Barton, John Refoua and Adam Gerstel, which seems based on the notion that unless things move frantically even in dialogue scenes, the audience’s attention will wander beyond recapture. As usual, Steve Jablonsky’s score is ear-splitting but unmemorable.

At one point in “Knight” Burton tells Yeager that the fundamental question they have to answer is why the Transformers return to earth again and again. The answer is obvious: because their pictures keep making big bucks. It’s time to eliminate that excuse. Moviegoers of the world, unite! Do to the Transformers what you did to the Ninja Turtles last year! Stop them in their tracks! Just say no!

Of course, then the postscript added at the close of the credits here—involving a mysterious hooded lady in a desert, a scene clearly designed to prepare the way for a sixth installment—would be rendered moot. Unlike the Transformers, that would be a real boon to humanity.