The Lego Batman Movie is not at all perfect, and in some particular respects its not-perfection strongly suggests that the returns on theatrical Lego movies are going to start diminishing pretty damn quickly (coming in less than eight months: The Lego Ninjago Movie). But it's got this going for it: for the first time since the 1966 Batman with Adam West, or maybe actually the first time ever, we've got a theatrically-released Batman movie that to a considerable degree actually resembles the Batman comic books. Not the good Batman comic books, necessarily, which is part of the joke: it's one of the ones where the whole rogues gallery is set loose and the plot makes no sense. But also one of the comic books that remembers that Batman is neither the stony psychopath of just about every Bat-film since the 1989 Tim Burton-directed Batman, nor the... thing that was happening in Batman & Robin, but the leader of an increasingly dense superhero family. We've never really had that before. I mean, we kind of did in Batman & Robin, but fuck that movie. Actually no, let's run with it: The Lego Batman movie is the good version of Batman & Robin. Who'da thunk.

This film's Batman is apparently the same iteration of the character who showed up in 2014's magically manic The Lego Movie in 2014; at any rate, they're both voiced by Will Arnett with the same attitude of idiotically childish entitlement. It's really not possible to tell if they're set in the same universe, if that even means anything in the context of The Lego Movie's final act. It also doesn't matter. What's important is the film's conception of Batman himself, an act of merry self-critique that absorbs all of the clichés of the 78-year-old character and the criticisms that have been levied against the brand over the years, and enthusiastically agrees with them. It is a film that openly makes fun of Batman's cinema history to date (every one of the earlier features - except for Batman: Mask of the Phantasm, the only other animated Batman film to reach theaters -  is gently ribbed in one reeled-off joke that honestly moves a bit too fast for the humor to land), and even the cash-cow Christopher Nolan films are at least slightly dinged.

That, at least is where things start. The Lego Batman Movie is, not wholly to its credit, somewhat modular. It starts out as high-speed parody, flinging out jokes mocking Batman, Batman movies, and superheroes as a concept at a dizzying speed for a solid third of its unquestionably overlong 104 minutes. Then it turns into a more-or-less legitimate Batman movie, albeit one with a hefty sense of humor. Then it turns into a kids' cartoon with the requisite lessons and warm feelings and a generally saccharine attitude altogether. It can't manage the shift The Lego Movie handled so adroitly, combining high-speed ironic humor and gooey sentiment; The Lego Movie, of course, mostly got to cheat its way into doing so, by segregating the sentiment in its own pocket universe detached from the main body of the film. Here in Lego Batman, the sentiment ends up drowning out a lot of the energy and turning what had been an awfully smart and at times surprisingly harsh comedy into something largely generic.

So yes, anyway, what happens: Batman is a smug loner enormously proud of his vigilante skills, his celebrity, and his general coolness. He is an overgrown 8-year-old, basically, and treated as such by his tired, mostly-patient butler Alfred (Ralph Fiennes). A couple of shifts happen that force Batman (this incarnation of the character is rarely Bruce Wayne, and he doesn't even both dropping the gravelly Batman voice in those moments) to reconsider his prickly shell: one is that he accidentally adopts an orphan, Dick Grayson (a flutey, obnoxiously innocent Michael Cera, who hasn't been so well-cast in anything since Superbad), the other is that Gotham City Police Commissioner Jim Gordon (Hector Elizondo) has stepped down to be replaced by his daughter Barbara (Rosario Dawson), whose ambitious new plan for cleaning up the streets will include not one tiny bit of black-clad vigilante justice called into action with bat-shaped spotlights in the night sky.

A few things emerge from this initial chunk of the movie: one is that the small squadron of writers either knew Batman lore well or had a hell of a good time researching it, because it's all just perfect: an exaggeration of the things that are silly (the filmmakers dug deep to scrounge up some of the dumbest names from Batman's long list of supervillains), sarcasm about the things that are overdone (morbid gloom, sullen growling), and affection for the things that have not been done sufficiently. The Lego Batman Movie adores the Adam West TV show and movie, let us just say, and passes up no opportunity to let us know that fact; even the climactic action scene is littered with large and smaller references to that particular incarnation of the Caped Crusader.

It's both one for the fans and the anti-fans, and frankly it's just an all-around terrific animated comedy: not as radically inspired as The Lego Movie, which would have been unfair to demand, but first-time feature director Chris McKay understands the zippy energy and anything-goes random playfulness as that project, and he taps into it with great success. Aesthetically, Lego Batman is a direct descendant from the 2014 film: the same stiff movement that gives a surprisingly good impression of stop-motion animated plastic toys, physically exaggerated gags that gain much of their comedy from the incongruity of seeing small block-shaped humanoids engage in action movie shenanigans, and a profound sense that since all of this is quite fake, we should just hang out and enjoy it (never has a cat dying violently in a children's movie carried so little emotional weight).

Better still, the film clearly bears the marks of three years of evolved technology: the textures are more detailed and carry with them a definite, unnamed history burned into their physical being (Batman has a deep scratch along his cowl that speaks to long-ago playtimes gone wrong), and the lighting is stunningly good: there's one joke involving Batman patiently waiting at a microwave that's your basic "funny, but not it's not anymore, but now it is again" gag about stretching the duration of a joke, and it has been accompanied by a heart-stoppingly beautiful lighting effect for no apparent reason other than because the artists cared. And damn me, but they cared a lot, to judge from the elaborate fighting choreography and effects animation. This is as beautiful as any CG animated film I can think to name.

So all well and good, but the problem is, the film absolutely overstays its welcome. The story about the Bat Family forming despite Batman's general shittiness is lovely, fun, and graced by four outstanding lead performances; the action storyline (it's hard to say which is the more important overall) is kind of tedious and bad. It starts from the Joker (Zach Galifianakis) growing as sad as a long-ignored wife at Batman not taking their villainous rivalry seriously, which is a reasonable way to freshen up the stalest hero/villain relationship in superhero mythology this side of Professor X and Magneto. But Galifianakis is not a terribly memorable Joker - he is, in fact, just reading the lines like normal, with not even a Joker laugh. And that's the best of it: the worst of it comes when the Joker's big play for attention results in a massive influx of all the pop-culture references that Warner Bros. had the rights to use, along with one that I'm definitely sure they don't, though I guess nobody "owns" the concept of velociraptors. I couldn't go into it without spoiling things, and I don't know that I need to; at a certain point, the movie turns into a game of Spot the Reference, which was hilarious and shocking when The Lego Movie tossed in a couple minutes of Star Wars just for the hell of it, but is rather less adorable when the entire narrative is driven by pointless references. It's the point that Lego Batman finally commits the sin people have been nervous about since the first movie was announced: it transforms itself into cross-branded commercial. And in that it moment, it steals much of the energy from a movie that had the goods to be as strong as any animated comedy from the last couple of years.