Autolevel Function

I can’t find this anywhere else so I’ll just dot down what I believe I discovered, and if someone else can confirm this that would be great. I noticed while working on my hack for FE8 that the autolevel=classdependent is not quite what it seems. From what I can gather, it’s very similar to the support function.

What I mean by this is that the game considers any unit above a value of 0x46 an enemy unit. So when you use autolevel=classdependent on a unit at or below a value of 0x46, the game actually uses the units personal growths for autolevel instead of class growths.

I found this by mistake by trying to edit a generic unit and have them autolevel, but every time I tried their stats would not increase. I was like wtf is going on??? And low and behold, as soon as I messed with their personal growths, their stats started to be effected by the autolevel routine. This does not happen above a unit value of 0x46. At least that’s my theory. I just wish I would have known this information prior to trying to figure it out for an hour straight lol.

Someone else please test and confirm this for me so I know I’m not insane.

4 Likes

You’re close, after a certain unitID only class growths will be used for autolevel. The FE8 decomp clarifies that unless the unit has the Boss flag set in their character data, units over id 0x40 will use class growths and units below that id will use personal growths.

If you want to change the “units at this ID or below use personal growths unless boss” ID, write the byte you want at 17C4C over where the 0x3F is.

4 Likes

You are amazing thank you!

That seems to be a little different from the behavior of FE8J.
In FE8J, 0x0801786C LoadUnit is the equivalent of that function.
I think the AutoLevel part of the implementation of this function is different from FE8U.

In FE8J, all enemies that use AutoLevel will be made to class Grows, regardless of their UnitID.
Conversely, Unit Grows are used for all Players units and NPCs that use auto level.

FE8J

08017982 78E1   ldrb r1, [r4, #0x3]  //unit placer 0x3 
08017984 2001   mov r0, #0x1         //check auto level
08017986 4008   and r0 ,r1
08017988 2800   cmp r0, #0x0
0801798A D024   beq #0x80179d6    //if not use auto level, jump to 0x80179d6
    0801798C 200B   mov r0, #0xb  //USE auto level
    0801798E 5628   ldsb r0, [r5, r0] r5=@Unit   //get unit number ramunit->0x0b
    08017990 21C0   mov r1, #0xc0
    08017992 4008   and r0 ,r1
    08017994 2800   cmp r0, #0x0
    08017996 D107   bne #0x80179a8              //if enemy, jump to 0x80179a8 use Class Grows
        08017998 1C28   mov r0 ,r5   //use Unit Grows
        0801799A F000 FA6F   bl 0x08017e7c   //08018160 AutolevelRealistic
        0801799E 1C28   mov r0 ,r5
        080179A0 1C21   mov r1 ,r4
        080179A2 F000 F94D   bl 0x08017c40   //AutolevelUnitWeaponRanks
        080179A6 E00A   b 0x80179be

    080179A8 1C28   mov r0 ,r5      //use Class Grows
    080179AA F000 FA47   bl 0x08017e3c   //AutolevelUnit
    080179AE 1C28   mov r0 ,r5
    080179B0 1C21   mov r1 ,r4
    080179B2 F000 F945   bl 0x08017c40   //AutolevelUnitWeaponRanks
    080179B6 78A1   ldrb r1, [r4, #0x2]
2 Likes