Modify Formula hit rate and avoid by hex editing

I would like to change a bit the formula for the hit rate and avoid, in order to nerf a little the speed stat and buff skill and luck stat

I want to have
Accuracy = Weapon Hit + (Skill x 4) + (Luck / 2) instead of Accuracy = Weapon Hit + (Skill x 2) + (Luck / 2)
Avoid = (Luck x 2) + Luck instead of Avoid = (AS x 2) + Luck

It seems you can make the first modification with hex edit at 0x2ABBCthe adress according to

but this topic say how to revert to skill2 from skill4, so someone know what value I must write to have skill*4 ?

And is it possible to do the 2nd modification the same way than the 1st ?

Considering I’m the guy that answered about location, just put in 92 at 0x2ABBC using a hex editor. That will alter a command to quadruple skill instead of doubling it. I’m unsure of adding Luck/2 to the equation. Similar story in terms of avoid, I don’t know how to make it count Luck twice.

1 Like

luck/2 is already by default in the formula :
accuracy = skill*2 +1/2luck

so put in 92 at 0x2ABBC erase the 1/2luck ?

92 at 0x2ABBC makes skill quadrupled. Luck/2 already happens in the formula, all you need to do is quadruple skill.

There are also other patches that change the hit ratio, so if you can use this to make enemy attacks hit harder, it will change the balance of the game.

NAME.en=Increase Enemy's hit rate(Install)
INFO.en=Increases the hit rate when the enemy attacks.\r\nIf the hit rate is 30% and you specify 20 in this patch, the hit rate is 20+30 = 50%.\r\nThis patch corrects the enemy's hit rate for each map, enemy type, and difficulty level.

Even if you don’t use this patch, +20% to hit all GBAFE weapons will make enemy attacks hit pretty well.

What about triple skill? What value should be put in for that?

The code I was referencing is an instruction on multiplying a value by 2^n, making it go for triple instead of double or quadruple would require a rewrite.

@ 7743
the goal is not to make the ennemy have better hit rate. If so, you could just increase their skill stat and/or give them special weapon with extra extra accuracy.

The goal here is to avoid have a stat like speed, which is currently the best stat because is the best offensive stat and one of the best defensive stat too.

So for the avoid formula, if I understant how it’s work and how you can modify thing with hex editing, i need to find where is the part that compute the avoid stat in the rom, and replace the pointer to AS to luck. I find this tutorial that could help me to find it, but it seems pretty hard.

If we open the addresses that GratedShtick provided with febuilder’s disassembler, we can potentially make some sense of what is happening.

The number in register 2 is being shifted left by 1. Eg. 0110b becomes 1100b. This is the same as multiplying it by 2^n. So we can easily change that to x2, x4, x8, x16, etc.

If I go back in the address to disassemble a little bit, we can see that febuilder’s documentation calls this “BattleLoadHit”:

If you want to do something more complicated with it, you can’t write it inline, which becomes more annoying to write a hack for.

To modify avoid, let’s look at GratedShtick’s DSFE avoid hack:

It seems to be around 0x2ABEE

Teq doq shows 0x57 as Terrain Avoid, so I avoided that part.

And it shows 0x5E as attack speed, so we want to replace that part.

And luck is 0x19

I decided to use Schtick’s dsfe avoid as speed+luck/2 as a basis. I installed the patch and futzed around with the asm for a little bit.

Honestly I don’t understand everything that’s going on. But I replaced loading AS with Luck near the top. Then I changed LSR #0x1 (which was dividing luck by 2^1) into LSL to multiply luck by 2^1 instead.

Seth has 13 luck, so it seems to work.

COMBO=Fix1: avoid=speed+luck/2|FIX1|Fix2: avoid=speed+luck|FIX2|Fix3: avoid=luck*3|FIX3|Default: avoid=speed*2+luck|DEFT
FIX3:0x2ABE8=0x19 0x20 0x00 0x21 0x10 0x56 0x11 0x1C 0x57 0x31 0x09 0x78 0x09 0x06 0x09 0x16 0x09 0x18 0x19 0x20 0x10 0x56 0x40 0x00

That’s good, but now I need to make [accuracy = skill x 3] in FE6 and FE7J. What should I do?

Try and learn a little asm. I explained exactly what I did above, so you can use it as reference while trying to port it for another game. Ask for help on specific parts in #advanced_help on feu discord.

But I have no knowledge of compilation at all.

We’re more than happy to hold your hand in doing this as a beginner’s asm project over on feu discord in #advanced_help. But I personally won’t simply do it for you.

If you aren’t interested in learning a bit of asm, then I think you may need to settle for vanilla formulas. Sorry.