The term comes from ancient Greek theater, which often employed this technique–probably because the audience was known to get violent when the show didn’t end the way they wanted it to. Basically, a crane–the “machina,” or machine–would lower an actor playing the role of one of the gods–the “deus”–who would then resolve everything and tie up all the loose ends without the heroes having to do anything.
Sound unsatisfying? Yeah, I think so too. That’s why it’s often used as a derogatory term, much like Mary Sue. HOWEVER, it can be done well. As always, your mileage may vary, but here are some examples that pull it off:
- Watership Down: A girl saves Hazel from her cat. Satisfying because it makes sense from the girl’s point of view, and humanizes the story by showing that it really does take place in our world.
- The Hobbit: The eagles arrive out of nowhere to turn the tide of the Battle of Five Armies just at the critical moment. Satisfying because it’s a cavalry ending as well, though some fans don’t like it.
- Lord of the Rings: Again, the eagles swoop down and save the day, this time by rescuing Frodo and Sam from the fires of Mount Doom. Satisfying because after coming this far, we really don’t want a downer ending.
- Harry Potter and the Sorcerer’s Stone: Harry is saved by his mother’s love. Satisfying because of the symbolism and the power of love.
- Lord of the Flies: Just as the boys are about to kill each other, a military ship arrives out of nowhere and rescues them. Again, satisfying because of the symbolism, as well as the collective “what have I done” moment.
- Schlock Mercenary: Many, many occasions. Satisfying because it’s brilliantly lampshaded.
- Monty Python and the Holy Grail: ”…the animator had a fatal heart attack! The cartoon peril was no more!”
- Raiders of the Lost Ark: The Nazis capture Indiana Jones and get the Ark of the Covenant, but when they open it, a supernatural force kills them all. Satisfying because it squares with Indy’s general MO and his pattern of spectacular failures.
- The War of the Worlds: The humans are utterly powerless to stop the aliens, but they all die off from germs. Satisfying because of the underlying message.
Does this mean that it’s a good idea to write off any criticism that your own work suffers from a Deus Ex Machina? Probably not. This is one of those things that readers tend not to notice when it’s done well. If your readers notice it, chances are that something is broken.
As you might guess, there’s a lot of gray area as to what constitutes a Deus Ex Machina, and what is actually something else. Generally, if the ending is properly foreshadowed, either by a Chekov’s Gun or by good character development, it’s not a Deus Ex. The foreshadowing removes the “out of nowhere” aspect that readers find so unsatisfying.
Foreshadowing is one way to fix a Deus Ex Machina. Another way is to toss out the ending and rewrite it from scratch, starting at the point where hero starts getting sidelined. According to Dan Wells’ seven point story structure, the hero should typically spend the first half of the story reacting to the villain, and the second half getting the villain to react to him.
There are lots of other ways to fix a Deus Ex Machina, but those are probably the biggest ones. If you have any other suggestions, by all means, suggest away.