Tuesday, March 22, 2011

Final Fantasy: Damage Formula

All information summarized here was provided by this very in-depth FAQ. It turns out the original Final Fantasy on the NES had a plethora of bugs which were fixed on the PS version which I'm playing. This makes things easier in some cases and harder in others. (For one thing it's impossible to become practically immune to being hit with Ruse now.) The run away formula is one of those things. The game still rolls a number between 0 and 15+x and compares with your luck to see if you'll run away, but in the PS version x is your character level instead of some random number with no relevance at all. So on the PS the thief both starts and ends the game as the absolute best runner. (Woo?) But on the down side, the thief will always have a chance to fail at running now while on the NES he was guaranteed to get away as of like level 3.

The formulae I most care about are those dealing with hits and crits. Now, in the original NES version the crit chance was buggy. Each weapon was supposed to have a crit chance value innate to the weapon but instead the crit chance was based on the position of the weapon in the list. So the last weapon in the list had the highest crit chance which substantially boosted the power of Excalibur compared to Katana. Regardless though, that's not the important change for now. They actually changed what crits do. Typically a weapon swing does somewhere between D and 2D damage, with the enemy absorb subtracted. On the NES when you crit you add the random roll in again, without subtracting absorb, so you do at least double damage. If you rolled X then you do 2X-A damage. On the Playstation a crit merely ignores armor. So you do X damage. Now, the game actually forces X-A to be at least 1 regardless, so 2X-A is strictly greater than X. It also means crit don't scale with weapon damage. They actually scale with opponent absorb. Which is just plain weird, I think.

At level 22 I do between 26-52 damage a swing. Astos has 40 armor. So on the NES my crit would average 42 damage and on the PS my crit averages 39 damage. On the NES my weapon would have a 6% crit chance, on the PS it has a 5% crit chance. My non-crits would do 3 damage on average regardless of platform.

As far as odds of hitting go the game actually rolls between 0 and 200. A 0 is an auto-crit, a 200 is an auto-miss. Otherwise you check against 168+hit stat-evade stat. Note that on the NES they cap 168+hit stat at 255 regardless of evade which is why you can become unhittable with max evasion. Astos has an evade of 78 and I have a hit of 52. So 142 times out of 201 I'll hit. On the NES 12 of those would be crits. On the PS 10 would be crits. The difference isn't actually that extreme between the two versions (clearly it's harder on the PS) and as it stands I average a little over 4 damage a swing and need to attack 40 times on average to win. I'll look at incoming damage formulas later but as a rough feeling right now I can survive to attack probably 12 times if I'm lucky. For that to happen I need to have him miss me with Rub, both slows, and the blind. (Though I don't think blind affects crits so maybe that doesn't really matter.) Even still that's only 24 swings and not even close to the 40 I want.

What if I level up some? If I get all the way up to level 26 and keep using my current weapon I continue to only get 2 attacks per round. My average damage per swing will go up to almost 6 per swing and I will need only 30 swings to win. The extra 60-80 health will likely buy me another turn or two as well on top of what the extra 2% dodge and innate magic resistance gains will give me. I may be at the point where I can get lucky and win here. If I switch weapons I get an extra swing per round but actually lose 3 base damage and half of my crit chance. I end up not even averaging 3 damage per round and will need 57 swings to win. If I get all the way to level 28 I'll be averaging more than 6.5 damage per swing and will need only 26 swings on average to win. I'll get the extra swing per round and even more health and damage reduction so I'll probably get to swing 45 times before I die. This seems insanely good. I might need to get lucky to win at level 26 or 27 but at 28 I'm pretty much a lock to win after a few tries.

Unlike the wizards who lived at the bottom of a cave and required me to run from 4-6 fights each way before I could try them I can save right outside Astos' castle and get lots of tries on him. Leveling takes so long I'll probably take a break and try to win a bit at 26 and at 27 but after looking at the numbers I'm pretty convinced I can win for sure at 28 and will therefore keep slogging.


Sthenno said...

That FAQ is a fascinating read. It's funny how many crazy bugs are in the original game. At the end there is an actual FAQ part that asks the question of why so many bugs made it through and the writer speculates that it was rushed, etc.

I personally think that most of those bugs simply didn't matter at all. INT didn't do anything, but no one who was playing the game really knew what any of the stats did and it wasn't like you could affect what your stats were anyway (scumming aside). The critical hit/weapon index bug made Xcalibur much stronger than it was supposed to be relative to Katana, but clearly your fighter is going to use Xcalibur anyway.

In a way, the mechanics of the game just never mattered.

Ziggyny said...

A lot of the crazy bugs have to do with pointers gone awry. If I was teaching computer science to people I think Final Fantasy with its design decisions and bugs would make a great case study. The bit about how 'random' encounters happen is truly insightful.