Original image

The Lost Scripts, Part I: Indiana Jones and the Monkey King

Original image

In 1977, George Lucas and Steven Spielberg agreed to make a film called Raiders of the Lost Ark, a tribute to the Saturday matinee adventure serials of the 1930s and 40s. Over the next 20 years, they would release three more films in what would become the beloved Indiana Jones franchise. Although it's not unusual for a film to have unused screenplays hiding in a filing cabinet somewhere, the lost scripts of Indiana Jones are an especially fascinating look at what might have been for everyone's favorite whip-wielding, fedora-wearing archaeologist.

The Story Behind the Story

When George Lucas first approached Steven Spielberg about making Raiders of the Lost Ark, Lucas said he had enough ideas to fill three movies. However, after Raiders brought in $384 million at the box office, making it the fourth highest-grossing film ever at the time, it was apparent that Lucas didn't have story ideas lined up for one, let alone two sequels. Lucas and screenwriters Willard Huyck and Gloria Katz borrowed ideas that had been cut from or never implemented for Raiders, and wrote Indiana Jones and the Temple of Doom, released in 1984. Once again, Indy fans came out in droves to a $333 million box office take, which meant they were hungry for more of the whip-wielding archaeologist.

Since very early on, Lucas had wanted to use the legendary Holy Grail as an Indy movie “MacGuffin," a term used to describe an object that propels the plot forward, like the Maltese Falcon or the Lost Ark. To make it more mystical, Lucas imbued the Grail with the gift of eternal life, an aspect that Spielberg never liked, because he felt it took Indy into overly-supernatural territory. So instead, Lucas hired Chris Columbus to approach the same idea in a roundabout way, resulting in the 1985 script, Indiana Jones and the Monkey King.

The Plot


While on a fishing vacation in Scotland, Indy gets roped into a murder investigation that leads to an allegedly haunted mansion. Inside, Indy faces off against empty animated suits of armor and matches wits with a long-dead nobleman who's responsible for the murders on the moor.

The story really kicks off when Indy gets back to Marshall University and is contacted by his old friend Marcus Brody. Brody tells him about zoologist Dr. Clare Clarke, who has come in contact with Tyki, an African pygmy, who claims to know the location of the lost city of Sun Wu-Kung, the Monkey King. As proof, Tyki says he is 200 years old thanks to an enchanted peach pit that he wears around his neck, apparently from the Monkey King's orchard, where the fruit can grant eternal life with a single bite.

Indy boards a ship to Mozambique along with a stowaway he's unaware of until he reaches port – his young teaching assistant, Betsy Tuffet, who has a schoolgirl crush on her professor. Indy and Betsy join Dr. Clarke, a no-BS kinda gal, Scraggy Brier, a superstitious native, and Tyki, the good-natured pygmy.

Unfortunately, before the expedition can begin, Tyki is kidnapped by Sgt. Helmut Gutterburg, a Nazi stooge with a machine gun arm, who is under the command of Lt. Werner Von Mephisto, a hulking Aryan monstrosity. The Nazis escape with Tyki inside their three-story tall, 100-foot long tank. Of course Indy rescues Tyki and the good guys make their way to the lost city with the Nazis on their tail.

They are stopped at the gates by a troop of guardian gorillas that have been trained to defend the city from intruders. Just as a gorilla is about to throw Indy off the mountain, Tyki shouts a command and the gorilla snaps to attention. We soon discover that Tyki isn't just any resident of the city – he is the future king.

Soon Indy, the natives, and the gorillas are battling it out with Mephisto and his men. In a surprising twist, Indy is shot and killed by Mephisto, but his body is carried into the enchanted peach orchard. There, Sun Wu-Kung, the half-man, half-monkey god, is reconstituted from ancient skeletal remains. The monkey-man heals Indy and then gives him a shape-shifting staff as a gift for his valiant defense of the Monkey King's chosen people.

The Action

Temple of Doom was frequently criticized for its dark tone and level of violence for a PG-rated film. In fact, as a response to Temple, the MPAA created the PG-13 rating, which was first applied to Red Dawn just a few months later. Perhaps as a way to avoid controversy again, Chris Columbus, who had written the screenplays for action movies aimed at kids, like Gremlins and The Goonies, was brought on to remove some of the edge from the Indiana Jones franchise. But Monkey King is more comedy than serious action-adventure, especially in the action sequences.

For example, as the massive, three-story tank rumbles across the African plain, it sends herds of animals – as well as Indy and his friends - on the run. In the chaos, Indy happens upon a rhinoceros that starts chasing him, but he decides to use the raging animal to his advantage. With the rhino closing in fast, Indy starts to run in smaller and smaller circles until he's nearly alongside the giant beast. He then grabs the animal's horn and swings on top of the rhino's back, riding it as it turns and charges the enormous tank. When the tank's big gun fires, it scares the animal, making it stop abruptly only a few feet away from the treads. Indy is thrown forward onto the tank and the rhino runs off unharmed.

Later, when a Nazi tank rolls into the lost city, Clare and Betsy stand on opposite sides of a ravine with two groups of the specially trained gorillas. The two women “talk” to the apes through a series of grunts and moans, telling them to swing down on vines and attack the tank. After the apes rip the hatch off, they jump inside, and knock the crew unconscious. The next time we see them, they’re driving the tank while wearing the tank crews’ Nazi uniforms. Not only do they drive the tank, they head straight at another German tank and take it out with a single shot. They celebrate by jumping up and down and hooting and grunting.

As with virtually all of the Indiana Jones scripts, some action set pieces were borrowed from cut scenes or abandoned ideas that were originally intended for the other movies. For example, the first scene in Scotland was originally written as the opening to Temple of Doom, but Spielberg had just come off production of Poltergeist, and didn't want to do a haunted house scene again so soon. In addition, Gutterburg's machine gun arm was borrowed from early drafts of Raiders of the Lost Ark. The original Raiders character was something of a pre-computer age cyborg, who not only had a machine gun arm, but also a mechanical eye, and a radio transmitter permanently attached to his ear. Monkey King also presented some ideas that were later adopted into The Last Crusade, such as a speedboat chase that includes a boat being crushed between two ocean liners, and a scene where a character must be rescued from inside a tank.

The Aftermath

If fans were unhappy with Temple of Doom's female lead, it’s doubtful they would have been satisfied with Betsy in The Monkey King, either. This annoying, wanna-be tough girl from Brooklyn is constantly trying to woo Indy, which is bad enough, but she’s also used as a prop for comic relief throughout the script.

Early on, after Indy says he’s traveling without her, she tries to commit suicide in “funny” ways, like hanging herself with Indy's whip, dousing her body with bourbon and lighting a match that Indy promptly blows out, and by trying to drop a 150-lb urn off the top of a bookshelf onto her head. Later, everyone chuckles as a chimpanzee named Bonzo straddles Betsy and holds her down while he kisses her face. On a related note, one scene has her getting passed around from person to person, as no one wants to deal with her after she gets drunk. In the end, she gets tossed into a fisherman’s net and accidentally locks lips with what she thinks is Indy, but is actually a dead fish. In later versions of the script, her character was cut out entirely.

These comedic bits and Betsy’s attempts to flirt with Indy are just some of the many superfluous scenes in Monkey King. This synopsis doesn’t even mention the river pirates, who tag along for much of the second half of the story, yet are inconsequential to the plot. In addition, there’s another character, an American ex-patriot named Dashiell — clearly inspired by Humphrey Bogart’s Rick in Casablanca — whose sole purpose seems to be as a deus ex machina that saves Indy during the speedboat chase. Many scenes and characters add nothing of value to the story and would have only served to make fans’ eyes roll.

In the end, Spielberg simply didn't like the supernatural elements in Monkey King. He felt they made the screenplay too far-fetched to be consistent with the other films in the franchise. So Lucas tried once again to make the Holy Grail a viable MacGuffin, this time with screenwriter Menno Meyjes, who had written The Color Purple and parts of Empire of the Sun for Spielberg. The Grail was reworked as less a MacGuffin and more of a metaphor; by finding the Grail, Indy also found something that had been missing in his life – a relationship with his father.

Although the Meyjes version was closer, the script went through another writer, Jeffrey Boam, whose previous credits included Innerspace and The Lost Boys. After two versions, Boam's script became the third, and presumably last film in the franchise, Indiana Jones and the Last Crusade. As for Indiana Jones and the Monkey King, it was thankfully lost like the City of Sun Wu-Kung.

Stay tuned for the next exciting episode, Indiana Jones and the Saucermen from Mars…

Original image
iStock // Ekaterina Minaeva
Man Buys Two Metric Tons of LEGO Bricks; Sorts Them Via Machine Learning
May 21, 2017
Original image
iStock // Ekaterina Minaeva

Jacques Mattheij made a small, but awesome, mistake. He went on eBay one evening and bid on a bunch of bulk LEGO brick auctions, then went to sleep. Upon waking, he discovered that he was the high bidder on many, and was now the proud owner of two tons of LEGO bricks. (This is about 4400 pounds.) He wrote, "[L]esson 1: if you win almost all bids you are bidding too high."

Mattheij had noticed that bulk, unsorted bricks sell for something like €10/kilogram, whereas sets are roughly €40/kg and rare parts go for up to €100/kg. Much of the value of the bricks is in their sorting. If he could reduce the entropy of these bins of unsorted bricks, he could make a tidy profit. While many people do this work by hand, the problem is enormous—just the kind of challenge for a computer. Mattheij writes:

There are 38000+ shapes and there are 100+ possible shades of color (you can roughly tell how old someone is by asking them what lego colors they remember from their youth).

In the following months, Mattheij built a proof-of-concept sorting system using, of course, LEGO. He broke the problem down into a series of sub-problems (including "feeding LEGO reliably from a hopper is surprisingly hard," one of those facts of nature that will stymie even the best system design). After tinkering with the prototype at length, he expanded the system to a surprisingly complex system of conveyer belts (powered by a home treadmill), various pieces of cabinetry, and "copious quantities of crazy glue."

Here's a video showing the current system running at low speed:

The key part of the system was running the bricks past a camera paired with a computer running a neural net-based image classifier. That allows the computer (when sufficiently trained on brick images) to recognize bricks and thus categorize them by color, shape, or other parameters. Remember that as bricks pass by, they can be in any orientation, can be dirty, can even be stuck to other pieces. So having a flexible software system is key to recognizing—in a fraction of a second—what a given brick is, in order to sort it out. When a match is found, a jet of compressed air pops the piece off the conveyer belt and into a waiting bin.

After much experimentation, Mattheij rewrote the software (several times in fact) to accomplish a variety of basic tasks. At its core, the system takes images from a webcam and feeds them to a neural network to do the classification. Of course, the neural net needs to be "trained" by showing it lots of images, and telling it what those images represent. Mattheij's breakthrough was allowing the machine to effectively train itself, with guidance: Running pieces through allows the system to take its own photos, make a guess, and build on that guess. As long as Mattheij corrects the incorrect guesses, he ends up with a decent (and self-reinforcing) corpus of training data. As the machine continues running, it can rack up more training, allowing it to recognize a broad variety of pieces on the fly.

Here's another video, focusing on how the pieces move on conveyer belts (running at slow speed so puny humans can follow). You can also see the air jets in action:

In an email interview, Mattheij told Mental Floss that the system currently sorts LEGO bricks into more than 50 categories. It can also be run in a color-sorting mode to bin the parts across 12 color groups. (Thus at present you'd likely do a two-pass sort on the bricks: once for shape, then a separate pass for color.) He continues to refine the system, with a focus on making its recognition abilities faster. At some point down the line, he plans to make the software portion open source. You're on your own as far as building conveyer belts, bins, and so forth.

Check out Mattheij's writeup in two parts for more information. It starts with an overview of the story, followed up with a deep dive on the software. He's also tweeting about the project (among other things). And if you look around a bit, you'll find bulk LEGO brick auctions online—it's definitely a thing!

Original image
Name the Author Based on the Character
May 23, 2017
Original image