In early 1980s England we find Kevin Lotterby, an average 11-year-old boy who is fascinated by history and its legends. However, his material-obsessed parents could care less and spend their evenings ignoring their son and watching game show programs on TV.
One night, Kevin is made to get to bed early and just as he lies down to sleep an armored knight riding on horseback bursts from his wardrobe. He then finds himself right smack dab in the middle of a forest clearing. Just after Kevin gets to his feet, the forest falls away and his normal bedroom has turned back to normal, as if nothing out of the ordinary had happened. Examining a picture on his wall almost identical to the scene he just witnessed--a knight on horseback in the middle of a forest--it's his father who bursts in through his door this time, complaining about all of the racket Kevin was making and yells at him to get to sleep.
The following evening, Kevin returns to bed equipped with a Polaroid camera and a flashlight, determined to document whatever else might decide to emerge from his wardrobe. Just as he's given up hope and begins to fall asleep, a group of six strangely dressed dwarfs file out of his closet. Kevin shines his light at them and they cower, calling him the The Supreme Being. Soon after discovering his true identity, they gang up on the innocent Kevin, accusing him of things he has no knowledge of. However, when a frightening head-shaped apparition appears in Kevin's room and demands that they return what they've stolen, the dwarfs switch tactics and begin pushing on Kevin's picture-filled wall. Nothing happens at first, but then the wall gives way and keeps going; revealing a stretched hallway through which they continue to push the wall. The Supreme Being still after them, Kevin decides to help the dwarfs. The wall soon gives way through an opening at the end of the hall and the group plummets into the black space beyond.
Cut to: a bright, blue sky where suddenly a black door-shaped opening forms and Kevin and the dwarfs fall right out of it. As it turns out, they have used a portal to travel back to 1796 Italy, during the Second Battle of Castiglione, whey they meet Napoleon and proceed to steal his riches, despite Kevin's objections. They subsequently to the time of Robin Hood, where they are promptly volunteered into giving up their plunder to the poor, much to the dwarfs chagrin. The dwarfs finally explain to Kevin that they work for The Supreme Being, the creator of the Universe, as designers. Kevin learns that the dwarfs, whom are named Randall (the self-proclaimed leader), Fidgit, Strutter, Og, Wally, and Vermin, were employees of the Supreme Being, the creator of all the big stuff in the universe, while it was the regular job of the dwarfs to create small bushes and trees. After designing a particularly foul-smelling tree, the dwarves were demoted to the job of repairing holes in the space-time fabric. Instead, however, they spitefully stole the map of the holes' locations, which they are now using to travel around, stealing treasures from across history.
Meanwhile, in secret, this journey is being observed via mystical powers by a malevolent sorcerer, known simply as the Evil Genius or Ultimate Evil, who seeks the map for himself to recreate the universe to his liking. In the Fortress of Ultimate Darkness, the Evil Genius is planning to steal the map for himself. He rants a little about The Supreme Being, saying that slugs are a demonstration of his incompetence. What about you? one of his henchman asks. He created you. Evil responds by blowing him up, adding Don't ever ask me another question like that! No one created me! I am absolute evil! I made myself! Another henchman pushes his luck, asking, Then how does he keep you here? How does he keep you trapped in the fortress? He promptly gets blown up. Good question, Evil states. If I were creating the world I wouldn't mess about with butterflies and daffodils. I would have started with lasers, eight o'clock, Day One!
While the dwarfs ponder their next move, Ultimate Evil decides to magically speak through the mouth of one of the more dunderheaded dwarfs in order to convince the rest of them to pursue the resting place of the most fabulous object in the world. The dwarfs begin to fight amongst themselves for the map until the Supreme Being rematerializes, which leads Kevin to jump through a time-travel portal on his own in escape.
Kevin unintentionally saves the life of King Agamemnon when he falls from a time portal in the sky. After inadvertently helping Agamemnon slay a vicious minotaur, Kevin is welcomed to Agamemnon's royal court and treated like a son. Reflecting on his own neglected life and family, Kevin wishes he can stay with the king forever. Kevin is elated with his new home, capturing scenes during his stay with his Polaroid camera, but this is not to last. In yet another time-traveling robbery scheme, the dwarfs suddenly appear and manage to steal Agamemnon's riches along with the boy.
After time-traveling to the infamous luxury liner Titanic, the boat begins to sink and the stranded group is forced to search out the most fabulous object in the world which turns out to be the Fortress of Ultimate Evil.
Evil, meanwhile, begins to manipulate the adventure with his magical influence, so that Kevin and the dwarves end up out the freezing waters of the Atlantic Ocean to the ocean of the Time of Legends. Here, circumstances become even more fantastical. The group is picked up by a ship containing the Oger Winston and his human wife. After overpowering Winston and throwing him and his wife overboard, the group takes command of the ship, but they barely escape when their ship is adorning the head of a giant. After putting the giant to sleep by injecting the stop of his head with sleep potion, the travelers escape and find themselves in a vast desert.
The dwarfs believe an epic treasure, The Most Fabulous Object in the World, awaits in this time-period within the Fortress of Ultimate Darkness, where Evil himself resides. Meeting an invisible wall in the middle of the desert, the dwarves begin to fight and dissent from Randall's authority, when they accidentally down the wall by smashing through it like a pane of glass. They step through the jagged opening to behold Evil's fortress lying ominous on the other side. Once inside, the dwarves are immediately deceived by Evil's shapeshifting abilities into handing over the map. Evil imprisons them and Kevin in one of many cages hanging over a bottomless void, but the group undoes the lock and swings from cage to cage until they are back within the fortress hall. They are able to use a photograph of the map Kevin had taken earlier to identify holes they can use to recruit help and recover the map. The dwarves begin putting their plan into action.
Kevin is almost left to face the Evil Genius alone when suddenly all kinds of characters from all time periods come to the rescue, among the group several Roman archers, cowboys, a Panzer, knights, and a futuristic soldier, and the dwarfs. The cowboys attempt to wrangle Evil with their lassos, but he begins to spin and the centrifugal force sends them flying. Evil's skull opens up and a wicked looking pole extends from it, producing a knife which cuts the ropes which unsuccessfully bound him. When the archers attempt to skewer them with their well-aimed arrows, Evil essentially turns himself into a pincushion and fires the arrows right back at their sources.
Although the hodge-podge group puts up what could be considered a good effort, all efforts to foil evildoing prove in vain and all certainly seems lost. But then, out of nowhere, The Supreme Being appears in human form and turns Evil into brittle stone. While Randall tries to apologize to The Supreme Being for his groups actions, The Supreme Being reveals that everything which had occurred was actually all part of His plan. He goes onto briefly explain that he let the midgets borrow the map because, as it turns out, Evil was HIS creation after all and the Supreme Being simply wanted to see it put to the test. Free will is the reason why evil still exists, He explains. He instructs them to dispose of Evil's crumbling bits and pieces into a Post Box He has provided in order to rid the world of it and warns them not to touch it with their bare hands. Unbeknownst to them, one chunk is overlooked and slowly begins to fester. The SB forgives the dwarfs for their insolence, deciding demotion and a pay cut will suffice as a good enough punishment and announces that it is time to go. Map safely in hand, He and the dwarfs then leave an indignant Kevin behind to carry on the fight. Soon, however, the festering piece of Evil begins to smolder and in moments Kevin is enveloped in a cloud of thick, strangely colored smoke.
Almost instantaneously, Kevin wakes to find himself back in bed, surrounded now by thick, black smoke. Firemen burst through his door just in time and rush him from his burning home. Outside, his parents fight over which kitchen appliances should have been saved from the flames and seem to have no concern for whether Kevin had made it out of the house alive or not. As Kevin watches the growing flames lick at his home, a familiar looking fireman walks by. On second look, Kevin recognizes the man as the spitting image of King Agamemnon. Baffled, wondering if it was all a dream, Kevin checks his pockets for any evidence of his journey and is amazed to find all of the Polaroid snapshots that he took while on his adventures. Another fireman emerges from the home with a charred toaster oven-type device in hand, declaring that it was the cause of the fire. His parents open the appliance, revealing the smoking chunk of evil lying inside. Kevin gasps, realizing it as the source of the fire. Mom, Dad! He warns, Don't touch it! It's Evil! But as always, his parents foolishly ignore him and touch it anyway. They both explode on contact with the rock, leaving almost no trace behind. King Agamemnon-turned-fireman winks at Kevin and drives away in his fire truck, leaving Kevin alone and bewildered to look back at the smoldering ashes of his home and (late) parents while his nosy neighbors look on.
The camera zooms out from the town, the world, and the galaxy to reveal its location on the Supreme Being's map. The Supreme Being's hands then roll up the map, ending the film.