It only took four films and $750million dollars but director Michael Bay has finally delivered a Transformers movie worth the price of admission. It’s rumoured that Transformers: Age of Extinction will be the start of a new trilogy. Now that box office receipts featuring many zeroes have started rolling in it looks likely that Bay will get his wish. And if the next two films follow Age of Extinction’s lead, that’s a good thing.

The Transformers movie franchise found itself in a bizarre position in 2011. Despite being universally despised by hardcore fans, casual moviegoers, and film critics alike, it still managed to pull in big box office bucks. In fact profits just kept getting better ($709million for Transformers, $846million for Revenge of the Fallen, $1,123million for Dark of the Moon). A tricky decision lay in front of Bay and Paramount Pictures post Dark of the Moon; keep churning out derided sequels, or take the cash cow out behind the barn and stick one between its eyes? In typical Bay-esque fashion, the director opted for both options.

Age of Extinction (spoilers ahead for those that haven’t yet had the pleasure)keeps the few good parts from its three predecessors and jettisons the rest, offering a sequel that is thankfully only loosely connected with parts one to three. Transformers (2007) was more of an experiment than a movie, a test to see if modern CGI was capable of creating believable onscreen Transformers. In this respect, it was a success; with some modern twists on the eighties Autobots, the robots were spectacularly brought to life. But in all other respects the film was a failure. Shia LaBeouf’s Sam Witwicky was the human equivalent of an unscratchable itch, while the comedic relief offered by his parents was a straight up embarrassment. For the obligatory romantic interplay viewers were asked to believe that uber nerd Sam was capable of bagging Megan Fox as a girlfriend. Fox herself had only one directive, to stand around pouting in the skimpiest outfits the plot could believably get away with. Typically shady government agents provided little dramatic fuel while everyone waited for their favourite Decepticon to join the show. When Megatron finally turned up he was an unrecognisable lump of spiky chrome, more rampaging art installation than universe rumbling super robot. They didn’t even get Frank Welker in to go toe-to-toe with fellow voice legend Peter Cullen.

Still, with the biggest hurdle of creating credible cinematic Transformers out of the way fans were hopeful that part two would serve up a decent script to compliment the CGI thrills. Two years later Transformers: Revenge of the Fallen (2009) delivered the absolute antithesis of a good script, a two and a half hour turd of a screenplay. All the faults of the first film were back (more blurry what-the-hell-is-happening action, more Fox / LaBeouf interplay) but this time they brought friends, in the form of wrecking-ball-testicle “comedy”, back of the napkin plot twists, and a complete lack of pacing. When Josh Duhamel’s troops are convinced to join the film’s climatic battle by LaBeouf holding up an old wank sock full of dust, you know something has gone terribly wrong somewhere. Almost becoming self-aware of its own cluster-fuckery, the film’s anticipated climatic throwdown between Optimus and Megatron at least had the good grace to be over in five seconds so that fans could be released from theatres to stagger out into the sunlight for a good cry.

Transformers: Dark of the Moon (2011) tried to address some of the problems from part two, but progress was minimal. The misplaced comedy was gone, as was Megan Fox, but only to be replaced by Rosie Huntingon-Whiteley who somehow managed to generate even less chemistry with LaBeouf. The concluding Chicago demolition job was entertaining enough, but the preceding hour and half was so soulless and dull it was hard to care once the rubble and robot parts started flying. The box office receipts were phenomenal again but even Bay held his hands up in defeat the third time round; it was time for a change.

Most agreed that the Transformers themselves weren’t the problem; they just needed a decent script behind them, an interesting villain to battle, and some decent human support. The latter of these three elements was the weakest link, so for Age of Extinction Bay called on everyman of the moment, Mark Wahlberg. Outstanding performances in the likes of Fear (1996), Boogie Nights (1997) and Three Kings (1999) assured that by the time Wahlberg moved into action territory with the likes of Shooter (2007) and Max Payne (2009) he had the acting chops to carry even the wonkiest script. With a build to rival Schwarzenegger and the average-Joe attitude of Bruce Willis, Wahlberg has become the perfect blend of every great eighties action hero. Bay could pick no finer centre column around which to rebuild his franchise.

Unlike LaBeouf, Wahlberg ensures that Age of Extinction’s robot-less moments are not just bearable but actually enjoyable. More than that, his Doc Brown-like inventor Cade Yeager and his rundown, simple homestead engender some real sympathy, something Transformer fans won’t immediately recognise from previous big screen outings. Unfortunately, his daughter Nicola Peltz is just there to wear the franchise's eponymous denim short shorts, and her beau, the Irish rally driving Jack Reynor (how did he end up in Texas?) has an equally pointless presence. But on the other side of the character divide, the deliciously villainous Kelsey Grammar and the bad-guy to good-guy Stanley Tucci have great fun hamming up a storm and chewing the scenery.

On the non-human front, new baddie Lockdown marks the first decent villain Optimus and co have had to tangle with. He looks the part, takes no prisoners, and unlike his predecessors has an intriguing purpose. Gone is the ho-hum “lets take over Earth” objective from the first three films, replaced by an intergalactic bounty hunter sent to round up Transformers that are apparently traitorous to the true Cybertronian cause. That’s a plotline worth getting excited about.

Fans were sceptical when Bay decided to retain the talents of previous Transformers scriptwriter Ehren Kruger, but Kruger upped his game and even used Lockdown’s debut to get past the tricky conundrum of introducing robots in the shape of dinosaurs. Transformer fansites went red-hot upon the announcement that the Dinobots would be making an appearance in Bay’s next Transformer movie. But joy turned to trepidation when fans stopped to wrangle the question of how Bay would write giant dino robots into the story without getting laughed out of town. Kruger deftly sidesteps the issue by having the Dinobots as some of the many Transformers that Lockdown has locked up in his HR Giger inspired spacecraft, having spent hundreds of years hunting them down across the galaxy. It was a simple solution that made their appearance plausible, viewers already having brought into the idea of Lockdown as a universe surfing bounty hunter.

Alongside that Kruger provided Optimus with a band of Autobots that had personality. Thanks to the superb voice acting talents of John Goodman, Ken Watanabe and John Dimaggio, Prime’s band of good guy robots now have clearly defined, rounded and relatable characteristics. They’re a funny, mixed bunch of characters whose adventures you want to follow, something sorely lacking from previous instalments. Wisest of all, the annoyingly temperamental Bumblebee has been relegated to support character rather than the migraine inducing centrepiece. Further to that, the new Decepticons provide additional treats as we finally hear the sinister tones of Frank Welker inhabiting the body of Galvatron who, in a nod to Transformers: The Movie (1986) has been rebuilt from the remains of Megatron. And not only does he sound the part but Galvatron looks the part to, sporting the correct colour scheme and a nifty “reverse” Optimus Prime truck mode.

Extinction's humour raises some genuine laughs, with comedy sidekick Lucas Flannery given some choice lines. But just when the repartee between Flannery and Wahlberg starts to really find its stride Extinction pulls another nice surprise on viewers and injects some grim reality via a Lockdown delivered firebomb which turns Flannery into a charcoaled corpse. It’s a sudden change of tone that will likely jolt many an adolescent viewer, and might raise questions from more discerning parents as to what sort of film they’ve brought their child to see. In that respect, it’s a nice and nasty doff of the cap to the original animated movie, which traumatised children of the eighties by slaughtering all of their favourite characters. The odd mix of humour and adult tone continue from there, thanks to some enjoyable one liners “How do you say get the fuck out my way in Chinese” and a welcome predilection for robot on robot violence (Lockdown’s execution of Ratchet, Optimus slicing Lockdown in half). These are the first signs of Bay taking some welcome risks with Hasbro’s toy property.

It’s not all plain sailing though. Much has been made of Age of Extinction’s running time, and quite right to. Bay is a director with no concept of optimum running time (hello Pearl Harbour (2001)) and previous Transformer movies have all been drawn out affairs. But Extinction is something else entirely. At 165 minutes it feels like the super extended director’s cut, something that's fine for home viewing. But being assaulted by explosive thirty-foot high visuals and a thunderous cinematic soundtrack for close to three hours will leave even the hardiest viewer battered and bruised.

Long running times are fine if used correctly, but a legitimate forty-five minutes could have been trimmed from Extinctionl. There are too many action scenes that don’t involve the titular robotic stars, such as the early fifteen-minute car chase through fields and abandoned warehouses, and climatic rooftop fist fights in China (though watching Titus Welliver throw air conditioning units at Wahlberg is an amusing nod to Bay’s own onset troubles with Asian gangsters and their air-con flinging ways). There are also way too many scenes of Wahlberg telling his daughter for the millionth time why he’s so protective of her, stopping every twenty minutes in abandoned garages and train carriages to plead his love for his offspring and berate her questionably paedophilic boyfriend.

Bay also achieves a new low in the worrying trend of movie product placement. When Tucci wants to demonstrate his newly acquired and dubiously named “transformium” metal (move over Avatar and your "unobtainium") he magically turns it into a new set of Dr Dre Beats stereo speakers. When the speaker set fills the entire screen, logo standing proud, all that’s missing is an onscreen price tag and a link for Amazon. A bus adorned with the Victoria’s Secret logo will cause yet more eyeball rolling. You wonder just how many Transformer fans regularly shop for women’s underwear. A cheeky My Little Pony reference can be forgiven for its fellow eighties toybox origin.

But these small grumbles aside (and who can really moan about getting too much movie for their buck?) the movie is a triumph for Bay, his crew and his cast. People will moan that its just another three hour advert to sell toys, but when done right there’s no reason these kind of movies can’t also make for excellent popcorn entertainment (what else was Star Wars if not an excuse for Lucas to exploit his wisely retained merchandise rights?). What is most promising are the enticing clues Bay slips in as to what future instalments might hold, the organic alien hand glimpsed in the opening few minutes, the story behind the Knights of Cybertron, the destination of Optimus Prime as he heads off into space, and why exactly his creators want him back. And where the hell the not-exactly-inconspicuous Dinobots are going to slink off to and hide. There’s much to look forward to; let's just hope Bay doesn’t screw it up this time.