• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
August 08, 2020, 05:07:17 am

News:

Don't be hasty to start your own mod; all our FFT modding projects are greatly understaffed. Find out how you can help in the Recruitment section.


Fire Emblem Universe

Started by MountainDew~, February 04, 2012, 04:36:24 am

MountainDew~

http://www.feshrine.net/tactics/

This is a really fun mod I used to play, but it's a WIP, so I never finished. Unsure as of what the patch's status is as of right now, but it was really fun (They gave me a good-sized campaign, minimum).
New Cast, Supports, New Maps, new story, etc. If you enjoy any fire emblem game, check the patch out. 
  • Modding version: Other/Unknown
  • Discord username: Holographic #1363

Dome

The patch looks quite epic, too bad isn't finished
I hate playing stuff that isn't completed...but that's just me

"Be wise today so you don't cry tomorrow"

formerdeathcorps

I used to go there, but I couldn't stand some of the moderators, so I'm here now.

If anyone wants to talk FE hacking with me, I'd be willing to help.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Dome

Quote from: formerdeathcorps on March 19, 2012, 07:16:07 am
I used to go there, but I couldn't stand some of the moderators, so I'm here now.

If anyone wants to talk FE hacking with me, I'd be willing to help.

I always wanted to hack FE stuff (At least, rebelance the games...I'd like to create something brand new, but that might be too hard/time-consuming)

"Be wise today so you don't cry tomorrow"

formerdeathcorps

FE6 doesn't have many tools.
FE7 has the best support.
FE8 allows infinite training.

Otherwise, the linear storyline makes it easier to make a hard-mode when compared to FFT equivalents; the real limitations is that you have to change buyable weapons and allowable Gold (which actually breaks the storyline in some places), mod EXP growth, and do fake difficulty to even make the game remotely difficult because of how DUMB the AI is.  The level of stupidity in Fire Emblem AI makes FFTA look smart.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Takeno

I also try to do some sprite (the battle animation) and it's more time consuming than doing FFT one (you must code the timing of the movement, the screen effect and create a whole new animation spredsheet). A shame fire emblem universe isn't finished

formerdeathcorps

June 24, 2012, 04:34:49 pm #6 Last Edit: June 24, 2012, 05:44:26 pm by formerdeathcorps
http://faqs.ign.com/articles/520/520430p1.html

1) FE6/7/8 uses a double random number generator to determine hit chances.  It takes the average of two random numbers (rounding down) and compares it to your accuracy.  Lower than means you hit; greater than or equal to means you miss.
2) This is an unfair measure.  Just to use extreme cases, a 1% hit chance actually means a 0.03% hit chance because you need to roll either 0/0, 0/1, or 1/0 out of 10,000 total possible rolls, while a 99% hit chance is actually a 99.99% hit chance because you can only miss if you roll 99/99.
3) This is extremely unfair in Fire Emblem 7 because it already accentuates the following problems:
A) Most early enemies use axes, which are the least accurate.
B) Most axe users have bad skill compared to player units.
C) Most player units are faster (and have better evade).
D) Most player units know to exploit the weapon triangle bonus for added hit and damage.
In other words, a 70 v. 30 hit chance advantage (a 2.3:1 ratio) is actually a 90 v. 15 hit chance advantage (a 6:1 ratio).

I have the means to correct this.  The routine that calls the double RNG is $08000E84 in RAM or $E84 in the ROM.  You want to change the existing code to:

push {r7,lr}
add sp, -#0x8
mov r7, sp
str r0, [r7, #0x0]
bl $08000E04  //Call RNG
str r0, [r7, #0x4]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov r0, #0x0
ldr r1, [r7, #0x0]
ldr r2, [r7, #0x4]
cmp r1, r2
ble $08000EB6   //r0 is 0x01 if r1 > r2 [Hit Chance > RNG]...r0 is the return statment, 0x01 means hit.
mov r0, #0x01
add sp #0x08
pop {r7}
pop {r1}
bx r1

Thanks to Xeld of feuniverse.net for providing notes on the RNG routine.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

formerdeathcorps

June 24, 2012, 06:27:02 pm #7 Last Edit: June 24, 2012, 07:31:30 pm by formerdeathcorps
The corresponding bytes are:

Fire Emblem (US) ROM
$E84
B580
B082
466F
6038
F7FFFFBA
6078
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
2000
6839
687A
4291
DD00
2001
B002
BC80
BC02
4708
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Glain

Nice, that's definitely an interesting hack. Making the displayed hit chance be the true hit percentage would mean you're getting hit at < 30% way more often. It's really noticable between playing FE and FFT how much more often the low percentages hit in FFT.

So, I'm starting to get interested in doing some FE hacking. Specifically, I'm beginning to wonder if I could do something with the AI. Obviously it wouldn't be anywhere near as complicated as FFT's. Just getting the AI to attack in groups as opposed to each unit individually rushing whoever comes in range would be an improvement.

Aside from actually figuring out ARM assembly, which seems... not too bad, given what I know of MIPS, it seems like I still need a debugger that allows setting breakpoints (somewhat like pSX's), in order to find the right code to modify. I'm currently trying to figure out if there is a debugger like that in one of the emulators...
  • Modding version: Other/Unknown

formerdeathcorps

The code is THUMB not ARM.  THUMB is much more code efficient than MIPS or ARM.
You technically don't need a full disassembler, Glain.  I'd love a functional equivalent of LEDecoder, but since even VisualBoyAdvance has a memory logger, all you have to do is edit the memory to force a loop and then read what the registers are.

For example:
08XXYYZZ: b XXYYZZ functions as a breakpoint because you force the code to branch to itself.  r1 is usually the return address, r0 the return value.  The code to create a breakpoint is E7FE.  A full list of opcodes is here (ARM-7 is GBA, ARM-9 is DS).
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Glain

Is there anything kanji table-esque in, say, the FE7 ROM? If I wanted to write a new routine, where would I put it?
  • Modding version: Other/Unknown

Dome

Do not buff the AI: It would make FE impossible!
Instead, disallow power-levelling: The max level a character can reach is set for each chapter (Dunno if it's possible)

"Be wise today so you don't cry tomorrow"

formerdeathcorps

July 10, 2012, 10:23:49 pm #12 Last Edit: July 10, 2012, 10:44:48 pm by formerdeathcorps
Well, if you really wanted to, you could event edit the game so that every mission had a time limit (so you wouldn't have the time to power level).
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Dome

That would still allow the player to roflstomp each chapter with your jeigan to powerlevel, IMHO :-(

"Be wise today so you don't cry tomorrow"

formerdeathcorps

Quote from: Glain on July 10, 2012, 02:23:23 pm
Is there anything kanji table-esque in, say, the FE7 ROM? If I wanted to write a new routine, where would I put it?


Not necessary.  You can expand the ROM up to 64 MB.

Quote from: Dome on July 11, 2012, 02:00:12 am
That would still allow the player to roflstomp each chapter with your jeigan to powerlevel, IMHO :-(


Jeigans become worthless later in the game AND with only 10-15 turns per mission, you'd probably not have the time to have one character kill everyone.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Glain

Speaking of hit not really being the true hit percentage, I came up with closed form formulas (i.e. not a recurrence relation) for true hit.  I think these have been around for a while (i.e. people make reference to them existing) but I couldn't find them anywhere when I searched for them, so I did a bit of math...

Let H = Hit
Let T = True Hit

H <= 50: T = (2H^2 + H) / 100
H > 50:   T = 100 - ((2*(100-H)^2 - (100-H)) / 100)

With two steps, the H > 50 case is just:
M = 100 - H
T = 100 - ((2M^2 - M) / 100)

Or you could write that as
T = (10000 - 2M^2 - M) / 100
  • Modding version: Other/Unknown

Glain

July 14, 2012, 04:48:18 pm #16 Last Edit: July 15, 2012, 12:06:35 pm by Glain
So I decided to try doing a hack that adds some variance to damage. I know sometimes making game mechanics less predictable can also make it harder to strategize, but I also think that adding some variance makes things more interesting because you can't always rely on exact damage, so I tried to keep the reins on it and keep it in a certain range while still adding some variation.

I also wanted to add some variation to criticals while also changing the average multiplier to be a bit less. I ended up having an average of damage * 2.2 instead of damage * 3.

The idea was:
Damage = (Old damage) * (75..125) / 100, rounded
Crit damage = Damage * (200..240) / 100, rounded

The overall variation would be 75% to 125% regular (displayed) damage and 150% to 300% on criticals (75% * 200% = 150%, 125% * 240% = 300%).

Anyway, I ended up writing a code (.asm) file to make the change. It seems fairly interesting from what I've played of it as I was testing it.

I was able to patch the .asm file to the ROM using armips, a program that was mentioned somewhere in my MHA thread. It's a command line utility, but its use is pretty straightforward: armips (asm file). You have to specify the filename(s) to patch inside the .asm file, which can be useful but also can be annoying. Obviously if you patch a ROM you'll want to have a backup of the original.

I'll attach the hack in case it's of interest. There is a version for each GBA FE. The hacks are mostly the same, editing the analogous code in each ROM, though there are a few differences.


I was basically just figuring out THUMB/ARM as I looked at the code and wrote code myself. Always a fun situation!

I used the same rounding trick that FFT's compiled code uses, namely, that rounding is basically equivalent to adding (1/2) after the division is done, and that:
(X/Y) + (1/2) = (X + (Y/2)) / Y

...So the GBA processor doesn't seem to have any integer division operation. At first I figured I could have done a fixed point multiplication like FFT does, but I figured that wasn't any more accurate than dividing by 128 (right shift) and scaling the multipliers to compensate.

So I ended up with:
Damage = (Old damage) * (96..160) + 64 / 128
Crit damage = Damage * (256..307) + 64 / 128

307 is the only one that didn't divide evenly. (240 * 128 / 100) came out to 307.2, so I rounded down. It is likely more difficult to get exactly 300% of displayed damage with a crit because of this.

In order to use the RNG without being pigeonholed into a 0-99 roll (0x08000e04), I wrote a function that used a direct call to the RNG at 0x08000be0, multiplied by the number of possibilities coming out of the roll, and added the lowest possibility. Essentially:
randomNumber = RNG() * (highest - lowest + 1) + lowest

My biggest problem at this point was figuring out where I could put the code so that it would be loaded into memory at the appropriate time. Eventually I realized that isn't necessary, as the GBA seems to just access the ROM if you specify any memory address from 0x08000000 onward (0x08023000 = 0x23000 in the ROM), without loading it into memory at all?

I was trying to branch from code around the 0x08029200 range (where the original damage/critical code is), to my new routines in empty space around the 0x08D00000 range. That's too far for the THUMB routine call command bl, but ARM can do it, so I switched to ARM, used bl, then switched back to THUMB.

The SDL version of VBA is really useful and has pretty much everything I'd look for in a debugger, except I couldn't make it delete breakpoints (tried the command bd but it didn't seem to work). It takes some configuration (i.e. editing the config file) to get it set up with a controller, but it's really good, and about on par with pSX's debugger, as long as you're not allergic to the command line.

Notepad++ actually has syntax highlighting for ARM and MIPS if your file has the .asm extension. I thought that was pretty cool.
  • Modding version: Other/Unknown

formerdeathcorps

Interesting...

I know I did the following in my game hack:
Hit Chance floor of 5%; cap of 95%.
Damage floor of 1 damage.

I don't remember if my patch uses this or not, but I think I did intend to hack in the critical hit system of the older Fire Emblems; namely, that your damage was doubled and their defense was halved, mostly to reduce the overwhelming reliance DEF scores in Advance generation Fire Emblems.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.