Venno's small ASM hacks and notes

Links to other things of interest:
Weapon Rank Bonuses
Remove weapon ranks on promotion,DSFE-style growths
Index-based effectiveness
Passive stat boosts
Array-based weapon locks
“Drop Last Item” as a unit flag for FE7
FE9-Style Support gains
FE6 - Individual Weapon XP
FE8 - Custom Animations
FE8 - Event Assembler raw tweaks
FE8 - Dancers can’t refresh other Dancers
Item Might-based staff healing
FE7/FE8 - Autocursor/Status Screen Fix
FE7 - Variable Status Staff Length
FE7/FE8 - Dropped items don’t refresh uses
FE8 - Growth modifying items
FE8 - Utility ASMCs
FE8 - Unit stat modifiers
Here are some quick notes on how and where autoleveling happens in fe7.

$0202BC06 - Current chapter
$0202BC07 - Current phase (0x0 player, 0x80 enemy, 0x40 NPC)
$0202BC0C - Normal/Hard byte - 0x40 is hard mode
$0202BC13 - Lyn/Eli/Hector mode byte; 0x3 would be Hector

$0800A6BC - Checks for Hector Hard mode
    -If passes check, checks chapter unit data to see if unit is an enemy
    -Branches to $08031574, which gets offset of current chapter's data
    -Gets Bonus level byte; branches to $08017B4C

$08017B80 - Autolevel routine - calcs autolevels from level + promoted status to add to enemies
    $08017AC0 - Global level adder; if r2 (levels to gain) = 0, skips to end
$08017A1C - Checks for autolevel bit set in unit data

As you may know, in FE7 the hard mode bonus levels only apply on Hector Hard. Should you want to allow enemies to receive bonus levels on Eliwood Hard mode as well, simply make the following change:

-At 0x0A6C8, replace the twelve bytes there with 000000000000.
-At 0x799D6, replace the twelve bytes there with 000000000000.

In addition, whenever the game generates levels for enemies, it varies their total growths for each step by up to 12.5%, which can cause quite a lot of stat variance for autoleveled enemies. To cut this variance in half, write these bytes to the following offsets:

$08029612 - C010
$08029622 - 0011

This will have the effect of making autoleveled enemies’ stats vary by only 1-2 points at most, instead of 3-4 points.

An addendum to this: if at first this doesn’t seem to work, try playing around with the character IDs of the enemies it isn’t working on. Switch them to something else, play the game, then switch them back. @CT075 says that this may have something to do with the way the game checks to load enemies and blah blah but regardless it should work.

Got a new thing to share. This ASM hack will allow you to remove weapon ranks on promotion. If the class you are promoting to has a zero for a weapon rank, the promoting unit will lose its weapon rank for that type. For example, a Cavalier promoting to Druid would lose his Sword and Lance ranks in the process.

Download Here

3 Likes

Thank you much :smile:

IIRC FE8 already did that with Pupil Ewan → Shaman Ewan. Would this patch eliminate all the previous ranks that don’t match the new class, or can it also be selective (for example, Sage → Druid loses Anima, but Ranger → Wyvern Lord maintains bows)?

Currently this hack just removes all ranks that don’t match, unlike the original FE8 routine which was a hardcoded check for Pupil (1) promoting to Shaman. I could of course add a secondary check to keep weapon ranks for certain promoted classes.

Another new hack: DSFE style growths! With this hack installed, upon level up the game will consider a character’s growths as the sum of their personal growths and their class’s growths; or if you prefer, as the average of the two. Both versions are provided in the download.

Note that currently, this does not alter the autoleveling routines, so take that into account when adjusting class and character growths.

FE7
FE8

2 Likes

FE7 or FE8?

Also, the instructions I gave in the readme were pretty unclear - I’ve changed them to fix that. You want to copy the data at 0x0296B0 to 0x0296B0 in the ROM, for FE7.

And now I’ve updated to support FE8! There’s a new link in the downloads now.

New hack again, for FE7 and FE8 - this lets you define effectiveness as a type bitfield, shared between effective weapons, classes they would be effective against, and items that shield classes from certain effectiveness types, like how the Delphi Shield protects fliers against arrows (but doesn’t protect wyverns from Wyrmslayers).

Link (FE7/8)
Old Version

And one small note: for the array-based weapon lock system, to make all of the default weapon locks null and void, change the values at 0x80161CC to A8E0.

This frees up 0x17A bytes of space, between 161CC and 16346.

The DSFE-style growths hack has been updated to support signed values for character growths. Now, characters can have a -15% HP growth compared to their class’s HP growth, for example. This completely slipped my mind the first time around somehow!

Small new hack here that adjusts staff xp to work like it does in Shadow Dragon. Instead of using the staff’s gold value, like most versions of the FE7 ROM, this system calculates a staff’s bonus xp from a table at 0xCB528. Staff XP is reduced by 1 for every four levels the unit has, then divided by 2 if the unit is promoted.

Download for FE7

I can make an FE8 version too, if anybody wants it.

2 Likes

This next hack uses weapon Ability Byte 0x80 to allow an item with a stat boost pointer to give those boosts even not equipped! Now you can have an actual Starsphere in your hack. Optionally, you can use a version that prevents multiple items from boosting the same stat; it’s included in the downloads. You can still have an equipped weapon + passive item boosting the same stat.

Note that Con and Move boosts are not part of this by default, due to the nature of the stat getters for these stats.
Download (FE8)

Old download for FE7 (deprecated)

5 Likes

Cool! I was thinking of implementing this myself sometime. Though, I use Weapon Ability 2 0x2 for my reaver-and-double WTA effect separation – is there another ability you can use?

You implemented this only by modifying the getters for boosted stats, right? Did you have to write to any auxiliary space, and if so, where?

The main code for looping through a unit’s inventory to check for items giving passive boosts wasn’t convenient to stick inline, so you’ll have to find some free space for it. Everything else is done inline.

And yeah, I can use just about any weapon ability - I’ll make it use weapon ability 3 0x40 then. I also added the Readme to the download, since I somehow had forgotten before.

This is basically a passive boost, isn’t it? :0 I’m interested in an FE8 version!
But I think 0x40 is already used by crazycolorz’s Renewal skill effect in Midnight Sun…

Here is a version of the passive stat boost item hack for FE8 - this one uses Weapon ability Byte 3 0x80 to indicate weapon ranks.

Small new hack for FE7 and FE8 - this allows you to give a Hit bonus to Enemy (And/or NPC) units. By default the bonus is +10 hit to enemies, but this is fairly simple to change. You can also optionally have this bonus only apply on Hard Mode.

The current version hooks into the main Hit calculation routine; I plan to move it to a better location and perhaps integrate it into my weapon rank bonus hack, so you might want to hold off on applying this for now.

Download with Readme

Chances are that this is probably modular battle-breaking. Does this change the routine in the game that calculates hit percentage? Or does it apply it afterward? (If it’s afterward, it’s probably okay)

Edit: Also, something possibly cool is applying this only on hard mode or something! Not that I need it, but just saying that it’d be cool.