AI Manipulation Guide
Detailed explanations of how the AI behaves in FE12.
Introduction
FE12 is often cited as being a highly player phase focused game, and it definitely is. The enemy density is low and the enemy quality is high, so it's in the player's interest to get as much done during player phase as possible before giving the powerful enemies a chance to move.
Despite the player phase focused nature of the game, the most important part of efficient play on higher difficulties is being able to reliably survive enemy phases without turtling. Enemies in this game can be truly terrifying - in Lunatic and above, they all have A weapon ranks with Silver weapons along with 10 bonus hit. That means the majority of your army will have difficulty surviving even two hits, and dodging is out of the question for the most part.
Without understanding how the AI behaves, the only way to complete a lot of chapters reliably is to turtle. FE12 is well known for having predictable AI, but it goes even further than that. The AI has been solved to the point where no enemy action will be a surprise to anyone that has read this guide. To me, playing around the game's AI is the defining characteristic of this game, and taking enemy actions into account leads to a fun strategic experience.
Guide Contents
This guide contains the following information.
Expected Damage
How much damage the AI thinks it can deal.
Damage Hungry Enemies
The easiest way to think about FE12 enemies is that they love dealing damage. There is almost no circumstance where they care about taking return damage. Like most Fire Emblem games, the formula for damage is the following.
\(Dmg = Atk_{attacker} - (Def_{target} \parallel Res_{target})\)If the AI were very optimistic, it would assume that every attack lands regardless of hit rate and base its decisions around the above damage formula at face value. Of course Fire Emblem is an RNG based game, and hence it wouldn't be very realistic to think that way.
That's where the concept of expected damage comes in. Expected damage can be defined as the amount of the damage that the AI thinks it can deal to a given player unit. The formula for expected damage will change depending on where it's used in the AI algorithm, but it's pretty much always some function of damage, hit, and crit. Note that despite FE12 using a 2RN true hit system, the AI always uses displayed hit for expected damage calculations.
The remainder of this guide will explain how expected damage is used to make AI decisions, and refer to it as \(E(x)\).
Enemy Movement Order
The order in which enemies move.
Movement Order
Predicting enemy movement order has always been an important part of AI manipulation. Since Fire Emblem doesn't allow multiple units to stand on the same tile (aside from backpacking mechanics like Pair Up), taking advantage of enemy movement order is very helpful for making the enemy get in its own way.
Action Phases
The AI will group enemy movements into three distinct action phases that always happen in the same order. These action phases are, in order:
- Lethal attacks
- Non-lethal attacks
- Moves that are not attacks
So that means if that the AI sees that it can kill one of your units with an attack, that attack will always happen before other attacks that cannot kill your units. It also means that the AI will always make all attacks before moving enemies that don't have any targets to attack.
Lethal Attacks
Testing a theory, but I'll talk about expected damage here (crit chance, etc)...
Non-Lethal Attacks
Non lethal attacks are very simple, it's just all attacks that were not deemed as lethal in the first step.
The important thing to understand here is that lethal/non-lethal attack categorization happens at the very beginning of the enemy phase. A non-lethal attack cannot turn into a lethal attack halfway through an enemy phase.
For example if a player unit is in range of two enemies who can combine for a kill, both of those enemy attacks will be categorized as non-lethal. After the first enemy attacks, the second enemy will not be considered a lethal attack and happen immediately, the game will not restart the lethal attacks action phase if suddenly a new lethal attack has opened up. That second enemy will have to wait for its turn to move in accordance with enemy unit action ordering, which is explained below.
Enemy Unit Action Ordering
Enemies within the same action phase follow a very predictable pattern. They will act in ascending order of movement stat, where the tiebreaker between units of the same movement is deployment order. Enemy deployment order can be easily determined by L-switching starting from the boss, since the boss is always the first deployed unit on a map.
For example, if an enemy Archer and an enemy Dracoknight can both kill player units, the Archer will make their lethal attack first because it only has 5 movement compared to the Dracoknight's 10. After the lethal attacks have all been made, it will move on to non-lethal attacks, starting again from lowest movement units first. After those attacks, the AI will make all non-attacking moves, once again starting from the lowest movement units.
This concept can be clearly seen during the below Chapter 8 enemy phase.
The action phases are split as follows.
Lethal attacks
- 8 move Hero attacks Sirius, deemed lethal due to crit chance
- 10 move Paladin attacks Arran, deemed lethal due to Killer Lance crit chance
Non-lethal attacks
- 5 move Knight (Roger)
- 6 move Generals attack Kris
Non-attacking moves
- 6 move Generals that were aggro'd by Kris
- 7 move Thief trying to escape
- 8 move Heroes that were aggro'd by Sirius
- 10 move Paladins - these enemies were categorized as non-lethal attacks initially, but were blocked by Roger and the Killer Lance Paladin who moved before