In the wake of Star Wars in 1977, pretty much every movie studio in the world was trying to find a way to get something just like it, and this let to some very odd things getting produced on the grounds that they were family-friendly sci-fi or fantasy movies (or both, when possible). Of these, one of the oddest was surely Time Bandits, which despite having virtually no points of explicit similarity with George Lucas's space opera has always struck me as being quintessentially a post-Star Wars film of the highest order. The wrinkle is that Time Bandits is also a Terry Gilliam film of the highest order; in fact, the film where Gilliam's idiosyncratic vision started to crystalise into the form that it would mostly hold for the rest of his career. With all apologies to his solo directing debut, Jabberwocky, Time Bandits really is the first "Terry Gilliam film", and nobody could possibly have guessed what such a peculiar thing that would mean when it was put into production during that wave of wannabe Star Warses.

The good news - one of the last pieces of good news Gilliam ever received, at that - is that Time Bandits was one of the earliest films produced by HandMade Films, which was created by George Harrison in the 1970s for the primary purpose of making Monty Python's Life of Brian, largely because nobody else would and Harrison wanted to see it (this is the best single reason for being rich I have ever encountered). Presumably, therefore, the higher-ups at HandMade were okay with just about whatever damn thing Gilliam wanted to give them, and that's lucky for everybody involved, given that Time Bandits is an incredibly bizarre movie that subscribes to such an aggressively unconventional set of storytelling norms that you could be forgiven for imagining that it has no script beyond a series of undeveloped notes that Gilliam and co-writer & fellow Python Michael Palin had shoved into their pockets until about ten minutes before cameras rolled. Naturally, such a defiantly abnormal fantasy absolutely befuddled the hell out of aud- or never mind, Time Bandits actually managed to squeak onto the US Box Office Top 10 for 1981. I defy you to imagine that Gilliam could possibly do such a thing today. If J.K. Rowling's wish that he had directed Harry Potter and the Sorcerer's Stone had come true, I have no doubt that he would found a way to lose money on it.

Anyway, back to 1981, and Time Bandits: in a suburban development in England, a boy named Kevin (Craig Warnock) is living with his consumerism-obsessed parents, finding solace only in the books of fantasy and adventure. One night, he dreams that a knight mounted on a horse bursts from his bedroom closet, and this incident would have no particular note except for what happens the next night: six small men fall out of the same closet, gibbering about a map and holes in time and treasure. Understanding nothing, Kevin can do little more than stare as they fumble about, until something follows them through the closet: a huge backlit head speaking in the deep menacing voice of Tony Jay. The six men immediately push one wall of Kevin's room in on itself, running down a hallway to nowhere, and the confused boy runs after them; and just like that they all end up in a rural farmhouse in Italy, at the beginning of the 19th Century.

The Time Bandits of the title turn out to be these six dwarves, a somewhat bumbling collection led by the quick-tongued but less than quick-witted Randall (David Rappaport), former employees of the Supreme Being - that same floating head - who were formerly employed as the creators of bushes and small trees throughout Creation, until they got it in their head to steal a map of all the holes in the universe, where time and space don't move like usual, and thus sneak from era to era in search of wealth. For about half of its length, Time Bandits plays as very little more than an excuse for Gilliam, production designer Milly Burns, and costume designer Jim Acheson to create amiably chintzy versions of a few different historical settings as a young boy might find exciting: the war-torn Europe of Napoleon (Ian Holm); the forest of medieval England, home to Robin Hood (John Cleese); ancient Greece and the kingdom of Agamemnon (Sean Connery). Along the way, Gilliam and Palin get to indulge in Python-light historical travesty: their Napoleon is a petulant brat who wants only to be constantly entertained, and who is disgusted by anyone over 5'6", Robin Hood is is a completely addled do-gooder who walks about in a complete daze of good humor and obliviousness.

Eventually, things start to gel, when the adventurers are tricked into going to the fantastic realm inhabited by the embodiment of absolute Evil (David Warner, in a stupendous turn as a completely un-nuanced villain), and the plot begins to take on an actual conflict and causality becomes a thing; but even here, the focus is less on the the narrative than on the space in which the narrative occurs. There is no character arc to speak of; Kevin doesn't really grow as a result of his experiences, and there is no warm and fuzzy resolution in which he's better-equipped to deal with his sometimes obnoxious life after all is said and done. On the contrary, the script's closing gambit is as jolly a rejection of the whole idea of moralistic children's entertainment as you can hope to find, though I think I'm not the only viewer who finds it objectively happier than a more conventional wrap-up might have been.

The story logic of Time Bandits - and it is driven by a kind of story logic, just not the kind most children's movies employ, which is why it's one of the best children's movies in an entire generation - is derived ultimately from traditional European fairy tales; not the sort that end up onscreen with Disney princesses singing to birds, but the sort that are terrifying and grim and delicious in their sheer inexplicable meanness. It is an elemental sort of movie, the kind that would chiefly assault us with concepts and images and become terrifically entertaining through the wildness of it all. It is, like Gilliam's later film Tideland, absolutely innocent about its intentions and worldview, but so willful in that innocence that something about it feels off-kilter and deliberately alienating (though Time Bandits by no means so unabashedly alienating as Tideland). We are not used to stories operating on such a direct level as pre-industrial folktales, with their comprehensive lack of psychology or discplined construction; this is what makes Time Bandits so absolutely wonderful if you're on its wavelength, and also what makes it so hard to be on its wavelength.

Again, though, and not to belabor a point, but as much as Time Bandits is a delightful trip through pure fantasy (it is the first of a loose trilogy of films Gilliam made about how a fantasy world can be an escape from the crushing drabness of the everyday, in three different stages of life), it is mostly a visual feast of Gilliam's warped sensibility given a live-action outlet for the first time in its unrestrained state. There's barely a scene that goes by without some distinct visual gesture that no other filmmaker would have come up with, although generally speaking, as the film progresses, this becomes more pronounced, until we finally end in Evil's lair, the main villain himself looking more than slightly like the Cenobites from Hellraiser later in the decade, and his cloaked minions with horse skulls for faces serving as some of the most effectively disturbing children's horror ever put to film.

But the whole thing is unmistakably Gilliamesque, to use a word that wouldn't really have meaning for a few more years: the handmade quality of all the sets, which are lovingly detailed and realised even as they are somewhat pointedly cheap; the extreme flatness of the images, in which even the deepest sets feel two-dimensional, like they've been pinned beneath glass (and surely it's no accident that an animator would make this aggressive flatness his defining aesthetic). It is a unique world shot in a unique way, and laced through with the sense of humor that characterises almost all of the filmmaker's work - it seems like it should be funny, except nothing is obviously meant to be a gag - the whole thing is pretty much special altogether. Not as unique now as it once was - Brazil is an improvement on it in almost every way, and The Adventures of Baron Munchausen at least as good at creating a fantasy world - but it's an intoxicating dose of children's entertainment of the rarest and weirdest and most delirious kind.