[FE6] The Origins of Iron Bow Brigands

I’ve been having fun taking appart the arena lately, so I thought I’d get to the bottom of what exactly causes brigands with iron bows to appear in FE6’s arena.

As many of you might have guessed, it is indeed caused in part by the game’s bugged RNG. However, I’d concider it a double fail state since there are no guard rails against generating this kind of invalid enemy in the first place.

When generating an enemy, the game rolls on a table of class IDs determined by the weapon of the blue unit entering the arena. These tables are Melee, Bows, and Magic. When reading through the table to find the chosen class, any classes that don’t match the blue unit’s promotion level are skipped over. First, lets talk about what happens with unpromoted units.

When an RN that’s bigger than the table itself is rolled, it ends up reading a 00 byte, an empty padding that separates the tables. Since there are no safeties in place, the function happily returns a class ID of 00.

Next, the opponent’s weapon is generated from the highest weapon rank among class data. It does so by checking each weapon rank sequentially, only replacing the current highest rank with the next if its greater. Considering the opponent’s class pointer is 00000000, it ends up reading way out of bounds, yielding the following weapon ranks:

Swords: 0x04 (4)
Lances: 0x20 (32)
Axes: 0xA0 (160)
Bows: 0xE3 (227)
Staves: Skipped
Anima: 0x20 (32)
Light: 0xA0 (160)
Dark: 0xE3 (227)

Well, look at that. There’s our bow rank. The reason it isn’t replaced with dark is because following weapon ranks must be HIGHER than but not equal to the first highest found.

In the final step, the unit itself is generated from the generated class, the generated weapon, and character ID 0xE1, also know as the arena duelist. During this process however, there is a guard rail this time. Upon detecting that the class pointer is null, it creates a new one from the character’s base class. The base class for character 0xE1 is, like the defaults of many NPCs, the brigand.

So now we have our iron bow brigand. So what happens when we overroll while using a promoted unit?

Promoted units will skip every entry that doesn’t have the promoted flag, so they’ll skip right over the empty 00 pad byte and start reading into the next table. Here’s the first promoted class encountered after skipping the byte for each table:

Melee → Hero
Magic → Sniper
Bows → Swordmaster

Hero is already a standard encounter for melee combatants, so the effects of the bug are undetectable for melee promotes. Even though sniper isn’t on the list for magic users, i don’t think anyone noticed this one, since a sniper vs a magic user doesn’t seem out of the ordinary.

The funny one is the bow list, which reads from an unused table and picks swordmaster. The bow unit will merciless pelt the swordmaster with arrows until it dies, completely unable to fight back at a range. If you’ve ever wanted to get revenge of those silver sword cheaters, just keep using bow users until you get a bugged roll.

As a final footnote, there were also rumors of a warrior with a fire tome. Given the specific method on how these invalid enemies are generated, i don’t see how a fire warrior is possible.

While researching this bug, I was able to find many old video examples of the iron bow brigand, but not even a single image of the fire warrior. Infact, every mention of the warrior was second hand. I couldn’t find a single first person encounter posted anywhere online.

Unless someone can give me some compelling evidence, I’m going to chalk the fire warrior up to old internet urban legend.

26 Likes

Huh, it’s really neat to finally get a proper explanation for this!

Seeing as the Hugh stat underflow glitch turned out to have been introduced by an old fan translation despite that the premise of the patch didn’t seem like something that should’ve affected that, it may warrant looking into the various fan translations available to see if any of them inadvertently made Fire Warriors in the arena possible? It’s obviously possible that was just never actually a thing to begin with, but it may be worth checking out.

1 Like

Here is an 18 year old Japanese post mentioning the fire warrior. I think this might actually be the origin of the claim.

3 Likes

Wait, so fixing the RNG also fixed this issue by accident? That is pretty cool, means we already had the fix and didn’t even know it for years.

1 Like

Even before I learned how to disassemble these games, I had a strong hunch it was the RNG. It was something that happened very rarely, and was immediately fixed in the next game, along with the games broken RNG.

Infact, I had even hypothesized that this was the bug that lead the devs to fixing the RNG in the first place. The had less than a year to develop FE7, and I think it’s more likely for them to encounter a 1/1820 iron bow brigand while relentlessly grinding the arena, than to notice it through a 1/1820 missed 100% status staff.

Not only are status staves used much less often compared to how often the average player visits the arena, you could only notice the bug if the staff specifically had 100% hitrate, since if it had even 99% hitrate, you could blame bad luck.

Edit: the iron bow brigand chance is actually around 1/5958.

The number of unpromoted units on the list is 25. The games bugged RNG then divides 65535 by 25, yielding 2621.

Next, a random number between 0-65535 is divided by 2621.

Most numbers will result in a value between 0-24, but the 11 numbers between 65525-65535 will result in 25.

So there is a 11/65536 chance of an iron bow brigand, or roughly 1/5958.

3 Likes