Writing 202: Deus Ex Machinas

Greetings and solecism! You know, it is almost like segway vs segue… anyway, hi and welcome! Today is a special topic by a special woman… None other than Lady Verbosa, aka Anne Winchell herself! A round of applause! What is today’s topic?

(Anne:) Why, what a beautiful segway there! 😜 Today’s topic is the dreaded deus ex machina and how to avoid it. So without further ado, let’s go!

What is a deus ex machina?

Deus ex machina is a very old term indeed, stemming from the ancient Greeks. It’s a Latin version of the Greek phrase

God from the machine

Which is not going to be our official definition, don’t worry! But it is the literal definition. It comes from Greek plays when a god or deity would appear through some clever machinery (usually either a crane lowering them or a platform raising them) and neatly solve whatever problem is facing the characters. That actually brings us to our actual definition!

When something from outside of the story that was not foreshadowed in any way appears at the climax of the story to neatly wrap up the conflict.

I’ve heard some people debate the part about there being no foreshadowing, but as I’ll discuss later, proper foreshadowing makes it no longer a deus ex machina. I suppose if you do a really bad job at foreshadowing, it might still be a deus ex machina 🤔 But we’re sticking with this definition. No foreshadowing. If your world has fairies in it, and that comes up in some way, then even if you don’t deal with them directly in the story, even if your characters dismiss it as ancient myth, it’s a valid thing to have swoop in and save the day.

Historical relevance

Obviously, there’s some history behind the term. It was used a lot by the ancient Greeks. There’s a bit of debate about who was the first to use it, but Euripides has probably the most famous examples. In Medea, Helios sends a chariot to save his granddaughter Medea, using machinery, of course! That seems to be the most cited example and is the one I learned about. There are plenty of others. Viewers were reminded of the awesome power of the gods.

Of course, there was also Aristophanes’s play Thesmophoriazusae, where the grand, illustrious god Euripides appears on a crane to save the day! Wait, he’s not a god; he’s the playwright! Yeah, it’s a parody, and it works, especially back then when that device was commonly associated with that playwright. It doesn’t go over as well today unless you’re in a literature class with your teacher telling you about the history of the deus ex machina and who the heck Euripides was.

There are more modern examples, and Shakespeare used deus ex machinas a few times, but the machinery part of it became less and less literal as time went on. Today, you don’t need the cranes and platforms; you just need it to be a totally unexpected and unlikely solution to what seems like a problem that has no solution. So fairies don’t need to fly in on wires like they would on a stage, especially as the term moved from plays to other forms of literature. The fairies just need to randomly show up, and poof! Conflict is gone. Is it just the author writing themselves into a corner and grabbing anything to stick in and fix the mess they created? Or was it a deliberate choice? In a lot of cases, there’s no way to tell… 

Minipracticum part 1

So, I had written quite a bit of this post intending to do a minipracticum at the end. But as I wrote, I realized I really needed an example to refer to so that I could show different elements of the deus ex machina. Instead of having my example unexpectedly show up at the climax of this post to solve the remaining problems neatly and without foreshadowing, I’ll plant the information here towards the beginning. What does planting mean? Oh, don’t worry, I’ll tell you… in a bit. 

It’s hard to show a deus ex machina in a short section of a story, so I’m going to give essentially a plot summary of a potential (very terrible) story. We’re doing a fantasy example because I love fantasy. By the way, I’ll be skipping over some parts that don’t matter. Here we go!

Magic died in the natural world along with all of the magical creatures centuries ago and only remains in the form of mana stones. But once a mana stone is used, its magic is burnt out and can never be restored. At first, people used mana stones freely, not realizing it was a nonrenewable resource. Soon, they realized the number was dwindling fast, and panic set it. People learned to live without magic, save for a few villages scattered across the kingdom who managed to preserve their mana stones, for a time, at least. Only a few mana stones remain when our story is set, and the evil King Bob is trying to gather all of them so that he and his heir are the only ones in the land capable of using magic, believing this will ensure that the throne remains in his family.

In a small village with several mana stones left, young Ralph shows promise for using them, since magic is tied to strong emotions and Ralph can get quite emotional. As a result, the stones remain in his possession. Naturally, Bob learns of the mana stones and sets out to claim them. The village elder refuses to part with them and Bob slaughters the village while Ralph is out with the village’s five mana stones. Bob starts a manhunt for him. Yada yada Ralph meets a group of scholars who are looking into how to revive mana stones. Their disciple Henry joins the party, yada yada at one point, they have to infiltrate the enemy’s encampment to get past it and are caught by Tina, an archer, but turns out she’s unhappy. Bob’s son nearly catches them, but she helps them slip through unseen and joins the party. 

Throughout the story, Ralph is forced to use magic twice. Each time, Henry examines the stone afterward, but there’s no hope. They keep the burnt out stones in Ralph’s left pocket, just in case. The remaining mana stones are in his right pocket. Tina uses her connections in the enemy army to keep tabs on their location, but soon, it becomes clear: King Bob knows where they are. The army is closing in on them as the story starts to ramp up, and then–oh no!–Henry steals the working mana stones to give to King Bob. Ralph’s right pocket is empty! It’s the darkest moment for Ralph and Tina, who are now cornered by an enemy army with no way to escape.

Ralph is helpless without his mana stones… and Tina is out of arrows. They’ve been backed onto the Eternal Cliffs that are said to have no bottom. King Bob is there with the two mana stones Henry gave him in the bitter betrayal. In fact, Henry is there too, looking sick to his stomach, along with King Bob’s son, who looks smug. Things are dire. Really, there seems to be no way at all to escape alive…

But wait! What’s that in the distance? The pounding of hooves… another army? No! It’s the unicorns! They charge through the enemy army, slaughtering countless enemies with their magical scimitar horns that paralyze anyone within 20 feet of them, immune to the spells King Bob casts because of their innate magical shields. Then they kill him too, and in moments, the entire army has been leveled, and Ralph and Tina are the only ones alive. The unicorns take off to wherever they came from.

What’s the problem with them?

A couple of thousand years ago that would be an amazing ending, I’m sure. Audiences loved a good deus ex machina. Over time, though, audiences have soured. Why? Well, I’ve come up with three big reasons, and I’ll use our wondrous example to demonstrate why.

Cheap escape

I hope we all agree that having magical creatures randomly show up for no apparent reason in a world that explicitly doesn’t have magical creatures and then those magical creatures kill all of the bad guys but not our heroes is a terrible ending. Convenient, though, isn’t it? I mean, you’ve wrapped up all of those pesky conflicts. Army defeated–now they can safely escape! Henry killed–take that, traitor! And, of course, King Bob gone–the kingdom is saved! And it was pretty easy to do. Yes, that one easy trick solved all your problems! Pat yourself on the back!

Actually, wait, before you do that, I do have one question: is that a good way to handle things? NO!!! Of course not! That’s the laziest thing you can possibly do! Seriously, you just invented something because you couldn’t be bothered figuring out how to get your characters out of a situation you put them into? If you’re a creator, you have to have the intelligence and foresight to prevent that kind of thing from happening in the first place! 

Seriously, I set up like five different ways that could have been resolved other than random magical creatures (and I’ll reveal the actual ending at the end of this post!). If you include various combinations of the setup I put into that, probably a lot more. All nice, logical things that would have grown naturally from the story. 

There are so many better ways to solve conflicts than some random thing that seems like the author threw a dart at a board of cliches and picked whatever it landed on. …Okay, the whole story was filled with clichés, I was feeling very lazy while writing that, but I was also poking a little fun at fantasy tropes. I was actually holding myself back quite a bit… I mean, I didn’t make Tina be King Bob’s daughter who was dressed as a soldier to escape an arranged marriage with the prince of another kingdom which has mana stones! And I didn’t have Tina secretly be the daughter of a foreign king informed she would be forced into marriage with Bob’s son, and now she was trying to infiltrate the camp to kill him! (Both were tempting). But I’m allowed to be lazy because this is just for my blogpost. If you’re creating something you expect people to read for reasons other than purely educational, you don’t want to be lazy.

Basically, a deus ex machina makes you look like one of two things: a lazy creator who can’t be bothered making an effort to use what’s already there to make a satisfying conclusion or a lazy creator who couldn’t be bothered setting up the story correctly in the first place. I mean, that’s what editing is for! Throwing in a deus ex machina looks like you just word-vomited and then didn’t bother going back to fix plot holes, so you whipped a rabbit out of a hat and figured no one would complain. Well, a unicorn, in this case. Not a good look at all. 

Though you would be in good company, I will say. Maybe you have a character or two in a terribly inhospitable place that’s currently exploding, but you don’t want them killed. Why not send some eagles to get them? No, we don’t need to establish that the eagles exist; I’m sure everyone has read the other books set in this world where they randomly show up to save the day, so people will know the eagles showing up is a thing!

Yeah, that continued to bother me about Lord of the Rings, mostly because there could have been so many cool, fascinating ways to get Sam and Frodo back to civilization alive that we’ll never know because Tolkien went with the deus ex machina (a presumably very well-reasoned choice on his part, as he’s far too good a writer to trap himself like that… but am I positive he didn’t just make a colossal mistake and not know how to fix it? No). 

But that isn’t the only problem.

Ruins expectations

Stories set up certain expectations, and the climax and ending are the payoff of those expectations. We as a society have certain expectations about how literature works, and one of those is that everything relevant to the resolution of the main conflict will have been introduced at some previous point. This is a very difference set of expectations than in Euripides’s era when deus ex machinas were part of the expectation. 

I’m going to talk in a little bit about how to avoid them in your writing, but we as a society expect that things from within the story will come together in an unusual way to create the solution to the primary conflict. Ideally, you want a solution that is surprising yet understandable; while the audience couldn’t have predicted things would play out the way they did, they can take every element of the solution and trace it backward to some previous point in the story. 

One of Vivian’s worldbuilding rules is that “the more central the cog is, the more it must be fleshed out.” In our case, a cog is anything involved in solving the central conflict, whether characters, action, setting, objects, emotions, anything. What the rule means, for our specific example, is that the things that are central to the conflict being solved have to be well-developed, and the more central they are, the more you’d better flesh them out throughout the story.

However, the opposite is also true: if something isn’t developed or fleshed out, it shouldn’t be important to solving the central conflict. Everything in the story needs to contribute to the story in some way, even if not in the conflict or plot. Some things might build the world or develop character, for example, and they might be developed for that purpose. But anything with little to no development shouldn’t be key to anything in the story or you risk a deus ex machina. 

When you develop a cog or element, you set up the expectation that it will be used in a meaningful way. Again, you might use things for other purposes, but if you don’t, if you have things hanging out there unused that seem like they should be used to solve the central conflict and then you use something random from outside the story, readers feel cheated and their expectations are shattered. I mean, why did you devote time to something if you’re not going to use it? What a waste. What a let down. In our example, why was so much of the story spent talking about mana stones and who has how many and how they’re used and their limitations if mana stones don’t play any role whatsoever in the climax? The reader will feel like you’ve totally wasted their time. Why would they ever trust you after that? 

Breaks trust

And that brings us to the final point: trust. You can betray your audience in quite a few ways, but a deus ex machina is one of the big ones. You’ve led them on the entire work, and then, when it’s time for everything to pay off, you tap out and pull in a god from a machine to do the work for you. So… did anything matter? It all got negated, after all. Let’s say this is a series. Why bother investing when you know none of it will matter when the chips are down?

Of course, if you have a fascinating world or great characters, people will keep engaging with your stories even after a deus ex machina–but they will never trust you again. They will lose all faith in your ability to deal with conflicts. They will expect you to bullshit your way through any difficulties. They might enjoy your world, your characters, and minor parts of your plot, but they won’t trust you to handle the plot and certainly won’t trust you at the climax of the story. 

And if you have a second deus ex machina? Yeah, now you’ve nailed yourself into that coffin neatly, haven’t you? When your audience talks about your stories, they might get animated talking about certain aspects, but then their voices will fall, the joy in their eyes dim, and they’ll quietly ask each other what they thought of the end, and all of them will sigh and lose all enthusiasm. Or they’ll mock you. 

Bad creators have their place in art, and bad works of art can become cult classics. So you’re not necessarily doomed if your go-to move is to call in the unicorns and you’re not going for humor. Have good authors used deus ex machinas and still be considered great? Yes. Tolkien has an annoying habit of calling in the eagles, after all. But it’s only a deus ex machina the first time it happens (whatever book that is for you). After that, there’s an awareness that they exist and have the potential to do this. And honestly, if you look at how he does it, he actually does a good job establishing that the eagles have a role in the world, even if they’re just now showing up. It’s unlikely you’ll get the same consideration.

So respect your audience, and work to keep their trust by working with the entire story to create a cohesive world that resolves conflicts in a surprising but natural way.

Do they ever work?

Surprisingly, yes! But in very limited circumstances. First would be to go back a couple of thousand years, but that’s probably not happening. The other place where it works well is comedy and parody. We may not find the character of Euripides showing up to resolve the conflict funny because we don’t understand the cultural context of that particular deus ex machina, but we do know what they are and can recognize them. And if you bring one in as a tongue-in-cheek solution, it can work pretty well. They’re often so absurd to our modern sensibilities that they’re laughable. So, if you’re going for parody or humor, yeah, why not throw one in?

Other than that, though, I would say that if a deus ex machina works, it’s because it isn’t actually a deus ex machina. By which I mean that if you have something that seems to come from nowhere at the climax to resolve things and it works really well, I can almost guarantee that it didn’t actually come from nowhere. The buildup was likely indirect, but the possibility for the solution existed, so it didn’t come from nowhere. And as you recall from our definition, if there’s any foreshadowing, it ain’t deus ex machina.

How do I avoid them?

Basically, you avoid them through foreshadowing. There are two key ways you can foreshadow things, and I’m using terminology from the video games studies resources I use in my classes. There are other terms for this, but the principles are the same, and really, there’s one driving principle behind all of it.

You’ve probably heard of Chekhov’s gun, and if you haven’t, well, you’re about to learn, because it’s essential in understanding modern storytelling. Basically, Chekhov’s gun is a narrative principle that says that everything in a story must be relevant, and anything irrelevant should be removed. Sound familiar? Yup, it’s very similar to Vivian’s rule. That’s because it’s a basic principle that all modern stories should follow.

Now, you may be thinking to yourself, “A gun? Where the **** does that come from?” To which I would say that “heck” is hardly worth censoring but Vivian got overzealous there. More importantly, though, to answer your question, Chekhov’s gun means that if a gun is introduced in the first act, it must fire before the end of the story. See how that relates?

Planting

Chekhov’s gun is essential is what is known as planting, where you basically plant the seeds of the narrative devices that will become important later in the story. You show them, briefly, usually in a different context than they’ll be used in when they become important later. Often, their use later is a surprise, but not always. Sometimes it carries a sense of inevitability, which can be just as satisfying for audiences.

However, and this is key, if you want to avoid a deus ex machina, plant the major elements early in the story. You don’t have to do anything else. In our story, instead of definitively saying that all magical creatures died centuries ago. Say legend says that, or it’s believed that, and then in the story itself, show a sign of unicorns, whether it’s a hoof print that Henry says resembles a unicorn’s hoove or a story told by the town drunk about seeing one–she swears it was a real unicorn!–as they venture forth on their journey. Adding that ambiguity at the start and then planting one single hint that unicorns exist is generally enough. 

Well, in this case, you’d actually also have to plant something about the abilities that unicorns have, so let’s make it something where they run into a bard who sings a song about unicorns and their magical abilities. But now we’re getting into seeding, the next technique. 

Just to make sure it’s clear, planting is when you plant the seeds of an idea that will be needed later. It’s the gun in the first act that will be fired in the third. It’s essential to plant it, and if it’s not going to be needed? It’s equally essential NOT to plant it.

Seeding

Seeding and planting have their similarities, but also have one key difference. Planting is one instance, one show of the gun. Seeding is when you continue giving hints and glimpses of the things that will be important throughout the story. Instead of a single hoofprint, now we’re getting a hoofprint towards the beginning, then the bard a little later, then the drunk’s story, each one adding just a little more information and validity to the idea that unicorns really do exist so that when they appear at the end, it’s something that could be predicted. 

Why would you want to keep bringing up mentions? Why would you want to make it predictable? Well, for starters, audiences like it, especially if you’re clever about it. Think about mysteries. Yes, you can tell the killer from the initial crime scene if you’re good (or if you’ve read a million books by that author), but the real fun is in trying to pick up clues after that and piece together the killer based not only on the crime scene but people’s subsequent actions. Little clues as to the killer’s identity are seeded throughout the story so that when the killer is revealed, the audience goes “Ohhhh I see now!” as all of the pieces fall into place. 

This is also important for longer books or series. In my Imperial Saga, I have a couple of things that I know will be relevant in the grand climax at the end of the final book, the fifth book. However, I don’t want it to be a deus ex machina. So I plant it in the first book, and it’s really just one significant mention and I leave it at that for that book. In the second, third, and fourth books, I carefully seed it, giving a couple of references per book just so the reader doesn’t forget. It’s more important in some books than others, but I don’t want the audience to forget about it completely. There are actually two things in this category, one that’s easier to include than the other but both equally important in making sure the big moment feels natural and not like a deus ex machina.

Now, just like with planting, the principle of Chekhov’s gun applies: if it’s important, it has to be introduced early. If it isn’t important, DON’T INCLUDE IT. Your story should only include things that are relevant in some way. Now, as I said above, not everything needs to be used in the climax of the story. They could be used in smaller conflicts along the way, whether interpersonal, internal, external, etc. The principle is just that if you introduce something, you have to use it later on. We’re talking about the climax here because that’s usually where you see deus ex machinas, but honestly, they can show up anywhere if things aren’t planted or seeded correctly.

Minipracticum part 2

So we’re geniuses now, right? We would never do a deus ex machina in a modern story. Everything that’s introduced has to be relevant. So let’s look back at our story from the beginning, and let’s reset. Get rid of those ridiculous unicorns; they no longer exist, exactly as the opening says. We’ll go back to right before that. Here’s where we are, and then we’ll continue on to the true ending as I envisioned it while writing:

Ralph is helpless without his mana stones… and Tina is out of arrows. They’ve been backed onto the Eternal Cliffs that are said to have no bottom. King Bob is there with the two mana stones Henry gave him in the bitter betrayal. In fact, Henry is there too, looking sick to his stomach, along with King Bob’s son, who looks smug. Things are dire. Really, there seems to be no way at all to escape alive…

Suddenly, Henry shouts that King Bob has two stones. Two… two? There should be three for a total of five. Ralph reaches into his left pocket and feels the warmth of a living mana stone. He grabs it and focuses on bursting the ground between him and the king, ending in an explosion that will kill the king–but King Bob grabs Henry and presses a knife to his throat, holding Henry between him and Ralph, and Ralph’s resolve fades. The spell ends before it reaches Bob and Henry, and the mana stone grows cold. 

Bob smirks, then slits Henry’s throat. Ralph screams, emotions swirling within him, and then the empty mana stones in his pocket burst to life from the force of his emotional response. Bob’s son gasps and starts pushing his way through the soldiers to get away. Furious, raging, grief-stricken, Ralph walks down the broken earth towards King Bob, ignoring the army around him, eyes locked on Bob, who only now realizes something is very wrong. The army rains down arrows, but a magic shield stops them, and King Bob gasps as Ralph pulls out the mana stones, now glowing white-hot with Ralph’s emotions. 

King Bob drops Henry’s body and scrambles backward but finds himself walled in by air. Ralph falls to his knees next to Henry, regretting thinking for even a moment that Henry had betrayed him, then meets King Bob’s gaze as the walls of air slam inward and crush Bob into nothingness. 

The army roars, but Tina holds out her hands and calls to the soldiers to listen to her. Two of the generals at the front are her contacts, and they hold everyone back. They form an escort for her and Ralph, but when other enemies see this, they turn on the generals. Chaos breaks out, and Tina has to pull the distraught Ralph to safety, getting in a few well-placed hits along the way. Once alone, they mourn. As Ralph’s emotional state calms, the mana stones fade, then cool, then go back to their burnt-out state. 

Chaos reigns as Bob’s son returns and tries to take command, but everyone remembers his cowardly flight, and many refuse to follow any son of Bob. Divided, the army can’t settle on any leader except the one person who could get different generals to unite on something: Tina. They send word. 

Meanwhile, Tina leads Ralph to her home, the only place she knows that’s safe. On the way, they run into the scholars from the beginning and have to tell them about Henry, a loss tempered by the mystery of how the mana stones were temporarily revived. Ralph returns the stones he has and agrees to keep in touch. Right as they reach their destination, word arrives from the army requesting Tina lead them as queen. Ralph insists she answer the call, and she heads off to her destiny as Ralph prepares for the quiet life he always wanted.

Why is that an infinitely better ending than the other?

Please tell me you like it better… I had way more fun writing it, at the very least! One reason it was more fun, and one reason it’s better than unicorns, is that I got to find a way to fit in every single thing from the opening into this ending. You can go back and check. I’m almost positive I got everything. There is nothing introduced in the first scene (ignoring the unicorns) that I don’t refer to or use in the final scene there. 

Some of it feels natural. Obviously the mana stones were going to play a role, and I spent so much time on the idea of bringing them back to life (there’s a whole character dedicated to that!) that you had to have known that would happen. The way it happened? Well, at the beginning, I said that magic was associated with strong emotions and Ralph was very emotional. So of course it’s emotion that brings them back. 

If I hadn’t used the mana stones in the climax, it might have led to a cheap escape, though not always, but it certainly would have ruined expectations and broken trust. The story led us to believe they would be important. So much time was dedicated to them! And then, if you don’t use them? What a complete waste. The audience’s expectations of some exciting magical finish are dashed, and they’re left disappointed and frustrated. Their trust in your ability to tell a story is gone. Why would they want to consume a story by you if you waste so much of their time?

Now, it is possible to plant something like mana stones that won’t be used until later in the series, but you have to plant it only! I mean, it wasn’t even seeding; mana stones were the driving force of the story and the impetus for almost every major plot point! 

That’s the mana stones angle, because those are the biggest elements in the story that are essential to use. Is it surprising that the mana stones are used? No. Is it surprising that they somehow come back to life? Not really. Those things don’t need to be a surprise because there is one more question: Is the way the mana stones are used and come back to life surprising? And to that, the answer is yes. True, you can trace it all back and put the pieces together, which is good. But when the audience is caught up in the climax, Henry’s death will be a shock, and that triggering Ralph and the mana stones is an unexpected and dramatic way to fulfill the promise of Chekhov’s mana stones. 

So yeah, you can do that with pretty much every single sentence of that ending. You can find traces of it earlier. Now, I’m not saying the execution is the best. Honestly, I kinda threw Bob’s son in after I’d written everything else because I wanted there to be someone claiming the throne at the end, but the armies turn to Tina instead. So if he seems thrown in ad hoc… yeah, he was. He doesn’t even get a name! BUT! He is introduced early on and presumably shows up elsewhere, but even if he doesn’t, we know he exists before we get to the ending. 

If you see anything I missed in the introduction or anything in the final scene that doesn’t seem to come from anything, please let me know in the comments! I’m not perfect, and this was written pretty rapidly, so it hasn’t been edited as thoroughly as I edit the stories I publish. 

Summa Summarum

So, what have we learned from all of this? Basically, unless you’re writing for an audience that’s been dead for two thousand years, don’t have things swoop in to save the day unless you’ve either planted their existence or else seeded it throughout the story. If you foreshadow the god from the machine in any way, it shifts from a cheap escape to a clever way to tie everything together. 

Good luck, and make sure to have fun pulling together your various elements into a climax that satisfies your audience and yourself, too!


Want to dive into a discussion about Stellima or the art of writing on Discord? We’d love to have you! And if you have any topics you struggle with or that you would like to suggest for a future blogpost, we’re open to suggestions!

Interested in supporting our work? Join our Patreon and become a part of Stellima as a citizen of Mjatreonn! Or would you like to give us some caffeine to fuel our writing? Consider buying us a coffee at Ko-fi! Every contribution inspires our creativity and keeps us going. Thank you for your support!

Copyright ©️ 2025 Anne Winchell. Original ideas belong to the respective authors. Generic concepts such as foreshadowing, planting, and seeding are copyrighted under Creative Commons with attribution, and any derivatives must also be Creative Commons. However, specific ideas such as the story in the minipracticum and all language or exact phrasing are individually copyrighted by the respective authors. Contact them for information on usage and questions if uncertain what falls under Creative Commons. We’re almost always happy to give permission. Please contact the authors through this website’s contact page.

We at Stellima value human creativity but are exploring ways AI can be ethically used. Please read our policy on AI and know that every word in the blog is written and edited by humans or aliens.

Anne Winchell

Recovering MFA graduate specializing in fantasy, scifi, and romance shenanigans.

https://www.annewinchell.com
Previous
Previous

Worldbuilding 203: Martyrs

Next
Next

Worldbuilding 205: Assimilation