The notorious dance party ending is a plague upon all animated films, but it is perhaps a particularly important element in the films of DreamWorks Animation; it was that studio's 2001 Shrek that did more than probably any other individual title to cement the trope into place, and they've relied on it extensively in the years since. Credit to the studio's new Trolls where it's due: not one movie in all those 15 years, from DreamWorks nor anyone else, has used the dance party as an essential part of its narrative. That is, indeed, the chief objection to the things: they're tacked-on to provide a sense of finality to a plot that doesn't really do much to resolve itself. In Trolls, the dance party is the resolution, in a universe in which dance parties are an important mode of community expression.

The film is, as a matter of fact, DWA's first full musical since their second feature, The Prince of Egypt, back in the forgotten days of 1998. As a narrative, this is easily the most surprising and novel thing about the movie, which is in otherwise pure boilerplate kiddie movie tosh, in which a crabby outsider from a community of toyetic characters with one personality trait between them is put in the position of being forced to save the day when catastrophe hits; by the end of the movie's trim 92 minutes, we've learned that real happiness was inside of you all along, and true beauty comes from confidence in being yourself. It's not quite as hopeless as that makes it sound. The ingredients are as standard as it comes, but they've been combined in at least slightly unusual forms.

The trolls in the movie, based in the vaguest way conceivable upon the Good Luck Troll dolls that were a huge fad in the 1960s and a much smaller fad in the 1990s, are the happy little beings who lived in a tree singing and dancing and hugging until one day, when they were discovered by the giant ogre-like Bergens, miserable, joyless beings who find that eating trolls allow them to absorb happiness, if only for a short while. 20 years ago, the troll king Peppy (Jeffrey Tambor) finally had enough of this systematic culling of their people for food - as one might - and arranged a brave escape attempt on the very night of Trollstice, the annual troll-eating festival. Since then, the trolls have been living joyfully out in the woods, with the most joyful of all being the king's daughter Poppy (Anna Kendrick), an enthusiastic creator of elaborate scrapbooks when she's not busy devising parties for all to enjoy. The solitary holdout from all the constant fun is Branch (Justin Timberlake), a uniquely monochromatic figure (grey with black hair) in this technicolor fantasyland, and with a Manichean worldview to match: he's positive that the trolls are living on borrowed time till the Bergens find them and resume their old eating habits. Obviously Branch is right, else we wouldn't have a movie: the trolls are found (thanks to Poppy's elaborate fireworks) by the disgraced former head chef (Christine Baranski) to the old Bergen king (John Cleese), and she captures several as the first step in a never-disclosed plot to overthrow the current king, Gristle (Christopher Mintz-Plasse). Equally obviously, it falls to Branch and Poppy to team up and save the trolls, while bantering about their incompatible worldviews along the way.

So far, nothing to be terribly put off by, other than how little imagination is involved in putting all of this over. It's only in the second half of Trolls that some actual rot creeps into the screenplay by Jonathan Aibel & Glenn Berger (veterans of the generally great Kung Fu Panda trilogy for DreamWorks, as well as The SpongeBob Movie: Sponge Out of Water; but also Alvin and the Chipmunks: The Squeakquel AND Chipwrecked. Trolls comes closer to the first group than the second). This mostly has to do with keeping the plot moving along, which comes in the form of Bergen scullery maid Bridget (Zooey Deschanel), who's had a crush on the king ever since 20 years ago, or so its implied in a shot early in the movie that has no other reason to exist. And that teeny bit of foreshadowing has to make do for all the effort a stronger film would have put into developing Bridget, or better still keeping the main thrust of the plot focused on the trolls (Branch gets precisely the character development you suppose he will, but Poppy is just an unchanging lump). When Bridget arrives, the action abruptly shifts into "how will the trolls help her impress Gristle, thereby winning her aid in stopping the chef's murderous plot?" mode, and suddenly Bridget is the third-most important character in the movie despite having literally not been there, like, 90 seconds ago. It's akin to when a long-running TV show adds a new character in the season premiere without anybody finding the need to comment on that fact. This is not the only utterly arbitrary thing that happens in the final 40 minutes of the film, though it's by far the most damaging.

As uninspiring as the story in Trolls is, the movie doesn't really put most of its energy in that direction. And most of the rest of the film is quite nice, actually: most of the songs aren't up my alley ('10s pop covers of music that's older than the target audience - decades older in the case of "The Sounds of Silence", which is treated with relative dignity - and a few new compositions that are fetching enough; Poppy's anthemic "Get Back Up Again" is the clear standout), but they have a joyful verve that works well in the context of the film's brightly colored, quick-moving musical numbers. If it amounts to a form of jukebox musical, it's only right: the film's narrative explicitly hinges on the fact that singing along with easy songs is a hell of a lot of fun.

Where the film really impresses, though, is in its creative use of the animation medium itself; no DreamWorks film has ever experimented so much in so many ways (How to Train Your Dragon and its sequel are more beautiful and better-animated, but that's not the same thing). There's nothing in the career of director Mike Mitchell that suggests anything remotely this accomplished, nor do I see what co-director Walt Dohrn's work as story artist on several of DWA's less interesting movies could have taught him (he is, however, a SpongeBob veteran), but anyway: this is a uniquely well-directed animated comedy. Fully-rendered 3-D animation is so good at physical realism that, for the most part, physical realism is all it's used for, and one of the little peculiarities that you almost forget about after a lack of exposure is that there's a whole medium full of nonrealism to play with. In particular, for decades, comedy in traditional animation has relied on a great many tricks of timing and pacing, with characters snapping into place and skipping over several frames at once to punch gags harder; I won't say it's never done in CGI, but Pixar and Disney have generally been too concerned with high production values, DWA is typically too script-oriented, and Illumination is just too fucking bad to do any of that kind of timing-based humor so consistently as Trolls uses throughout. It is, as a result, a uniquely funny animated feature; certainly unique for something whose script is so paint-by-numbers predictable in so many ways, including the exact jokes in some cases.

There's other really impressive directing in more ambitious registers: the free-floating camera that practically swims through the air twists and spins and dives at characters and generally gives us a rich exploration of the film's world through purely visual means, content to be raw spectacle and nothing but - but really lovely spectacle, like absolutely nothing in DreamWorks. There's a shot in the trailer of the camera rotating 360° to follow Poppy as she runs along a looping snake, and I confess that after I saw that shot, I knew that I'd always kind of love the movie even if it was actively terrible.

The world itself is the real triumph, though. Perhaps taking its cues from Poppy's scrapbooking, perhaps positioning itself inside the imagination of some never-seen child, Trolls takes place in a world made entirely of cloth and handicrafts: the characters are slightly fuzzy, like plush toys or flocked plastic, they wear clothes made out of what's obviously felt, the natural world is a riot of cotton balls and scraps of woolen blankets and reclaimed socks, like that snake up there. When we see rain, it appears to be made of the same mylar that the confetti that makes up one of the more successful running games is made out of. Even the night sky is full of perfect little five-point stars, like glow-in-the-stickers on a sheet of blue paper. It is, all told, one of the most splendidly designed animated worlds that I've seen since 3-D CGI took over, and every bit as impressive an experiment in using the medium against itself as last autumn's The Peanuts Movie, only without that film's disquieting sense of nostalgia theft. By no means is Trolls a great film - the pedestrian screenplay give it problems to overcome that neither the Pandas nor the Dragons have had to deal with - but it's better than a Justin Timberlake musical selling a defunct novelty toy line made by the studio and director responsible for Shrek Forever After ought to have had a prayer in hell of being.