Final Fantasy Wiki
Relm: I couldn't miss the chance to practice my drawing!
This article is in need of a few pictures. Perhaps you can help by uploading a picture of the overflow happening.

Damage overflow is a glitch in Final Fantasy V. It is an instance of the more general overflow glitch present in various games. When triggered by a command, it results in a noticeable reduction in the damage output for that command.

The basics[]

Hardware limitations in the Super Nintendo Entertainment System (namely, its 16-bit architecture) force Final Fantasy V to treat all values in the damage formulas as 16-bit integers. Trivially, any number whose binary representation requires more than 16 bits cannot be stored in a 16-bit register. All most significant bits above the limit are discarded. When unsigned values are used (which is always the case for damage calculation), 16-bit registers can only contain values in the [0, 65535] range (both inclusive). Subsequent versions of the game retain such behavior.

An overflow is triggered whenever any step in the damage calculation for a given command is supposed to produce a number greater than 65535. In our case, discarding the most significant bits is mathematically equivalent to reduce modulo 65536 (i.e., taking the remainder of the division by 65536).

How to trigger[]

Values larger than 65535 are generally hard to reach during damage calculation. The simplest method involves a high level character with strength and agility boosted via Sinewy Etude and Swift Song unleashing Sword Dance with a fully powered Chicken Knife against a target with very low physical defense.

With a maxed-out Chicken Knife[]

Consider a level 99 attacker whose strength and agility have been boosted to 99, and a target with 30 defense. When using Dance with a fully powered (127 attack) Chicken Knife, if Sword Dance is triggered, the damage is calculated as follows (see the Chicken Knife damage formula and the Sword Dance modifiers for further details):

where SDAM and SDMM (both equal to 2) represent the Sword Dance modifiers. Filling in the actual values, the formula becomes:

As the final result is greater than 65535, a reduction modulo 65536 forces the actual damage to become 3456, significantly lower than expected.

With a double gripped weapon[]

Alternatively, it is possible to trigger a damage overflow by using Sword Dance with a double gripped weapon with at least 106 attack against an opponent with 0 defense. Many weapons compatible with the Two-Handed ability share the same damage formula:

When using Sword Dance with a double gripped weapon, the formula becomes:

where DWM (equal to 2) represents the double grip modifier to M. Assuming the target's defense is equal to 0, and the random roll produces the lowest possible value (i.e., 0), the formula after filling in the values becomes:

From there, it is possible to determine the lowest Atk value that triggers the overflow as follows:

where / is a regular division (i.e, not an integer division), and ceil() is the ceiling function.

Unnoticeable overflow[]

Sometimes, due to the 9999 damage ceiling, the damage overflow might not be noticed. For instance, in the Chicken Knife scenario, if the target defense were 0, the damage formula would become:

When reduced modulo 65536, 78232 becomes 12696, which is still above the damage ceiling. As such, the attack will deal 9999 damage as if no overflow happened.