Happily, Alex Proyas has recovered from the grubby grunge look that afflicted his comic misfire “Garage Days” and returned to the coolly elegant visual style of “The Crow” and “Dark City” in his new sci-fi epic. One of the great joys of “I, Robot”–for some Midwestern viewers, at least–will be the chance to dissect the skyline of the Chicago twenty years from now that the director, production designer Patrick Tatopoulos and visual effects supervisor John Nelson have confected and cinematographer Simon Duggan has captured in his lovely widescreen images. One can frequently glimpse the Hancock Building and, elsewhere, the Wrigley Building and North Michigan, too, but they’re cleverly inserted into wide swaths of fictional, more modernistic structures. To be sure, the imaginative reconstruction doesn’t always convince: at one point, a confrontation between humans and robots occurs on a boulevard so wide that it rivals anything in a Sergio Leone western, which is saying quite a bit, and the effect resembles the real Chicago about as much as the L-train sequence in “Spider-Man-2” does the actual New York City. But even this sequence–like virtually all the others in the gleaming, metallic compositions that fill the film–beguiles the eye. (The major exception is a long action scene which finds a gigantic machine pulverizing a house while the lead character tries to escape the destruction with his life–an episode that frankly looks phony and goes on too long–but it’s a distinct anomaly.)

“I, Robot” isn’t quite so successful in engaging the brain, but it’s far more enjoyable than most of the other big-budget Hollywood blockbusters this year, a high-toned popcorn movie with a good deal of energy, a script that mixes some vaguely cerebral notions with nice touches of humor, characters who don’t descend to the realm of mere caricature, a cast that takes the piece seriously enough to hold our interest, and CGI effects that don’t disappoint. The twists in the final reel strain one’s suspension of belief but don’t go so far as to shatter it, and in the end the picture works as a solid summer entertainment with more than usual intelligence for this genre.

The picture is predicated on the three famous laws of robotic conduct formulated by Isaac Asimov in the collection of stories eventually published as “I, Robot,” but the screenplay fashioned by Jeff Vintar and Akiva Goldsman actually seems to owe more to the (uncredited) 1939 “Amazing Stories” tale of the same title by Eando (actually Earl and Otto) Binder, which was filmed as an episode of “The Outer Limits” in 1964 and then remade as part of the new series of that program in 1995. In Binder’s tale, a robot named Adam Link is put on trial for killing his creator and defended by a human in a courtroom melodrama. Here we have a police procedural rather than a Perry Mason wannabe. In 2035 Chicago, where miraculous mechanical men are performing virtual all mundane labor functions, police detective Del Spooner (Will Smith), who alone suspects that robots may be capable of criminal acts despite the ingrained laws that supposedly prevent them from harming humans, is called on to investigate the apparent suicide of Dr. Alfred Lanning (James Cromwell), the “father” of U.S. Robotics, the most powerful company in the world. Spooner’s chief suspect is Sonny (Alan Tudyk), one of the firm’s new generation of robots which will replace all existing models, who is discovered hiding in Lanning’s locked office and tries to escape. Standing in the way of Spooner’s investigation is the Machiavellian CEO of U.S. Robotics, slick Lawrence Robertson (Bruce Greenwood), who fears the financial effect of a criminal case on his company and uses his political clout to force the detective’s typically voluble superior John Bergin (Chi McBride) to stymie his man and allow the company simply to destroy Sonny. The cop gains a reluctant ally, however, in Susan Calvin (Bridget Moynahan)–another character, like Lanning, derived from Asimov–whose emotional attachment to Sonny undermines her loyalty to the company. The only other character of consequence is Del’s grandmother (Adrian Ricard), who raised him, and who apparently has as much faith in robots as she does in the Lord. The other humans are barely sketches, and the hordes of other robots in the picture may look like Sonny, but they’re utterly without his personality.

It wouldn’t be fair to reveal too much about the contortions of the narrative; suffice it to say that as in “Spider-Man 2,” the writing here shows the wisdom of hiring someone who can bring a human element to such material (Goldsman also wrote “A Beautiful Mind”). The theme of overcoming bigotry to build trust is handled nicely, without being laid on too thick, and the explanation for Spooner’s antipathy to robots is treated strongly (even if the explanation itself doesn’t quite work). The lead characterizations are well drawn, too. Lanning, Robertson and Bergin are pretty much stock figures, and neither Cromwell, Greenwood nor McBride can do much beyond the expected in those roles–the same is true of Ricard. But Smith, who initially comes across as a typically cocky maverick, brings deeper shadings to Spooner as the picture proceeds, and Moynahan does the same with the conflicted Calvin. Tudyk, who apparently follows the Andy Serkis Gollum route as Sonny, makes a sympathetic model for the CGI robot. And from the technical standpoint, as has been noted, the film is exquisitely mounted. Marco Beltrami’s generic score, unfortunately, doesn’t match the picture’s imaginative look.

The twists that “I, Robot” takes in the final act–which won’t be revealed here–aren’t exactly rock-solid from a logical standpoint, and though the final revelation does manage to avoid pinning the machinations on the obvious villain, it takes a turn that might not entirely have pleased Asimov, but would surely have amused the Stanley Kubrick who created “2001” and HAL-9000. The final take on “I, Robot” is that a film that might well have been as mindlessly frantic and foolish as Denzel Washington’s 1995 travesty “Virtuosity” is instead a visually impressive effort that mixes the pizzazz of an action-oriented popcorn movie with a more humane sensibility than is usually the case.