Site Tools


secret_boss

This is an old revision of the document!


The FF4 Battle System

Damage Calculation.

Refer to The algorithms guide for more details on the exact calculations. Most of this information is referenced from here.
Refer to The magic guide for details about spells
Refer to FF4 Enemy Stats for enemy statistics, such as attack, defense, resistances, weaknesses, race, etc.
Refer to The FF4 equipment Doc for weapon/armor stats.

Physical Damage

Damage in FF4 is handled in a couple steps, the first is calculating the damage per hit, and the second is calculating the number of times your character hits. Lets start with the damage per hit calculation first…

Damage Per Hit

Base damage for most characters is Weapon Base + Str/4 + Level/4
Bows, yang and edge follow slightly different formulas, but regardless, this value is the value shown in the game menu. More details in the algorithms guide.

Base damage is modified depending on various status effects and conditions, such as critical hits, berserk status, using the jump command, hitting elemental/racial weaknesses, etc.
Example, hitting a mage enemy with a mage killing weapon does increases base damage by 4x.
The algorithm guide explains these numbers in detail, with the only addendum I see is the section about certain weapons preventing critical hits, Aexoden has discovered this was related to certain cutscenes, not weapons, and at least for FF4FE should never be a problem.

After all these modifiers, you are left with an attack value, which is then multiplied by a random number between 1 and 1.5, and then defense is subtracted. Note the multiplication is before the subtraction, which is why sometimes you can get hit for 1 damage, then the next hit deals several hundred.

Its also important to note that defense is doubled if the target is in the back row, including enemy targets. An enemy is backrow if the “frontmost” enemy sprite does not vertically share any space with target. The backrow bit does not affect this defense doubling.

This end result is the amount of damage per hit. Now we just need to calculate how many hits land…

Number of hits

Each character has an attack multiplier, and an accuracy value.
The number of attack multipliers is equal to Str/8 +Agi/16 +1.
Accuracy is weapon base accuracy + level/4.

Several things effect accuracy as well, most notably being in the back row. If you don’t have the backrow bit set, attacking from the back row halves accuracy, and if your target is in the backrow, accuracy is also halved. This means accuracy can be 1/4th its value if both conditions are active.

For each attack multiplier, a random number is rolled, and based on accuracy its determined if it hits or not. So for 10 attacks with 80% accuracy, about 8 of them should hit, though this could be more or less.

However there is a chance for evading attacks. Enemies are bugged such that evasion doesn’t work unless set by their script, which to my knowledge is only used by kainazzo and valvalis. For those 2 and your party members however, you have an evade % and evade multipliers, and these are rolled to reduce the number of hits that land. For example, in some locations in the FE randomizer, valvalis has 4 evasions at 90%. This means you need 5 hits to land to realistically have any chance of hitting val, and even then the damage will be low.

Finally, once the number of landed hits is calculated, this is multiplied by the damage per hit, and you have your final damage.

Extra Notes

Backrow

The backrow bit is the games flag for using a long range weapon. No enemies have this bit, and for the SNES version of FF4, once the bit is set, it can’t be removed. This means if you equip a backrow weapon, such as the dwarf axe, then you don’t lose accuracy for being in the backrow for the rest of the game.
For people who can weapons in both hands, equipping the backrow weapon in the right hand will ensure they get the glitch, you don’t need to equip in both, only the right. Bows don’t care which way they are equipped for the glitch (though there is a damage penalty for equipping the bow in the primary hand).

Yang and Edge Accuracy

For yang and edge who can equip weapons in both hands, weapon accuracy is also the average of the two weapons equipped. So a charm claw + catclaw yang would have ( 50%+99% )/2 , or 75% accuracy. If only the catclaw was equipped though, its accuracy would be used, or 99%.

===The Middle Slot Another significant modifier for accuracy is character in the middle slot has their accuracy increased by 5/4. So if someone with 50% accuracy was in the middle slot, this would become 62.5% accuracy. this applies to spells as well.

Magic Damage

Magic damage is handled much the same as physical damage is, except spell power is drawn from a table. Refer to Magic Guide, for the base power of every spell. This is also modified by resistances and stuff, much the same as physical attacks. Refer to the algorithm guide for a complete list of spell power modifiers.

Accuracy and spell attack modifiers are also handled similar to physical system.
White magic multipliers are Will/4+1
All other magic Multipliers are Wisdom/4+1.
Note some spells only use a solo multiplier (such as the weak spell, or life spell). The magic guide lists this attribute on the spells.

Spell accuracy is the base spell accuracy+ wisdom or willpower/2 (based on magic type)

Just like physical damage, spell damage per hit is spell power after modifiers, times random number between 1 and 1.5, minus magic defense.

Enemies are bugged such that magic evasion is never applied, but for characters you can calculate the magic evade based on stats and equipment, and magic evade multipliers based on stats.

Note that if magic defense equals 255, all spells automatically miss (valvalis and some dark elf enemies).

secret_boss.1578640326.txt.gz · Last modified: 2020/01/10 08:12 (external edit)