(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
04-29-24 05:32 PM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - FE 8 "RNG" Hack New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
Zeld

Red Paragoomba








Since: 11-05-06

Last post: 6283 days
Last view: 6280 days
Posted on 12-18-06 03:08 PM Link | Quote
This is for Fire Emblem 8, Seima no Kouseki.

People who play the Fire Emblem series know of the battle system; I imagine Advance Wars and other TBS's use a similar system: You have statistics that give you a chance to hit the enemy, a chance to get a critical hit, a chance for a special ability to activate, etc. The numbers that your stats are compared to to determine success or failure was called the RNG, for Random Number Generator. Well, there is a number generator for all that stuff, but it most certainly isn't random. I decided to call it the FNG, for "Formulated Number Generator", and then I hacked it to little tiny pieces and got the formula.

Here be it; I'm not sure if it's the same for all FEs or not:

Last FN=(First FN)*2{+1}) eor ((Middle FN)*2048+(Last FN)/32) and 0xFFFF)

The {+1} is not executed if the First FN is less than 0x8000.

"What are the First, Middle, and Last FNs?"

Good question. FN stands for Formulated Number; what the FNG produces and the correspondent of an RN in an RNG system (I don't believe a true RNG exists, but we can theorize here). Naturally, they're stored in the RAM and can be fiddled with.

They are stored at 0x3000000, the beginning of the Gameboy Advance's IRAM. Each is a half-word in length, and the FN labeled "First" is at 0x3000004, while the "Last" FN is at 0x3000000. So, it is right to left. The fact that the GBA uses intel byte ordering makes it even more right to left

During the FNG process, the First FN is used for comparisons to determine the outcome of a battle or w/e the case may be. Then, the formula above is executed. The Middle FN becomes the First, the Last FN becomes the Middle, and the result of the formula becomes the Last. Rinse, repeat.

Each level in the game has its own separate start-up formula. If you hard reset the game and look at the FNs that result after each level's start up formula, you could calculate millions of FNs with which to play through the level with inhuman foresight.

I thought this would be an interesting find to share with you all, but I only got into hacking out the formula because I need it for programming a new skill into FE 8. I've made a patch that gets rid of the hard-coded associations between certain classes and certain skills, and that provides bit tables where the user of the patch can freely decide which classes get which skills. But those skills are already in the game. I'm gonna add custom skills

The one I am working on now is called "Continue/Adept"; it allows the bearer of the skill to attack twice in a single turn if the skill activates.

Attachments

Assembly_Patch_Beta.zip (958b) - views: 32



(edited by Zeld on 12-20-06 11:27 AM)
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - ROM Hacking - FE 8 "RNG" Hack |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.010 seconds; used 353.75 kB (max 420.56 kB)