Friday, October 14, 2011

Crazy Final Fantasy Legend Bug

Final Fantasy Legend has less of a following than Final Fantasy does, at least in terms of availability of information about exactly how things work. I'm trying to find information about how critical strikes work since they seem really brutal and have come up blank so far. I'm going to keep surfing the web since I'm sure it's out there somewhere, but I did stumble across an awesome bug that I wanted to share...

Humans can use a bunch of different types of weapons and they coded them all differently. There are weapons based on strength, some based on agility, and some based on mana. Some do fixed damage, some scale with your stats. All weapons have limited uses just like my monster skills and you need to go buy new ones when the old ones run out of uses.

One type, martial arts, has two weird components to the amount of damage it does. First of all, you subtract the number of uses left on the item from the damage. As such, the more you use an item the more damage it does. I guess this is supposed to simulate getting better at punching? The second part is that on the attack that lowers your uses to 0 you do triple damage. Ka-pow! I've mastered punching and go out with a bang!

The bug comes in with how the game determines the number of uses left in your item... It doesn't store the uses in the item when you first use it. Instead it iterates over your inventory to find the item again and looks up the number of uses that way. (The programmer apparently started with swords and made the rest of the damage routines based on the sword one. Swords don't care about uses left so it wasn't stored?) Ok, that seems dumb, but what does it do? Well, the look-up is based on the name of the item and you can actually have multiple items with the same name in your inventory. So it checks the number of uses left in the top item in your inventory even if you actually used one lower down. Since uses left is subtracted from damage done you can do extra damage by leaving a punch with 1 use at the top of your inventory and actually attacking with another one.

Ok, we can do an extra few damage per attack this way... But what about that triple damage? It turns out you can get that too. When you fully use an item it disappears from your inventory but they didn't actually delete it from your inventory. They actually wrote in code to hide empty items from view in the menu! They're still there until you put something new in the empty slot. And the iteration to find the used martial arts item? It knows the spent item is there. Welcome to triple damage!

No comments: