In this guide, you will learn a set of monster AI rules for solo DnD encounters. The core idea is simple: the monster uses a simple priority system to choose an appropriate action and the right target. Once the enemy ability and target have been selected, combat resolves as per D&D rules. When I designed this system, I looked at three board games for inspiration: Gloomhaven, Middara, and Dungeon of the Mad Mage. I adjusted their AI rules so that you can use them with D&D 5e.
Monster AI action priorities
During the monster’s turn, the monster prioritizes its actions from highest to lowest as follows:
- Making saving throws and removing conditions.
- Lair actions (if within a lair).
- Defensive spells on self (if needed), followed by offensive spells against enemies.
- Special abilities such as summonings, eye beams, and other special attacks.
- Ranged weapon attacks until the enemy enters melee range.
- Melee attacks until the opponent leaves melee range.
When it’s an opponent’s turn, the monster prioritizes:
- Legendary actions, followed by reactions.
Monster AI rules during combat
- When it’s the monster’s turn, it targets the PC party member closest to it. If there are two or more targets within the same distance, choose the one with the highest initiative.
- Choose an attack based on the actions available to the monster and which of its actions have the highest priority. If there there are two or more actions with the same priority, choose one at random.
- Move the monster towards the target until it’s within the range of the attack.
- Roll the appropriate dice for the attack.
Choosing attacks and targets randomly with dice rolls
A player can randomly select a monster attack by assigning a number to each action and rolling the appropriately numbered die. Standard dice are the typical d4, d6, d8, d10, d12, and d20. However, to select a random attack or target, you can use dice that also cover other numbers such as d2, d3, and d5.
These are non-standard dice that use a pre-existing die, but with a simple formula. To roll 1d2, roll a d4, divide the result by 2, and round it up. To roll 1d3 and 1d5 you use the same formula but use a d6 and d10 respectively.
Important Monster AI rules
- Monsters always target the closest opponent. If a monster has more than one target, it will prioritize the opponent with the highest initiative.
- Monsters do not attack invisible or stealthed characters if they’re successfully hidden.
- Monsters stop attacking characters that have been reduced to 0 health points.
- If a monster needs to make a saving throw, break a spell effect, or remove a condition, it will prioritize it first before everything else.
- Monsters will always try to establish a line of sight when making a ranged attack against an opponent.
- Monsters with ranged attacks move until an opponent is within the range of their attack. If the opponent is already within range, discard any movement actions unless the attack requires line of sight.
- Monsters with ranged attacks will attempt to hide behind the closest terrain feature that provides cover after completing their actions.
- Monsters always seek to avoid visible traps and dangerous terrain. They will move around such threats during combat.