GBA RNG Randomizer

No, I didn’t stutter. So the random number generator in the GBA FE games is known for being well, not very random. Some know more about this than others but as a general summary, if you do the same set of actions, within very lenient restrictions, when you start a chapter after resetting the game, you will get the same outcome each time. It is also very easy to “RN peek” as I call it, in order to do things like double your hit and crit rates in certain situations, such as on attack, if you just know a little more about how the game uses the random numbers. As someone who has done a lot of abusing the RNG in the past, it seemed relevant to me to make something that makes the RNG more random, for the purpose of making the game play closer to what I assume was it’s original intention.

As such I present an ASM hack that causes the game to essentially constantly advance the RNG state, meaning you would have to play frame perfectly if you wanted to manipulate it. Currently I have only made one for FE7, but I plan to try to make one for FE8 at some point in the near future (EDIT: now works for FE8 too!). I’ve tested it to make sure that you can’t abuse it by resetting and resuming the game to try and get a different outcome, or by holding A on enemy phase or other phase so that the game would take a different number of frames to get to what it does. If you find any glitches or things that don’t seem intended, let me know!

Download here:

This is installed using EA, if you are going to use anything else you’re going to have to look at the installer and adapt some code, so you probably just want to use EA.


But I LIKE that Lyn gets a perfect level up on her first level in Normal Mode

heh, it’s certainly useful for the speedrun, I’ll give you that!

Ahh you beat me to it. I was working on an FE8 version of this but procrastinated too much lol

Nice job :+1:t2:

Thank you! I’ve been procrastinating on the FE8 version as well actually, it should be as simple as changing the relevant pointers but I’ve yet to get around to it.

Thank you very much for this hack (been wanting this for a long time).

However, when I installed the hack, the game didn’t load. I used a clean ROM and attempted both EA installation and copy-pasting the .DMP files, with both processes leading to the same error. Is there something I am doing wrong?

Glad you like it. Make sure you are ORGing EA to freespace and you only need to include the main installer and nothing else. Other than that I don’t know.

The OP is now updated to reflect that the FE8 version is indeed finished.

I got an error trying to use it. Then again, this could be because it’s a romhack of FE7, but it shouldn’t make a difference. After all, you used it in Negative Growths.

Error Report

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Nintenlord.Event_Assembler.Core.Program.Assemble(String inputFile, String outputFile, String languageName, ILog messageLog, String symbolOutputFile)
at Nintenlord.Event_Assembler.UserInterface.MainForm.<.ctor>b__3_1(Object sender, DoWorkEventArgs args)
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

************** Loaded Assemblies **************
Assembly Version:
Win32 Version: 4.7.3163.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll

Event assembler
Assembly Version:
Win32 Version:
CodeBase: file:///C:/Users/chron/OneDrive/Desktop/Games/Files/Event%20Assembler/Event%20assembler.exe

Assembly Version:
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

Assembly Version:
Win32 Version: 4.7.3151.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

Assembly Version:
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

Assembly Version:
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

Assembly Version:
Win32 Version: 4.7.3160.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

Assembly Version:
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

Assembly Version:
Win32 Version:
CodeBase: file:///C:/Users/chron/OneDrive/Desktop/Games/Files/Event%20Assembler/Nintenlord.Forms.DLL

Assembly Version:
Win32 Version: 11.1
CodeBase: file:///C:/Users/chron/OneDrive/Desktop/Games/Files/Event%20Assembler/Core.EXE

Assembly Version:
Win32 Version:
CodeBase: file:///C:/Users/chron/OneDrive/Desktop/Games/Files/Event%20Assembler/Nintenlord.DLL

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the section.
The application must also be compiled with debugging

For example:

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Could I possibly have some help? (The hack is TLP Hard Mode if it matters.)

Is this an error that the event assembler gave back to you? how did you go about trying to install it?

It’s not impossible that if you apply this to any given hack that the hack could interfere with this, I made sure negative growths didn’t, so the fact that I used it there is not a valid argument to say no hack could pose a problem. That said I doubt TLP messed with the rng functions, but it could be possible, though I doubt that it would be an error that would be caught by the assembler (it’d probably just break your game).

Probably you’re just doing something wrong trying to insert it.

Thanks for responding so quickly.
I had answers to your questions all typed out, but before posting, I redownloaded EA and tried again. I ended up getting what I got a couple months ago with a different download of the event and ROM - “No code named jumpToHack found.” It gave that error for three different lines, so I’m assuming that it tries to run the rest of it and it all checks out. I hope this simplifies things - I guess the EA I had was messed up. It did have a couple errors when running it as well, so it doesn’t come as too much of a surprise.

So, with the new data - only jumpToHack is messed up - what do I do?

OK so I’m pretty sure I know what’s going on. jumpToHack is a macro in “Hack Installation.txt” which has to be included in the buildfile. I already had it included in my project outside the RNG Randomizer installer so I didn’t put it in there or remember to mention that you need it here, so that’s my bad. But to fix that you need to put #include “Event Assembler V11.1\Extensions\Hack Installation.txt” somewhere in your buildfile before you run the installer for this or just at the top of the installer.

By buildfile, you mean what exactly? Sorry, I’m not all too familiar with this.

The thing you’re giving to the event assembler that you included the installer in.

…I followed along. I inputted the line into the RNGRandomizerInstaller.event file, and nothing happened. I also went into the EA files and tried to put Hack Installation.txt in the Standard Directory. Didn’t work. You didn’t give me much to go on (unless I’m missing something huge), so I can’t think of much more.

I don’t know how exactly you’re doing this then. make sure you put the line at the top.

Okay. This is important to me (I love this mod and want to use it badly), so I even recorded what I did, so I can show you what could’ve messed up.

Each file is freshly downloaded, no edits.

First of all you need to understand what you’re actually doing with EA. The reason I was talking about buildfiles is that it’s the standard way to use EA to insert stuff. technically a buildfile is an event file like the one I provided, except that my installer is meant to only be included in a larger standard buildfile. Using this installer alone is not going to work because it doesn’t ORG to anywhere at the very beginning. Why? Because I don’t know where your free space is. You have to find that depending on what ROM you are inserting into. In the case of TLP that could be difficult because you didn’t make the hack, so you’ll have to hope there’s documentation saying where free space is or you could try some common free space ranges (that you can find on this site) to see if they work. If you insert to somewhere that’s not free space btw, the assembler won’t be able to catch that, it’ll just break your game, which is similar to what I was referencing earlier.

Here are some resources on buildfiles:!provider=gist&gistId=084645b0690253600f4aa2a57b76a105&filename=feutv2

Secondly, when you include something into another file you use a path to another file to tell the program what to include. In this case “Event Assembler V11.1\Extensions\Hack Installation.txt” is a path. This one is a relative path because it doesn’t start from you computer’s base directory (starting with something like C:). That means it’s starting from wherever the file that you put it in is. So it will only work in this case if the folder “Event Assembler V11.1” is in the same folder as the installer.

  1. The path needed to start from C: after all. So I got that part working. Beyond that, the game crashed like you said. So I did some research, and found what I think would be helpful.
Free Space

Does that help? And if so, what do I do with it? I mean, I can tell that it’s replacing the ORG lines in the installer, but beyond that I don’t know much.

sorry I don’t know what that does. you’re gonna have to figure this out on your own.