                            Final Fantasy III (VI)
                             Algorithms FAQ V 1.2

                                      By

                       Terii Senshi (teriisenshi@aol.com)

*****************
Table of Contents
*****************

1.0 Introduction

2.0 Basic Algorithms
   2.1 Physical damage calculation
   2.2 Magic damage calculation
   2.3 Random encounters
   2.4 Chance to hit

3.0 Weapons
   3.1 Atma Weapon
   3.2 Dice
   3.3 Fixed Dice
   3.4 Thief Knife
   3.5 Valiant Knife

4.0 Relics
   4.1  Atlas Armlet
   4.2  Charm Bangle
   4.3  Coin Toss
   4.4  Cure Ring
   4.5  Earrings
   4.6  Gauntlet
   4.7  Hero Ring
   4.8  Hyper Wrist
   4.9  Sneak Ring
   4.10 Tintinabar

5.0 Commands
   5.1 GP Rain
   5.2 Steal
   5.3 Throw

6.0 Spells
   6.1 Metamorph
   6.3 Regen

7.0 Credits/Acknowledgements


Version Changes:

1.2 Added chance to hit calculation, steal command, sneak ring, and metamorph.
Changed the layout slightly

1.1 Added a 100% accurate physical damage formula. Fixed a few other errors

1.0 The original version.


******************
 1.0 Introduction
******************

These FAQ explains how the algorithms and calculations for Final Fantasy III
work. It contains details on how damage is calculated, how random encounters
are determined, as well as how other items and things work. It's not meant to
be comprehensive, but simply contains things have been figured out so far. 

A few explanations about notation:
[A..B] is random number between A and B, so [1..6] would be a random number
1, 2, 3, 4, 5, or 6.

Trunc(x) is x rounded down to the nearest integer, so trunc(1) = 1,
trunc(2.4) = 2, and trunc (6.9) = 6.

Ceil(x) is x rounded up to the nearest integer, so ceil(1) = 1
ceil(2.4) = 3, and ceil(6.9) = 7.

NOTE: All divisions done in all calculations are integer division. This means
the result after the division is trucnated (rounded down), so (4 / 2) = 2,
(8 / 3) = 2, and ((17 / 2) / 5) = (8 / 5) = 1.


                            **********************
                             2.0 Basic Algorithms
                            **********************

*********************************
 2.1 Physical damage calculation
*********************************

This formula is used for standard attacks, and some special attacks that
use Vigor instead of Magic Power.

1. If Vigor * 2 is 255 or over, then set Vigor * 2 to 255 (this is not a
   permanent change it only counts for purposes of figuring damage)


2. Figure Maximum Damage:

   Attack = Battle Power + Vigor * 2

   Damage = Battle Power + ((Level * Level * Attack) / 256)) * 3 / 2

   Monsters work differently:

   Vigor = [58..64]

   Damage = Level * Level * (Battle Power * 4 + Vigor) / 256


3. If in back row, then damage = damage / 2


4. Defense calculation:

   If attack is defense ignoring, then skip this step.

   damage = damage * ((255 - Defense) / 256)


5. Random Variance:

   Multiply damage by [224..255] / 256


6. if damage < 1024 then damage = damage + 1


7. If target is in back row, then damage = damage / 2


8. Self Damage

   Monsters skip this step.

   If attacking self (or other party member) damage = damage / 2


9. Elemental calculation

   If target is weak vs. element, then damage = damage * 2
   If target is strong vs. elements, then damage = damage / 2
   If target is resistant to element, then damage = 0
   If target absorbs element, then damage is unchanged, but damage is added
   to HP rather than subtracted


******************************
 2.2 Magic damage calculation
******************************

This formula is used for almost all special attacks, and spells.

1. Figure Maximum Damage:

   Maximum Damage = Spell Power * 4 +( Level * Magic Power * Spell Power / 32)


2. Multiple Targets:

   Some spells skip this step

   If spell is targeting multiple targets then damage = damage / 2


3. Defense calculation:

   If attack is defense ignoring, then skip this step.

   damage = damage * ((255 - Magic Defense) / 256)


4. Random Variance:

   Multiply damage by [224..255] / 256


5. if damage < 1024 then damage = damage + 1


6. Self Damage

   Monsters skip this step.

   If attacking self (or other party member) damage = damage / 2


7. Elemental calculation

   If target is weak vs. element, then damage = damage * 2
   If target is strong vs. elements, then damage = damage / 2
   If target is resistant to element, then damage = 0
   If target absorbs element, then damage is unchanged, but damage is added
   to HP rather than subtracted


***********************
 2.3 Random Encounters
***********************

The game keeps a counter that increases each time you take a step. Each step
a random number is picked from 0 to 65535, if this number is less than the
counter than a fight occurs. When a random encounter occurs the counter is
reset to 0. If the lead party member has a Charm Bangle equipped, then the
number added is cut in half.

Values added to counter by terrain:

Terrain  Value
Caves    112
Grass    96
Desert   192
Forest   192
Snow     112
Town     112
Mountain 112


*******************
 2.4 Chance to Hit
*******************

NOTE: Because of a bug in the game, Mblock determines whether both magical or
physical attacks hit. Evade does nothing.

1. HitValue = (255 - MBlock * 2) + 1

2. If HitValue > 255 then HitValue = 255
   If HitValue < 1 then HitValue = 1

3. If ((Hit Rate * HitValue) / 256) >= [0..99] then you hit, otherwise you miss.


                                *************
                                 3.0 Weapons
                                *************

******************
 3.1 Atma Weapon:
******************

Deals damage as normal weapon with the following exceptions:

Between steps 2 and 3 of the physical damage calculation:

2.1 damage = damage * level / 64
2.2 damage = damage * ((current HP / 256) + 1) / ((max HP / 256) + 1)

Is defense ignoring, so it skips step 4 (defense calculation).

Is NOT unblockable


***********
 3.2 Dice:
***********

damage = Dice Roll 1 * Dice Roll 2 * Level * 2

Skips all normal steps for physical damage calculation.
Ignores M. Block (is unblockable)


*****************
 3.3 Fixed Dice:
*****************

damage = Dice Roll 1 * Dice Roll 2 * Dice Roll 3 * Level * 2

if all Dice Rolls are the same then:

damage = damage * Dice Roll

Skips all normal steps for physical damage calculation.
Ignores M. Block (is unblockable)

*****************
 3.4 Thief Knife
*****************

Has a 50% chance of attempting to steal as well as dealing it's normal damage.

********************
 3.5 Valiant Knife:
********************

Deals damage as normal weapon with the following exceptions:

Between steps 2 and 3 of the physical damage calculation:

2.1 damage = damage + (Max HP - Current HP)

Is defense ignoring, so it skips step 4 (defense calculation).

Is NOT unblockable


                                 ************
                                  4.0 Relics
                                 ************

******************
 4.1 Atlas Armlet
******************

Between steps 2 and 3 of the physical damage calculation:

2.1 damage = damage * 5 / 4

If you have 2 equipped it has the same effect as only having one equipped


******************
 4.2 Charm Bangle
******************

Decreases amount of random encounters by 25%. See random encounters (2.3) for
more information.


****************
 4.3 Coin Toss
****************

See GP Rain (5.1)


****************
 4.4 Cure Ring:
****************

Max HP Gained = (Max HP * stamina / 1024) + 2 (if this value is greater than
255 it is set to 255)
HP Gained = Max HP Gained * ([224..255]) / 256

Regen spell works the same way


**************
 4.5 Earrings
**************

Between steps 1 and 2 of the magic damage calculation:

1.1 damage = damage * 5 / 4

If you have 2 equipped then:

1.1 damage = damage * 3 / 2


***************
 4.6 Gauntlet:
***************

Between steps 1 and 2 of the physical damage calculation:

1.1 Attack = Attack + (Battle Power / 2) + ((Battle Power / 2) / 2)


***************
 4.7 Hero Ring
***************

Has the exact same effect as an Atlas Armlet and Earrings combined. This means
the effect is cumulative for magic damage, but not physical damage.


*****************
 4.8 Hyper Wrist
*****************

Increases Vigor by 50%. Note: because of step 1 in physical damage calculation
increasing vigor over 128 is worthless.


*****************
 4.9 Sneak Ring
*****************

Doubles your chance of succesfully stealing. Does not affect the chance of
getting a rare item instead of a common item.

See Steal (5.3) for more information.


*****************
 4.10 Tintinabar:
*****************

HP gained per step = Level * Stamina / 128


                                **************
                                 5.0 Commands
                                **************

**************
 5.1 GP Rain:
**************

Damage = Level * 60 / # of enemies hit
Gold Used = Level * 30


************
 5.2 Throw:
************

Deals damage as a normal physical attack with these exceptions:

After step 2:

2.1 damage = damage * 2

Is defense ignoring (skips step 4)

Ignores row (steps 3 and 8)

Is Unblockable

The Battle Power used is the Battle Power of the thrown weapon. The elemental
property of the weapon counts, but all other special properties of the thrown
weapon are ignored.


***********
 5.3 Steal
***********

1 .If monster has no items then you automatically fail to steal

2. StealValue = Your level + 50 - monster's level

3. If StealValue <= 0 then you fail to steal

4. If StealValue >= 128 then you automatically steal (skip steps 5 and 6)

5. If you have a Sneak Ring equipped:
      StealValue = StealValue * 2

6. If StealValue <= [0..99] then you fail to steal

7. You have 1 in 8 chance of getting a rare item, otherwise you get a common
   item.

8. If the monster doesn't have an item to steal in that slot, then you fail to
steal, otherwise you sucessfully steal that item.


                                  ************
                                   6.0 Spells
                                  ************


***************
 6.1 Metamorph
***************

Each enemy has a number 0 to 7 that determines how hard it is to morph.
For each value, MorphChance =

0: 255
1: 192
2: 128
3: 64
4: 32
5: 16
6: 8
7: 0

If MorphChance > [0..255] then you succesfully morph the monster, otherwise
you don't.

Each monster has 4 items it can be morphed into. The item you get is randomly
determined from among the items, each having a 1 in 4 chance of being the
item you get.

***********
 6.2 Regen
***********

See Cure Ring (4.4)


*****************************
 7.0 Credits/Ackowledgements
*****************************

Squaresoft
  For making this game :)

GameFAQs
  For giving me a place other than my website to post my FAQ

Everyone at FF3 Message Boards on GameFAQS, especially Master Zed, Assassin17,
Mech Gouki, and anyone else who figured out some of the things I put in this
FAQ.


/**************************************************************************/
Copyright notice:
This document is Copyright 2001 by Kris DeHart. I do not authorize any part
of this FAQ to be copied or used in anyone else's FAQ without my explicit
permission. The most recent version of this FAQ and all my other FAQS can
always be found at GameFAQs (http://www.gamefaqs.com) or my website
(http://www.geocities.com/teriisenshi)
/***************************************************************************/

