Identifying and Avoiding Deus Ex Machina

You know when you are totally invested in a book or movie and the hero is backed up against a cliff with no options and you think for sure he is going to die and suddenly a flying robot that had never appeared in the story before shows up to rescue him. That is deus ex machina.  In fiction, we are often counseled to avoid deus ex machina because it is a cop-out and readers don’t like it. Deus ex machina is pronounced Day-oos eks MAH-kee-nah and is often referred to as DEM for short. But what, other than flying robots, does DEM mean? Are there different levels of DEM? Is DEM always a bad idea? And are all unsatisfying or surprise endings to a novel or movie examples of DEM?

What does Deus Ex Machina mean?

Deus ex machina (DEM) is when some new event, character, ability, or object solves a seemingly impossible situation in a novel or movie in a sudden, unexpected way. If the secret documents are in Chinese, one of the spies suddenly reveals that they can read Chinese. If a protagonist falls off a cliff, a pterodactyl that had not previously appeared will suddenly appear to catch them.


The term is Latin for “god out of the machine” and originates in ancient Greek theater, where a crane was used to lower actors or statues playing a god or gods onto the stage to set things right, often near the end of the play.

To be DEM, there are a number of requirements that must be met:

  • The unexpected development must be a solution. DEM is never an unexpected development that makes things worse or changes the understanding of the story.
  • The problem a DEM fixes must seem unsolvable or hopeless. If the problem could be solved with common sense, the solution is not DEM.
  • DEM solutions must be sudden or unexpected and not foreshadowed earlier in the story. If the solution is foreshadowed earlier in the story, it must not seem like a viable solution to the problem.
  • ·DEM solutions must be improbable or seem be at the hands of some intervening force.

In an excellent post on deus ex machina, Michael J. McDonaugh makes the following comparison to illustrate what is technically a DEM solution and what is not. If the characters are in the middle of a historical battle and the cavalry which was in the area, rides in to save the day at the eleventh hour, this is not DEM because it is not that surprising and not implausible. However if a woman is being attacked in a contemporary novel in a park down the street, and the cavalry rides in to save her, it is much more likely to be considered DEM.

There are many arguments in online forums with regard to what actually constitutes a DEM. Some critics would say that every Neil Gaiman book, every Harry Potter book, and almost every Star Trek episode end in deus ex machina. Lists of DEM endings abound and this one here is a particularly detailed and useful one.

Many of the best examples of DEM are from movies, which are even more prone to DEM because they have less runway than books writers sometimes have to wrap the plot in short order. But there are still many disagreements regarding what constitutes DEM. For example in Star Wars: The Attack of the Clones, Yoda shows up with a clone army at the end to save the day. Some would say this is a DEM because the army just “shows up” and rescues the protagonists from a seemingly impossible position. However others would argue that it is not because the audience knew that the army existed and that Yoda had gone off in search of it. It is this foreshadowing that to some makes this not a DEM. A DEM has to come out of nowhere for it to be a true DEM. For example, in Jurassic Park 3, the protagonists are surrounded by raptors only to be saved by the unexpected appearance of the US Navy (which also coincidentally occurred to end Lord of the Flies which is also considered by some to be a DEM ending). However, it has been noted though that in Jurassic Park the fact that Sam Neill made a call to Laura Dern indicating they were in trouble was sufficient foreshadowing of the arrival of the navy. It is also argued that the T-Rex showing up in the first Jurassic Park to save the protagonists from the raptors is DEM. But others note that because everyone knew that the T-Rex was out there that it’s not, but that if King Kong showed up to save the day (which would be totally unexpected) that would be DEM.

So you can see there is often little agreement on what constitutes a DEM, what is sufficient in terms of foreshadowing, and what constitutes implausible (although I agree that King Kong in Jurassic Park would definitely be a DEM). Throw in endings where characters suddenly discover talents such as magical powers, remember lessons they had the previous year, or find some weapon that just happens to be in their pocket at the eleventh hour, and it gets a little more murky in terms of deciding what is DEM.

Are there levels of DEM?

To complicate matters, some would say there are levels of DEM from a total DEM to a partial DEM.

A total DEM is where the solution is resolved by a plot element (intervening force, ability, found item) that didn’t previously exist and has no logical explanation behind it. An unexplained pterodactyl shows up in a contemporary novel, the protagonist just happens to find a gun in his pocket, the protagonist suddenly develops x-ray vision, or the protagonist proves to be a martial arts specialist (if the character at least knew he had the skill, this is called Suddenly Always Knew That; if he didn’t, it can be called New Powers as the Plot Demands).

Partial DEMs include cases where:

  • something is established ahead of time but its use in the particular situation is jarring or implausible. For example, it is established that there is a cavalry in the area but them bursting into an unknown farmhouse where a crime is being committed just at the right moment is inexplicable.
  • the situation is resolved by something that is established ahead of time (e.g. a gun or power) but it seems poorly established ahead of time, like the author needed a way for their hero to escape a situation and went back to write in a few lines about the character putting a gun in his pocket (which he then clearly forgot about until the last minute), or mentioning that he knows Kung Fu in a conversation.
  • the situation is resolved by a something that apparently happened ahead of time but is explained in the moment. For example, “Hey remember that lecture that we had in class about explosives and breaking into banks,” or “Hey remember when you won the world martial arts championship. Now’s the time to bring those skills out.”

There are also cases where the writers are too clever or subtle for their own good and have not foreshadowed effectively enough for the audience to pick up on it and the solution seems like DEM. But these aren’t true DEM so we will skip them.

Why is a DEM considered bad?

DEM is seen to be the mark of a poor plot and writing that the writer needs to resort to random, insupportable and unbelievable twists and turns to reach the end of the story. DEM is a considered sign that the writer wrote themselves into a corner and could not figure a clever way out of it. DEMs are considered an authorial cop out, and readers and audiences who have invested time in a book or a movie are frustrated that there is no satisfying ending. True DEM endings also indicate that the writer has no idea what they’re doing and just need the story to be over.

Context is important and some argue that DEMs work best in comedies where anything goes and readers expect some tongue in cheek. Monty Python movies for example often have DEM endings. DEM is considered less acceptable in serious works where people expect a realistic conclusion to the story.

When people see a DEM ending, they feel like the writer is in essence flipping them the bird and saying “I’m done writing and I don’t care about your investment in this story.”

Are all unsatisfying or surprise endings to a novel or movie examples of DEM?

It is important to be careful here in deciding that an ending is a DEM. Some readers and audiences get upset and call DEM on a wide variety of unsatisfying endings, surprise endings, or endings where the writer couldn’t figure a clever way out of the corner that the reader or audience didn’t think of. However some people are a bit too quick to call DEM on an ending that was not totally to their liking. Many surprise, unsatisfying, or imperfect endings are not in fact DEM and it is difficult to deliver a perfect ending.

First of all, the criteria that the solution must be something that the reader or audience didn’t think of is a bit challenging. Readers and audiences can always think of potential solutions, and if there was foreshadowing (which there must be to avoid true DEM) then they should be aware of some of the potential solutions. Remember true DEM is where something is introduced (such as King Kong in Jurassic Park) that the audience or readers could not possibly have thought of because it is completely manufactured.

Second, on some level, readers and audiences expect writers to write themselves into a corner in action and adventure stories. To make stories exciting, writers are forced to continually up the stakes and put their characters in seemingly impossible situations. Seemingly impossible situations create tension and the opportunity for the dark night of the soul. If the solution was easy and everyone could see it then there would be no tension. Seemingly impossible situations by definition require a solution that can seem like DEM because they are by definition impossible. We would not think they were impossible or exciting if we knew perfectly well that the character had all the powers needed to crush the villain or that the US Navy was on the way and had left in plenty of time to get there.

To make them impossible, we can’t believe or know those things, at least not totally. To get out of their seemingly impossible situation, the characters either have to do something surprising, find something that helps them to escape, or someone has to arrive in the nick of time. I agree that some of those powers, abilities or objects that they discover, or the person who arrives to rescue them can be more or less clever and more or less foreshadowed, but they can’t be completely foreshadowed or known or there would be no tension or surprise.

Add the double whammy that readers and audiences often want a happy or at least satisfying ending, and you have an even more difficult situation for the writer. Often the realistic outcome of an impossible situation is that the heroes die, or fail. Frodo and Sam get killed by evil minions after the ring is destroyed, the Enterprise gets blown up, Luke fails to destroy the Death Star and dies. Nobody wants that. Well not many people anyway.

So the writer is in a difficult predicament. Create a story with impossible situations, high stakes, and an ending that is happy, surprising and clever, but not DEM.

Of course, true DEM endings are to be avoided. For example, having a lightening bolt, or a bus, or God suddenly take out the bad guy, or the protagonist suddenly discover some doohickey in his pocket that he didn’t know about before and just picked up by accident, and can turn back time, (or as someone noted on Star Trek have Geordie suddenly realize he can remodulate the Hoopendorf discombobulator and defeat the enemy’s force fields we’ve never heard of the Hoopendorf discomboulator before) are probably true DEM endings.

But having a character suddenly realize that an ability he’s been developing over time can vanquish the villain, or a friend suddenly coming back at the last minute to help (such as Han Solo in Star Wars: A New Hope), or the characters suddenly patching together some solution using objects that we know they have found or have been carrying (as in MacGyver) have to be okay. Because readers and audiences demand both tension and surprise and how else is the writer to deliver it?

There are many tropes that can help a writer establish surprise endings or for heroes to get themselves out of scrapes that are not DEM endings. Some of them may seem clunky and overused, and can be well or poorly executed, but writers should familiarize themselves with them. These have multiple names such as Chekhov’s Gun (the hero finds or puts a gun in their pocket early on in the narrative) or Some Day This Will Come in Handy (where the hero has some arcane knowledge or receives some seemingly useless knickknack that will later save the day), Chekhov’s Lecture (the hero gets a lecture on something that will be relevant to extricating themselves from the impossible situation later), and Chekhov’s Skill (the hero trains in some skill that will be required to get themselves out of the impossible situation). It is critical for these that they are introduced ahead of time in sufficient depth to seem realistic (and therefore not partial DEM). There are a variety of means of introducing them ahead of time that can make them seem more or less realistic. For example in skill development, it can’t be completed too quickly or it is considered Instant Expert. It must be actually shown, not mentioned, or it is a Chekhov’s Hobby.

Moreover there are many anticlimactic, unsatisfying, or poor endings that are not DEM (e.g. the protagonist dies, the action just ends with no resolution, a story with a logically sad ending ends happily) so it is important to review the criteria for DEM before deciding it is such.

So yes, deus ex machina is almost always bad, but not all surprise or unsatisfying endings are deus ex machina.

Categories: Writing Tips.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>