Deus ex machina is a plot device in which a seemingly unsolvable problem is resolved by a sudden and unexpected external event. For example: "The villain has our hero backed in a corner with no way out. He's finished for sure! Just then, a car swerves out of nowhere and hits the villain."

I'm wondering, what is the opposite of this plot device?

As in, all the pieces which are needed to resolve the problem have been lying in plain view from the beginning of the story, but it is only at the climax that the protagonist puts the pieces together in an unexpected way to solve the problem. If done skillfully, it surprises and delights the audience.

As you can see, I don't mean "diabolus ex machina" (where the unexpected event is misfortunate rather than fortunate), but I want to know what it is called where the ending doesn't rely on unheralded external forces and only involves a (perhaps very clever) assembly of elements already present in the story.

The American TV series "MacGyver" is a corny example of this. MacGyver always saves the day by putting together the ordinary objects he finds around him.

Sadly, "MacGyver" was rather hokey and contrived. He always happened to get locked in a room containing steel wire, metal tubes, a radio, a pair of pliers, a chemistry set, and a canister of black powder. There are other stories that employ this plot device much more dexterously and subtly (but I can't think of them).

What am I describing?

  • 8
    How are you distinguishing this from any common or garden plot resolution? Is it perhaps the case that Deus ex Machina gets a name of its own specifically because it is a deviation from the norm?
    – Spagirl
    Sep 21, 2021 at 14:49
  • 1
    @Spagirl — Um, it seems that most plots are resolved through some formulaic human drama or predictable action sequence. I have in mind something more like a puzzle, where the pieces are laid out discreetly but clearly. At the end, we are amazed to see how all the pieces fit together in a natural way.
    – SlowMagic
    Sep 21, 2021 at 17:40
  • 1
    Perhaps not an answer, but this is very common in Neal Stephenson's books as well: they build up rather slowly and then explode into action and rapid narrative progression in the last 100 or so pages. Sep 21, 2021 at 20:28
  • 1
    Make up your own term for it. "Ego ex machina" or something.
    – minseong
    Sep 21, 2021 at 21:04
  • 3
    Deus ex-machina is a crutch or a hack - it's a "get out of jail free" card for a story the author has painted themselves into a corner with and no longer wants to invest effort into. The opposite of that is just good writing.
    – J...
    Sep 22, 2021 at 15:39

4 Answers 4


The terms Chekhov's gun and foreshadowing may fit the bill. In the above example, you could say the eventual solution of the problem had been foreshadowed throughout the story, or that it was set up as a Chekhov's gun.

"Chekhov's gun" was originally defined as

a dramatic principle that states that every element in a story must be necessary, and irrelevant elements should be removed. Elements should not appear to make "false promises" by never coming into play.
"Remove everything that has no relevance to the story. If you say in the first chapter that there is a rifle hanging on the wall, in the second or third chapter it absolutely must go off. If it's not going to be fired, it shouldn't be hanging there." [Anton Chekhov]
Source: Wikipedia

Although originally defined as a general "dramatic principle", today "Chekhov's gun" is often used to denote a specific story element:

The term has come to mean "an insignificant object that later turns out to be important." For example, a character may find a mysterious necklace that turns out to be the power source to the Doomsday Device, but at the time of finding the object it does not seem important. The necklace was essential to the story, but its introduction downplayed its importance. Chekhov's advice was not necessarily to conceal importance, but to just not spend time on things that are not important.

Source: TV Tropes

Foreshadowing, meanwhile, is defined as

a literary device in which a writer gives an advance hint of what is to come later in the story. Foreshadowing often appears at the beginning of a story, or a chapter, and it helps the reader develop expectations about the upcoming events.

Source: Wikipedia

  • 3
    Thank you so much for explaining Chekhov's gun. This is a term I had heard, but never fully understood. You explained it, and how it is relevant to my question!
    – SlowMagic
    Sep 20, 2021 at 20:58
  • 2
    Excellent answer. Welcome to the site! Good to have you. Sep 21, 2021 at 14:25
  • 2
    Isn't Chekhov's Gun more of an antithesis to Proust-style prose for the sake of prose? Sep 21, 2021 at 16:52
  • 1
    @rackandboneman: I think this answer is explaining that that was Chekhov's original intent, but the modern meaning / understanding / usage is for setup of an item that will turn out to be important. As a non-writer of fiction who's occasionally heard people talk about how stories work, that was my understanding of the term. (So I was interested to read the original general point Chekhov was making, with the choice of a gun as an example obviously suggesting more plot-turn or conclusion type results than e.g. using a teapot seen earlier to make tea later.) Sep 21, 2021 at 23:28
  • I think what the OP is looking for is more of a reverse-Chekhov's gun effect. Not so much "If a gun appears in the first act, it must go off in the third", but rather "If a gun goes off in the third act, it must have appeared in the first". Sep 23, 2021 at 21:12

The closest literary term for this is most likely anagnorisis. The Concise Oxford Dictionary of Literary Terms by Chris Baldick (Second edition. Oxford University Press, 2001) defines the term as follows:

anagnorisis (…) the Greek word for 'recognition' or 'discovery', used by Aristotle in his Poetics to denote the turning point in a drama at which a character (usually the protagonist) recognised the true state of affairs, having previously been in error or ignorance. The classic instance is Oedipus' recognition, in Oedipus Tyrannus, that he himself has killed his own father Laius, married his mother Jocasta, and brought the plage upone Thebes. (...) Similarly, the plots of many novels involve crucial anagnorises, e.g. Pip's discovery, in Great Expections, that Magwitch rather than Miss Havisham has been his secret benefactor. (…)

The article Anagnorisis on LiteraryDevices.net lists several examples, for example from Wallace and Gromit: The Wrong Trousers, Shakespeare's Macbeth, Oscar Wilde's The Importance of Being Earnest, The Wizard of Oz, Harry Potter and the Deathly Hallows and Fight Club.

  • 1
    I'm not sure how well this matches what the OP is looking for. They specifically want a scenario in which the protagonist's "recogni[tion of] the true state of affairs" is used, as in deus ex machina, to resolve a problem. The Oedipus realisation surely isn't a case of the protagonist putting together already-laid pieces to achieve success.
    – Rand al'Thor
    Sep 20, 2021 at 18:09
  • 1
    @Randal'Thor In a tragedy, anagnorisis tends to lead to the protagonist's downfall, but in comedy, it leads to a happy end.
    – Tsundoku
    Sep 20, 2021 at 18:36

Just call it a "detective novel ending" and everyone will know what you are talking about.

"Deus ex machina" has a name because it's a deviation from the norm. Plots are normally resolved without last-minute divine (external) intervention.

You seem to specifically want endings that put all the puzzle pieces together, which is a trope of the detective genre. There's a whole Hancock skit about it, The Missing Page.

There is no name for this "plot device" as far as I know. Just call it an "Agatha Christie/Hercule Poirot/Agaton Sax ending". Using an example of someone who is famous for having this ending will be the best way to communicate what you are trying to. You could even call it a "MacGyver ending".


Diabolus ex Machina

The devil from the machine. When things get worse for the good guys and better for the bad guys.

  • 4
    This was specifically ruled out by the question. ‘ As you can see, I don't mean "diabolus ex machina" (where the unexpected event is misfortunate rather than fortunate)’. If you think it is correct regardless, you need to explain to OP why they are wrong to rule it out.
    – Spagirl
    Sep 21, 2021 at 22:53
  • 1
    I'm guessing this was an answer to the question title without really reading the question body? Sometimes answering the title can be useful if there's another interesting point to be made, but you should still skim the question and search (control-f) to see if anyone's already mentioned what you're going to say. Sep 21, 2021 at 23:36
  • To be honest the question is not very clear, OP takes a long time to actually specify what they want, and spends a lot of time repeating "opposite of deus ex machina" to which this answer may be the most correct
    – minseong
    Sep 22, 2021 at 17:17
  • @theonlygusti -- But your suggested edits were incorporated into the question.
    – SlowMagic
    Sep 22, 2021 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.