Board of Slick

Library of the Ancients => Final Fantasy IV Research & Development => Topic started by: Kea on July 15, 2015, 03:05:10 AM

Title: FF4A (E) Hacking Notes and Mod
Post by: Kea on July 15, 2015, 03:05:10 AM
Recently I've been hacking the European version of Final Fantasy 4 Advance, and have made notes on its data structures, ASM code and AI scripting as I went along. Since there doesn't seem to be much documentation on this version that I could find, I though I'd share my notes here.

This is a link (https://www.dropbox.com/s/rp3x5qu1o1a20i5/FF%20IV%20Advance%20%28E%29%20Documentation.zip?dl=1) to my notes, including modules for use with the Nightmare table editing program (not very flexible, but it's dead easy to use). It includes documentation on item,spell and monster data, encounter sets, encounter setting (eg. what music to play, whether some monsters start out hidden), monster AI, chest contents and more; the bulk of my notes are in "ff4a-structs.txt", which was originally based off of notes by PKT Paladin.

I've started putting some of that knowledge to use in a mod for this game (https://www.dropbox.com/s/x95ogtesrj75ju4/FFIVa%28E%29%20hardtype.zip?dl=1). The purpose of the mod is simply to make the game more challenging and interesting while reducing some of the tedium. It's still incomplete as of this writing but I work on it pretty regularly.

Here is some custom ASM code for the hack I've written that might be helpful or interesting to others:

More variance for encounter RNG
If you've played FF4a before, you probably know how the encounter system is messed up: the same battles tend to occur over and over again, and saving+loading doesn't help. This is mostly due to the fact that the RNG used to determine what you encounter and when is seeded from only one thing: the amount of time you spend on the file loading screen. This tends to produce very similar seeds, leading to the same pattern of encounters recurring.

This code fixes this problem by seeding this RNG with your save file's game clock in addition to the above:
$0827E6: 2188 401A 0F49 6052 3CF0 D3FA 2188 4018
Paste write the above byte sequence to $827E6 in the FF4 Advance (E) ROM.

Allow monsters to use their Magic Defence Multiplier
Normally, a monster's MDef Multiplier in the ROM is never written to their RAM battle data. To undo this, make the following change:
   $93082: Write 0000
Note that all monsters have zero Magic Evasion by default, so you'd need to give them values yourself.

Back Row functions almost properly
In the European version, melee weapons have no penalty to Attack or Precision for attacking from the back row, while the actual long-range weapons (Bows, Harps, Boomerangs and Whips) do receive a penalty. To fix:
      $8A858: 07D1
      $8A868: 00D0
 Currently my code fixes this by making your attack Back Row-Ok if you have any long-ranged weapons equipped, which means that Edge with a katana and boomerang can attack at full power from the back row. A more nuanced fix requires more space (and therefore repointing code).

Modular elemental weaknesses from armor
By default, armor that resists Ice or Fire is hardcoded to give a weakness to the opposing element, unless your equipment protects against Fire,Ice and Lightning all at once. This code ties elemental weaknesses to a byte in armor's affinity data instead:

Equipment (including weapons!) can have elemental weaknesses that apply to the actor (byte 0x1 in affinity data):
Start of Battle $9F440: 4178 0023 0B43 A08C 1FF0 A8FC 4178 0B43 A08D 1FF0 A3FC 4178 0B43 E08D 1FF0 9EFC 4178 0B43 208E 1FF0 99FC 4178 0B43 2222 AB54 28E0
During Battle $9DA2E: 4578 B88C 21F0 ADF9 4078 0543 B88D 21F0 A8F9 4078 0543 F88D 21F0 A3F9 4078 0543 388E 21F0 9EF9 4078 0543 2221 7554 29E0 0000

Monsters' basic attacks can be imbued with elements (byte 0x6 in monster elemental data):
(ASM) $7F7000: 5088 A083 9088 2084 9079 6076 3188 7046 0430 0047
(ASM) Link from $93156: 0148 2BF0 12FE 01707F08

Simple- this lets you have Fiery Hounds attack with a Fire element. Handle with care: elemental physical attacks do triple damage when hitting a weakness!

Reworked Boss Bit vs Status system
By default, enemies with the boss bit show immunity to all status effects in the Bestiary. Normally this is accurate since almost all spells have the boss bit (or rather, don't have the bit that lets them affect bosses), but if you change that, this code will only make a monster's explicit status immunities show on their Bestiary entry.

Updating Bestiary screen:
$121D0: 00000000

That's all I've got for now, but I might have some other things to show at another time.  :cycle:
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Grimoire LD on July 15, 2015, 11:43:52 AM
Recently I've been hacking the European version of Final Fantasy 4 Advance, and have made notes on its data structures, ASM code and AI scripting as I went along. Since there doesn't seem to be much documentation on this version that I could find, I though I'd share my notes here.

This is a link (https://www.dropbox.com/s/rp3x5qu1o1a20i5/FF%20IV%20Advance%20%28E%29%20Documentation.zip?dl=1) to my notes, including modules for use with the Nightmare table editing program (not very flexible, but it's dead easy to use). It includes documentation on item,spell and monster data, encounter sets, encounter setting (eg. what music to play, whether some monsters start out hidden), monster AI, chest contents and more; the bulk of my notes are in "ff4a-structs.txt", which was originally based off of notes by PKT Paladin.

I've also written some custom ASM code for a little hack of mine that might be helpful to others.

More variance for encounter RNG
If you've played FF4a before, you probably know how the encounter system is messed up: the same battles tend to occur over and over again, and saving+loading doesn't help. This is mostly due to the fact that the RNG used to determine what you encounter and when is seeded from only one thing: the amount of time you spend on the file loading screen. This tends to produce very similar seeds, leading to the same pattern of encounters recurring.

This code fixes this problem by seeding this RNG with your save file's game clock in addition to the above:
$0827E6: 2188 401A 0F49 6052 3CF0 D3FA 2188 4018
Paste write the above byte sequence to $827E6 in the FF4 Advance (E) ROM.

Allow monsters to use their Magic Defence Multiplier
Normally, a monster's MDef Multiplier in the ROM is never written to their RAM battle data. To undo this, make the following change:
   $93082: Write 0000
Note that all monsters have zero Magic Evasion by default, so you'd need to give them values yourself.

Back Row functions almost properly
In the European version, melee weapons have no penalty to Attack or Precision for attacking from the back row, while the actual long-range weapons (Bows, Harps, Boomerangs and Whips) do receive a penalty. To fix:
      $8A858: 07D1
      $8A868: 00D0
 Currently my code fixes this by making your attack Back Row-Ok if you have any long-ranged weapons equipped, which means that Edge with a katana and boomerang can attack at full power from the back row. A more nuanced fix requires more space (and therefore repointing code).

Modular elemental weaknesses from armor
By default, armor that resists Ice or Fire is hardcoded to give a weakness to the opposing element, unless your equipment protects against Fire,Ice and Lightning all at once. This code ties elemental weaknesses to a byte in armor's affinity data instead:

Equipment (including weapons!) can have elemental weaknesses that apply to the actor (byte 0x1 in affinity data):
Start of Battle $9F440: 4178 0023 0B43 A08C 1FF0 A8FC 4178 0B43 A08D 1FF0 A3FC 4178 0B43 E08D 1FF0 9EFC 4178 0B43 208E 1FF0 99FC 4178 0B43 2222 AB54 28E0
During Battle $9DA2E: 4578 B88C 21F0 ADF9 4078 0543 B88D 21F0 A8F9 4078 0543 F88D 21F0 A3F9 4078 0543 388E 21F0 9EF9 4078 0543 2221 7554 29E0 0000

Monsters' basic attacks can be imbued with elements (byte 0x6 in monster elemental data):
(ASM) $7F7000: 5088 A083 9088 2084 9079 6076 3188 7046 0430 0047
(ASM) Link from $93156: 0148 2BF0 12FE 01707F08

Simple- this lets you have Fiery Hounds attack with a Fire element. Handle with care: elemental physical attacks do triple damage when hitting a weakness!

Reworked Boss Bit vs Status system
By default, enemies with the Boss Bit are protected against all forms of status (but Slow/Sap), and a few other things besides. This code moves it closer to the SNES system, where status spells only fail against a boss if the spell also has a boss bit.

New system: Boss bit only prevents status spells if they have a boss bit too!
Regular status resistances still apply, however.
Byte +$07 of spell data is the boss bit; if bit 00 is set, the spell will fail against enemies with the boss bit.
Status spell logic:
$8B02E: 5B49 084B 795A 0901 5B18 D879 0121 0140 0029 06D1 09E0
$8B054: 2890E008

Updating Bestiary screen:
$121D0: 00000000

That's all I've got for now, but I might have some other things to show at another time.  :cycle:


The European Version is normally considered to be the superior version all around. I'm surprised to know there is still so much wrong with it! Well we are glad to have a compatriot working at other angles to fixing FFIV and maybe we can learn a couple of things from one another.

Quote
Allow monsters to use their Magic Defence Multiplier
Normally, a monster's MDef Multiplier in the ROM is never written to their RAM battle data. To undo this, make the following change:
   $93082: Write 0000
Note that all monsters have zero Magic Evasion by default, so you'd need to give them values yourself.

Wait a moment... are you telling me that FF4A goes a Step further and outright removes Magical Defense Multipliers from enemies? Granted they are non functioning without Magic Evasion, but that... seems so bizarre. So does FF4A actually have the code to properly place Evasion and Magical Evasion in an enemy's stats or is That still busted from the SNES version?

Quote
Back Row functions almost properly
In the European version, melee weapons have no penalty to Attack or Precision for attacking from the back row, while the actual long-range weapons (Bows, Harps, Boomerangs and Whips) do receive a penalty. To fix:
      $8A858: 07D1
      $8A868: 00D0
 Currently my code fixes this by making your attack Back Row-Ok if you have any long-ranged weapons equipped, which means that Edge with a katana and boomerang can attack at full power from the back row. A more nuanced fix requires more space (and therefore repointing code).

Ugh... I had thought this was supposed to be fixed in the European and Japanese version? I guess not... This is a fine fix and the Boomerang/Katana mix makes it the same as what every version of FFIV has allowed. So don't worry. Even Square thought it was too much trouble to bother with.

Quote
Modular elemental weaknesses from armor
By default, armor that resists Ice or Fire is hardcoded to give a weakness to the opposing element, unless your equipment protects against Fire,Ice and Lightning all at once. This code ties elemental weaknesses to a byte in armor's affinity data instead:

Equipment (including weapons!) can have elemental weaknesses that apply to the actor (byte 0x1 in affinity data):
Start of Battle $9F440: 4178 0023 0B43 A08C 1FF0 A8FC 4178 0B43 A08D 1FF0 A3FC 4178 0B43 E08D 1FF0 9EFC 4178 0B43 208E 1FF0 99FC 4178 0B43 2222 AB54 28E0
During Battle $9DA2E: 4578 B88C 21F0 ADF9 4078 0543 B88D 21F0 A8F9 4078 0543 F88D 21F0 A3F9 4078 0543 388E 21F0 9EF9 4078 0543 2221 7554 29E0 0000

This is a really neat idea for those who don't want Weakness tied to basic Element. I may have to consider something similar for FFIV down the line. I've taken a look at your notes and FF4A has a boatload of more room for what to do with Weapons and Armors! FFIV has to rely on a stringent Bonus Index which forces down possibility by a fair amount and has a more open accuracy system where as FFIV has a basic (00 = 00 Accuracy) (63 = 99 Accuracy.) with only 8 Bytes to each weapon instead of 12 and the same 8 bytes for Armor compared to !?20?!. What I think I could do is tie it into that weird unused "item type identifier byte" which to my knowledge doesn't actually do anything. You also managed to put it on Weapons though which would be a much tougher sell all around in normal FFIV.

There is also some interesting notes on spells you have here! Again they've really increased the possibility there. Even allowing easy access to previous Routine-set statuses.

Quote
Monsters' basic attacks can be imbued with elements (byte 0x6 in monster elemental data):
(ASM) $7F7000: 5088 A083 9088 2084 9079 6076 3188 7046 0430 0047
(ASM) Link from $93156: 0148 2BF0 12FE 01707F08

Simple- this lets you have Fiery Hounds attack with a Fire element. Handle with care: elemental physical attacks do triple damage when hitting a weakness!

They removed this functionality? Yes, it was unused in SNES FFIV, but it still functioned to my knowledge if you implemented it on monsters.

I am looking forward to hearing more from you! Your notes may be of use to us here and vice versa.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 15, 2015, 12:46:33 PM
Quote

Wait a moment... are you telling me that FF4A goes a Step further and outright removes Magical Defense Multipliers from enemies? Granted they are non functioning without Magic Evasion, but that... seems so bizarre. So does FF4A actually have the code to properly place Evasion and Magical Evasion in an enemy's stats or is That still busted from the SNES version?
Yes, the physical Defence Multiplier, Evasion and Magic Evasion are all properly handled in the code; it's just the MDef Multiplier which is specifically coded to not do anything. Why they felt the need to do this when every enemy has a zero in their evades already, well, I couldn't say other than that TOSE didn't do a great job coding this port.

Quote
Ugh... I had thought this was supposed to be fixed in the European and Japanese version? I guess not... This is a fine fix and the Boomerang/Katana mix makes it the same as what every version of FFIV has allowed. So don't worry. Even Square thought it was too much trouble to bother with.
Yeah, the Euro/ JP 1.1 versions just broke the back row in the opposite way. Actually, looking at what the vanilla code does again, it only applies the Back Row penalty if you have two weapons and both of your weapons are back row OK.  :wtf:

So in reality, it's 'just' Bows/Arrows and Edge w/ two Boomerangs that get penalized. I have no idea why they coded it this way other than that they just reversed the check from the 1.0 version because they didn't understand the problem...

Quote
This is a really neat idea for those who don't want Weakness tied to basic Element. I may have to consider something similar for FFIV down the line. I've taken a look at your notes and FF4A has a boatload of more room for what to do with Weapons and Armors! FFIV has to rely on a stringent Bonus Index which forces down possibility by a fair amount and has a more open accuracy system where as FFIV has a basic (00 = 00 Accuracy) (63 = 99 Accuracy.) with only 8 Bytes to each weapon instead of 12 and the same 8 bytes for Armor compared to !?20?!. What I think I could do is tie it into that weird unused "item type identifier byte" which to my knowledge doesn't actually do anything. You also managed to put it on Weapons though which would be a much tougher sell all around in normal FFIV.
Armor and weapons both have the same number of bytes actually - 12 for weapon/armor data, 8 for elemental/status/racial data, and 20 more for general item data. Because of the way the weakness routine is set up it was no added challenge to allow weapons to give elemental weaknesses, it's an item in a slot just like shields.


Quote
Quote
Monsters' basic attacks can be imbued with elements (byte 0x6 in monster elemental data):

They removed this functionality? Yes, it was unused in SNES FFIV, but it still functioned to my knowledge if you implemented it on monsters.

It was indeed removed; fortunately there's a free byte in monster affinity data, so it's easy to add it back in.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 17, 2015, 07:57:52 PM
I spent some time yesterday figuring out how sprites and palettes are assigned to weapons and managed to make a lot of progress! I haven't figured everything out - I don't yet know how sound effects are selected when you attack - but I'm sure I'll get that done in time. Here's how it works, as I understand it:

When a character is going to physically attack, a table at 0x80CB434 is indexed to using the ID of your currently equipped weapon:

Code: [Select]
Weapon Animation Definitions
$00-01: Weapon sprite/palette ID; must be odd
Leads to two pointers in CAAD4 table...first is sprite data, second is palette
$02-03: Unused - may have been Custom sound effect ID?:
$0C1: Shuriken,Fuma Shuriken, Rising Sun, Scrap Metal
$0F9: Sword of Legend, Light Sword, Excalibur, Caliburn
$0FB: Defender
$0FD: Blood Sword
$0FF: Ancient Sword
$101: Avenger
$103: Gorgon Blade
$105: Holy Lance
$107: Gungnir
$109: Wyvern Lance
$10B: Sasuke's Katana, Mutsunokami, Assassin's Dagger
$10D: Mythril Knife, Mythril Sword
$10F: Dancing Dagger, Triton Dagger
$111: Kunai,Ahura
$113: Kikuichimonji
$115: Murasame
$117: Masamune
$04-05: Weapon hit gfx/palette ID (sword slash, claw hit...gfx that appear on the target)
$06: Weapon hit effect animation?
$07: Unused

Let's say Cecil is attacking with the Flame Sword (ID 0x1C). It's entry looks like this:
00 01 02 03 04 05 06 07
------------------------
6F 00 00 00 85 01 07 00

So, the Flame Sword's Sprite/Palette ID is 0x6F, and it displays weapon effect 0x185 on its targets with animation 0x07.

Sprite/Palette ID 0x6F is indexed in a pointer table at 0x80CAAD4, loading pointers at (0x6F+1)*4 and (0x6F)*4:
[(0x6F+1)*4 + 0x80CAAD4] = 0x81D8300
[(0x6F)*4 + 0x80CAAD4]   = 0x81D8244

At the offset 0x81D8244 is the sprite data for the weapon, LZ77 compressed. Here's what it looks like uncompressed:
(https://dl.dropboxusercontent.com/s/5ns71w2rnnsj5qh/%241D8244%20Knight%20Sword.png)
I have it using the Sword of Legend's palette here for clarity. Rearranged to start from a different offset, it looks like this:
(https://dl.dropboxusercontent.com/s/m7vpk7wffuc6cv2/Knight%20Sword%20Rearranged.png)
The green here (hex 0x160) is the transparent color for FF4a. The first two colored squares are unknown to me; they might not be graphical data at all.

Next we have the 16x16 sprite data for the weapon; the colored line below it is a list of each pixel color used in the sprite. Weapon sprites seem to support sixteen colors, but as you can see only seven colors are used (plus a transparent). The uncompressed data takes up 0xA8 bytes in total.

Offset 0x81D8300 contains the Flame Sword's Palette data, which looks like this:
Code: [Select]
03 00 00 00 10 00 00 00
6001 0000 FF7B 1F12 5D04 1600 7F03 5108 6001 6001 6001 6001 6001 6001 6001 6001

I'm not quite sure what the first line is for, but the second line is the 16-colour palette itself.

$02-03 in the table is strange; you can see that there's data there for some weapons, but this data is never read at any point. Who knows what exactly it was used for.

Anyway, now that we have the graphics for the weapon itself, we can do the same for the hit effects. $04-05 in the Animation Defenitions table is similar to $00-01, but $06 determines how those graphics are used. Unlike weapons, the hit effects are split up into multiple smaller tiles, so $06 here determines how to put them together and animate them.

The upshot of all this is that it would be pretty easy to change weapon graphics, and even add some more. Changing the number of items in the game would still be pretty time-consuming, owing to the number of tables needing to be expanded and to all the hardcoded ID-sorting nonsense in the code.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Grimoire LD on July 18, 2015, 01:07:06 AM
I imagine this is setup very similar to how it is in the SNES version as to my knowledge they would have had no need to change this set up, at least in its basic format. You may want to PM PinkPuff about it since it's been part of FF4kster since near the beginning.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 18, 2015, 01:15:46 PM
I'll hold off on that for now...I managed to find out where the sound effects for weapons are, they're in a completely different (and redundant...) table.

EDIT: Specifically the table at 0xF96CF; each byte represents the attacking sound effect of the weapon of the corresponding ID. Considering the animation table has a free byte by default, one wonders why they didn't put the sound identifier there.

One funny thing you can do is, since music and sound effects are on the same list, is have weapons that play music or cut the music entirely when you attack with them. The Bell of Silence could live up to its name!
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Bahamut ZERO on July 19, 2015, 11:07:32 AM
I'll hold off on that for now...I managed to find out where the sound effects for weapons are, they're in a completely different (and redundant...) table.

EDIT: Specifically the table at 0xF96CF; each byte represents the attacking sound effect of the weapon of the corresponding ID. Considering the animation table has a free byte by default, one wonders why they didn't put the sound identifier there.

One funny thing you can do is, since music and sound effects are on the same list, is have weapons that play music or cut the music entirely when you attack with them. The Bell of Silence could live up to its name!

Oh wow that's awesome! So weapon sounds go off of the weapon's ID on the list in FF4a? As far as I can tell (from playing with FF4kster so much), the SNES version plays it's weapon sounds based on what animation you set to the weapon. That's a really cool difference between the two versions if that's the case!
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 19, 2015, 01:30:09 PM
That's right - sound effects and animations are completely separate for weapons. I'm not sure if the same applies to spells, but at first glance they seem to have animation and sound tied together.

The advance version is generally more modular than its SNES counterpart; having eight megabytes of ROM instead of one (and that single MB divided into banks) let the devs be less frugal with their space. Not that the original with its enormous level-up tables was a masterpiece of efficient design itself...
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 20, 2015, 09:38:32 PM
While investigating how to break the 324 item limit, I think I've found the final piece to the weapon animation puzzle - namely, what swing animations a weapon uses. In general, the animation applied to a weapon's sprite is determined by the weapon's type in item data; that means, for instance, that any weapon with the Boomerang icon (type 0xB) will use the throwing animation.

The exception is axes; some axes use a throwing animation, but most don't. Animations for axes are handled by this code:

Code: [Select]
080ABD8E 0608     lsl     r0,r1,#0x18 @r0 = weapon type
080ABD90 1604     asr     r4,r0,#0x18
080ABD92 2C0C     cmp     r4,#0xC    @0xC = Axe weapon type
080ABD94 D11C     bne     #0x80ABDD0 @If not an axe, skip the following checks
080ABD96 8831     ldrh    r1,[r6]    @Loading attacker's weapon's Item ID
080ABD98 293A     cmp     r1,#0x3A    @ID #0x3A = Ogrekiller
080ABD9A D007     beq     #0x80ABDAC @If weapon is Ogrekiller, do not use
080ABD9C 2096     mov     r0,#0x96   
080ABD9E 0040     lsl     r0,r0,#0x1 @ID #0x12C = Gigant Axe
080ABDA0 4281     cmp     r1,r0     
080ABDA2 D003     beq     #0x80ABDAC
080ABDA4 2947     cmp     r1,#0x47 @ID #0x47 = Poison Axe
080ABDA6 D001     beq     #0x80ABDAC
080ABDA8 2948     cmp     r1,#0x48    @ID #0x48 = Rune Axe
080ABDAA D109     bne     #0x80ABDC0
NoThrow: @If weapon's Item ID was one of the above...
080ABDAC 4A03     ldr     r2,=#0x8FEC
080ABDAE 18A8     add     r0,r5,r2   
080ABDB0 6801     ldr     r1,[r0]   
080ABDB2 2205     mov     r2,#0x5 @Use the Broadsword animation
080ABDB4 4311     orr     r1,r2     
080ABDB6 6001     str     r1,[r0]   
080ABDB8 E004     b       #0x80ABDC4
080ABDBA 0000     .short 0x0000
080ABDBC 8FEC     .long 0x00008FEC
080ABDBE 0000
Throw:
080ABDC0 4322     orr     r2,r4      @If weapon ID was none of the above...
080ABDC2 603A     str     r2,[r7]    @Set animation to weapon's own (ie 0xC)
080ABDC4 4B01     ldr     r3,=#0x8FE8
080ABDC6 18E8     add     r0,r5,r3   
080ABDC8 8801     ldrh    r1,[r0] @Proceed to loading from weapon graphics table

In practice, the only axes that use the throwing animation are the Dwarf Axe and the unused Hand Axe. Why TOSE felt the need to hardcode this is a mystery to me...
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Grimoire LD on July 20, 2015, 10:37:51 PM
Wow just... wow. This was handled just fine in the original FFIV. This does imply that there might be more weapons which can be turned into throwing variants though for FF4A, even though FFIV handles thrown weapons of any kind just fine... so... I have no idea what TOSE were doing there.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 21, 2015, 04:03:48 PM
Ha, that's far from the worst thing TOSE has done just in terms of hardcoding item properties. In the US and JP 1.0 versions, all items over a certain ID were considered armor for the purposes of elemental/racial properties. A weapon like Loki's Lute, which was supposed to be effective against all creature types, instead protected the user against all creature types. It's still hardcoded in 1.1, just in a less broken way.   :sad:

I've laid down the framework for allowing a practically unlimited number of items in the game instead of 325. That involved repointing a lot of tables, but most significantly expanding the text table to record the names and descriptions of the new items I plan to add. I'm very thankful to Dragonsbretheren's resources and tutorial on this subject; I might have resorted to using a hex editor otherwise.  :scared:

That all means I won't have to consider cannibalizing the Lunar Ruins equipment. Monster drops and equipment selection in general should be more interesting in my planned hack; I plan to make the majority of monsters drop at least one interesting item.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Grimoire LD on July 21, 2015, 05:28:49 PM
Ha, that's far from the worst thing TOSE has done just in terms of hardcoding item properties. In the US and JP 1.0 versions, all items over a certain ID were considered armor for the purposes of elemental/racial properties. A weapon like Loki's Lute, which was supposed to be effective against all creature types, instead protected the user against all creature types. It's still hardcoded in 1.1, just in a less broken way.   :sad:

I've laid down the framework for allowing a practically unlimited number of items in the game instead of 325. That involved repointing a lot of tables, but most significantly expanding the text table to record the names and descriptions of the new items I plan to add. I'm very thankful to Dragonsbretheren's resources and tutorial on this subject; I might have resorted to using a hex editor otherwise.  :scared:

That all means I won't have to consider cannibalizing the Lunar Ruins equipment. Monster drops and equipment selection in general should be more interesting in my planned hack; I plan to make the majority of monsters drop at least one interesting item.

That is some very impressive work! Unfortunately it seems nearly impossible to do for the SNES FFIV, but I could see this being a possibility with FF4A due to it having over 255 items to begin with.

That does remind me though... how many drop tables are there in FF4A? In the SNES version there were only 64 because the table was tied to percentage drops ( 00 - Never, 40, 5% - 80 - 25% C0 - 100%) Was it the same in FF4A? Granted you can use events a bit more liberally I imagine, also breaking the 255 limit.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 21, 2015, 06:21:10 PM
Each monster has its own drop table in FF4A, as well as its own AI index. So you have a lot of monsters with a 0% chance to drop a Potion,Potion,Potion or Potion. Each monster's drop table has a byte listing the probability of dropping any item; by default it only allows four numbers for drop chance (0%,5%,25%, and 100%), so I've had to change the related code to allow additional possibilities.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Grimoire LD on July 21, 2015, 08:17:23 PM
Each monster has its own drop table in FF4A, as well as its own AI index. So you have a lot of monsters with a 0% chance to drop a Potion,Potion,Potion or Potion. Each monster's drop table has a byte listing the probability of dropping any item; by default it only allows four numbers for drop chance (0%,5%,25%, and 100%), so I've had to change the related code to allow additional possibilities.

Hmm, that is strange...  so the table itself now decides the chance to drop, rather than the drop byte assigned to monsters in default FFIV? Also they all have their own unique AI Indexes? But to my knowledge no enemy really deviates from its basic AI index as laid down in the original FFIV, right? (except for new enemies, of course)
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 21, 2015, 09:38:02 PM
Hmm, that is strange...  so the table itself now decides the chance to drop, rather than the drop byte assigned to monsters in default FFIV? Also they all have their own unique AI Indexes? But to my knowledge no enemy really deviates from its basic AI index as laid down in the original FFIV, right? (except for new enemies, of course)

The overall AI of monsters is the same (as far as I know), but the AI codes themselves are different; there's a code for a generalized status check for instance:

Code: [Select]
$B1 TT CCCC PPPP
-If has any bits set within CC CC of type TT, move to point PPPP in AI script
-Usually used for Confusion routines (enemies use normal battle scripts to act when Confused)
-Also used for Egged monsters - Egg status does not automatically set script
Values for TT:
-0x0: Check normal status
-0x1: Check special status (Barrier,Boss,Reflect,etc)
-0x2: Check turn status bits (was attacked, immune to damage)
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Grimoire LD on July 21, 2015, 10:20:14 PM
Hmm, that is strange...  so the table itself now decides the chance to drop, rather than the drop byte assigned to monsters in default FFIV? Also they all have their own unique AI Indexes? But to my knowledge no enemy really deviates from its basic AI index as laid down in the original FFIV, right? (except for new enemies, of course)

The overall AI of monsters is the same (as far as I know), but the AI codes themselves are different; there's a code for a generalized status check for instance:

Code: [Select]
$B1 TT CCCC PPPP
-If has any bits set within CC CC of type TT, move to point PPPP in AI script
-Usually used for Confusion routines (enemies use normal battle scripts to act when Confused)
-Also used for Egged monsters - Egg status does not automatically set script
Values for TT:
-0x0: Check normal status
-0x1: Check special status (Barrier,Boss,Reflect,etc)
-0x2: Check turn status bits (was attacked, immune to damage)

Ah hah... so they fixed some of the glaring inefficiencies of the original AI system which never actually looks for "was attacked" but instead looks to see what command was used. I can see how this one was at once simplified, and expanded. Well at least TOSE did something right there.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 22, 2015, 10:46:30 PM
It's worth noting that the B1 conditional isn't generally used to check if a monster was damaged; usually B6 is used:

Code: [Select]
$B6 XXXX YYYY
-Checks +$44 in the monster's battle data; ANDS with XXXX
-0x0001 = hit by Attack
-0x0002 = Hit by Magic (black?)
-0x0040 = Hit by Jump?
-0x004F = Hit by anything
-0x0100 = HP damage?
-If check passes, move to YYYY in script

In related news, I had thought I'd cleared up every limit on text indices, but when I tested chests this happened:
(http://puu.sh/j9qok/3aebc48493.png)

Turns out that at the start of the text pointer table, there's a halfword which defines the maximum text index; indexes past that don't read end codes properly when used in dialogue, leading to what you see above. But now I've fixed it, and can do things like this:
(http://puu.sh/j9qMT/d5a5835c33.png)
Gotta say, it's a good feeling to finally have this working perfectly. :childish:
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Grimoire LD on July 24, 2015, 10:07:16 AM
I like the look of that! Higher HP Zombie (attack probably a little too low) New item with the Ghoul Ring, all in all this looks pretty grand! Way to actually use the new space that FF4A had!
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 24, 2015, 12:47:51 PM
18x2 Attack is a little low, but Zombies have Dark-element physicals now, so Cecil ends up taking between 20-60 damage from each one. I also adjusted the Back Row modifier: instead of doubling defence, it halves the attacker's Attack Multiplier (to a minimum of 1), so the mages take about 20-32 damage even in the back row. I guess it couldn't hurt to bump it up a bit. Basic zombies aren't really supposed to be offensive threats anyway, the later types will be much nastier.

Now that I've changed the back row mechanics and added the new items I have everything up to Octomammoth done; Octo himself has a new AI routine designed to make him a threat for the entire course of his fight instead of being a pushover once you hit him a few times. I might release a test patch if there's interest.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Grimoire LD on July 24, 2015, 02:31:34 PM
I think there would be some interest. This is the EU version that fixed the glaring ATB bug, right?
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 24, 2015, 03:36:47 PM
It is, yes. I can't think of any reason to use the 1.0 version, given the option.

If you want to give it a try, here's a UPS patch and readme (https://www.dropbox.com/s/x95ogtesrj75ju4/FFIVa%28E%29%20hardtype.zip?dl=1). Give me your thoughts if you give it a try!
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 25, 2015, 04:15:28 PM
I've updated the notes download in the first post; it includes more info on stat calculation, status magic, and level calculations. One interesting thing is randomized levels; the level at which to start using random levelups is defined by a single byte. You could have everybody use random levels from the moment they join if you wanted.

Poison status is a bit of a joke in FF4...it takes an age for it to do anything, and even if it didn't everything you might want to use it on is immune to it anyway. It's more notable for being able to block other statuses than for anything it does on its own. So I'm changing the formula that determines how much time passes between Poison damage hits. The old formula was this:

Code: [Select]
min( [(A+20)*Agl factor]/16 ),255Where A is Agility for players, and (Level+10) for monsters. The poison timer for a monster, assuming its Agility factor is normal, is at least 20 and as many as 119 ticks. Since bosses start at Level 10 and only go up from there, poison status is pretty useless against them. The new formula is this:

Code: [Select]
[(A/4)+15]*Agl factor/16With this formula the Poison timer is between 17-42 ticks for monsters, and 15-39 ticks for players. Much more useful, and much more deadly when used against you.

The poison spell itself will be useful beyond setting the status, as well - it's Dark-elemental now, and a little more powerful than the basic Fire/Ice/Lightning magic, at the cost of being more MP-intensive and inaccurate.

I'm also toying with something a little more ambitious: making Agility static for all characters. All characters, with some exceptions (eg Tellah, Rydia's first levels), would never increase Agility on level up, though their speed relative to each other would be the same as normal. The only way to modify a character's Agility would be through equipment choices -  Agility-modifying equipment would be more common of course. This would mean that gaining levels wouldn't help you outspeed a boss, and their Agility scores could be more finely tuned. It could be an interesting twist on the usual mechanics.

Since some damage formulas rely on Agility, they'd have to be changed to account for it being a static stat starting in the 30-70s range. Attack Multipliers might be calculated like this:

Atk M = 1 + (Str*Agl)/256

Which gives a very similar progression as the original game; Cecil gains his third multiplier at Level 15-17 under both systems.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Grimoire LD on July 25, 2015, 07:19:02 PM
Ah! You found what Avalanche had discovered for SNES FFIV and what I completely recorded. Yes FFIV uses the seemingly exact system. I fixed it by making it the same timer as Gradual Petrification, which as I recall was removed (the gradually petrifying portion) in versions past the SNES version, anyhow. I like the changes to Poison, PinkPuff did a similar thing in Unprecedented Crisis and I guess the idea came from FFVI and FFT where Poison spells are also normally what would be considered Dark Elemental.

You're telling me that they simplified the Random Levelup condition into a Single Byte?! That is infuriating! FFIV SNES jumps through several hoops and I still don't fully understand it! Does FF4A have a better Level up system all around? As in no more TNL and all of that bizarre activity?

So I've started to play your mod and I've noticed one glitch so far, when you go to save the game, the game shows what looks to be some programming comment in the overwrite warning message. This may be an emulator matter though and it's not impactful or anything anyhow.

It would appear as if SwordRats were buffed significantly having more than 40 HP and necessitating a Jump to defeat them without a punishing counter.

Steel Quill, eh? Now I might have to grind for that since it's just an uncommon drop. Haha, how lucky you are to have all of this space!

Oh, the Dark Sword can Blind now, quite nice!

Wow. HellDivers do Not play around! That was Combat Boost level of damage there, haha!

I must say I do appreciate your changes to the backrow. Instead of every attack being a "Miss!" It's now reduced damage, which feels much more appropriate!

I do not know what TOSE were on when they made the formations in this... every one so far defaults to the middle of the line, instead of the front!

What you have in mind for Agility is very ambitious and I would be curious to see how that ends up!

Well, still grinding for that Quill Blade, but its good to see that I take a few knicks here and there instead of 1 to 10 damage from every attack from anything for the vast majority of the start of the game.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 25, 2015, 08:30:36 PM
You're telling me that they simplified the Random Levelup condition into a Single Byte?! That is infuriating! FFIV SNES jumps through several hoops and I still don't fully understand it! Does FF4A have a better Level up system all around? As in no more TNL and all of that bizarre activity?

It's still got 16 bytes for every level a character can reach, but there's no such thing as TNL; each level in the ROM is defined by the total amount of experience needed to reach it, and a character's current EXP is stored in RAM as their absolute amount.

Glad to hear you're enjoying the mod! That's a strange glitch with the save menu...probably an arcane result of the text table repointing. I'll make sure to fix that.

Don't be too fussed about the Steel Quill; it's a good non-elemental weapon but doesn't outclass the Shadow Blade, and Gatlingers will have much better chances of dropping it when I edit their data. The general pattern for most rare drops is that they'll be available as a very rare drop before the area they're tuned towards, and then some time later as a rare or uncommon drop, or as a treasure. Some of them will just be hard to find, though!

I wanted to make the early enemies at least potentially dangerous; Helldivers won't wipe you if you know what they're doing, but they're a worthy foe now. Sword Rats are the same idea; they're there to make the early portion of the game a bit more thoughtful than hitting Attack.

The Dark Sword change lends some utility to Cecil, since he was otherwise pretty straightforward in how he was used. Dark Knights being adept at debilitating their opponents also helps contrast the class with the Paladin.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Grimoire LD on July 26, 2015, 11:10:22 AM
It's still got 16 bytes for every level a character can reach, but there's no such thing as TNL; each level in the ROM is defined by the total amount of experience needed to reach it, and a character's current EXP is stored in RAM as their absolute amount.

Glad to hear you're enjoying the mod! That's a strange glitch with the save menu...probably an arcane result of the text table repointing. I'll make sure to fix that.

Don't be too fussed about the Steel Quill; it's a good non-elemental weapon but doesn't outclass the Shadow Blade, and Gatlingers will have much better chances of dropping it when I edit their data. The general pattern for most rare drops is that they'll be available as a very rare drop before the area they're tuned towards, and then some time later as a rare or uncommon drop, or as a treasure. Some of them will just be hard to find, though!

I wanted to make the early enemies at least potentially dangerous; Helldivers won't wipe you if you know what they're doing, but they're a worthy foe now. Sword Rats are the same idea; they're there to make the early portion of the game a bit more thoughtful than hitting Attack.

The Dark Sword change lends some utility to Cecil, since he was otherwise pretty straightforward in how he was used. Dark Knights being adept at debilitating their opponents also helps contrast the class with the Paladin.

Bah, if only we could break this TNL garbage for FFIV SNES, since it seems they just found a way to ignore it all together for FF4A.

Ah? I had assumed that because it was second on the list it was the SwordRat's uncommon drop? Is that not the case then? Good to know Gatlingers will have a better chance to drop it. I did pick up a Goblin Summon through all of that grinding though so I guess it wasn't a complete waste of time.

The Mist Dragon at least dealt damage, not sure about its speed though, granted I was Level 15 due to all of the grinding though. I also like how you have Titan outright kill Cecil and Kain, I mean, it makes sense instead of the 70-80 it deals in other versions.

Aside from being slightly faster the Soldiers and General did not seem much more powerful.

Hmm, Goblin Punch still seems useless and SandWorms still deal only 5 or so damage with Cyclone (because it's tied to their Max HP, if I recall right)

Did you increase the power of the Rod's magic attack or did this version do so? It dealt 60 damage to a normal foe!

Umm... Desert Sahagins have 4 Attack... I cannot assume that was the intention. Hundlegs only have 11 at that measure... this does go up to OctoMammoth, right?

Killer Fish have disappointing Attack stats as well only dealing 5 or so damage to a Level 5 Rydia.

Everything here seems to have 11 Attack which is normal as far as FFIV is concerned but that x2 multiplier for them does not appear to be cutting it.

I like the chance of a Polymorph Rod from the Gigantoads, nice touch!

Alright! Now that's a nice change of pace. The Toadgre's can cast Blizzara which is high damage for this point, but survivable and Toad (which they did cast originally anyhow) can be quite deadly. Well conceived.

Toadgre's I feel have the appropriate strength, if not a little less strength than this area should provide. I wonder if that Lilith's Kiss is a 1/8 item or much lower...

For 2 MP Poison deals a pretty good amount of damage!

Ah, Zombies poison, very nice. Did you also include your ffaster Poison? Since I noticed that Rydia actually took a measure of Poison damage during the fight. I like their boosted stats as well.

Was not expecting Silence from Flans... do you sell Echo Herbs at early shops then? Since in the normal game they aren't available until Mysidia as I recall.

Alligators are more than respectable foes with 48 Attack but I imagine that they probably have lowish Accuracy.

Seems like Mini-Mage's are still a bit tricky.

Ah, the dummied Hand Axe, an interesting place to put it.

Only the Hades Armor here? Interesting...

The Hand Axe is a legitimate thrown weapon, nice touch. Though I'm not sure giving the Dark Knight even more survivability with background usability as being such a great idea. I guess I'll see.

Did they change the way Magic Items worked in FF4A?  I noticed that Tellah seems to be dealing more damage with the Rod than Rydia was doing.

And Octomammoth is down! I like what you did here. As you fight him his attack mulitpliers increase. At the start I used Tellah for Blink on Rydia mostly so she can hammer away at him with Chocobo and while he started to deal more and more damage we were able to keep pace and defeat him. A very satisfying boss.

All in all this is a promising start and I have to give TOSE credit where credit is due, FF4A does feel much faster and more fluid than its SNES counterpart, giving it a more frantic feel which is missing from the SNES version.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 26, 2015, 12:10:24 PM
Ah? I had assumed that because it was second on the list it was the SwordRat's uncommon drop? Is that not the case then? Good to know Gatlingers will have a better chance to drop it. I did pick up a Goblin Summon through all of that grinding though so I guess it wasn't a complete waste of time.

Did you increase the power of the Rod's magic attack or did this version do so? It dealt 60 damage to a normal foe!
The ingame bestiary in this version condenses multiple drops of the same item into one entry; the Sword Rat's actual drop list is Gold Needle x3/Steel Quill. That is a little confusing, so I might try to remove that behaviour.

The Rod's magic works a little differently than in vanilla; the spell it casts has only 3 base power, but the Rod itself has a very high fixed multiplier, so it's supposed to be good against enemies with low magic defence. That said, it seems like FF4a multiplies a spell's power by 4 before subtracting Magic Defence, so it might be a bit overtuned; I'll reduce it to 2 (8) base power.

Everything here seems to have 11 Attack which is normal as far as FFIV is concerned but that x2 multiplier for them does not appear to be cutting it.

I like the chance of a Polymorph Rod from the Gigantoads, nice touch!

Alright! Now that's a nice change of pace. The Toadgre's can cast Blizzara which is high damage for this point, but survivable and Toad (which they did cast originally anyhow) can be quite deadly. Well conceived.

Toadgre's I feel have the appropriate strength, if not a little less strength than this area should provide. I wonder if that Lilith's Kiss is a 1/8 item or much lower...
I could have sworn I increased everything's Attack in the desert and Underground Waterway. I must have missed it then; they will definitely become more threatening than they used to be. Toadgres could maybe use some more attack so that they're more of a threat earlier in their fights - they only use Blizzara when they're alone currently.

The faster Poison status isn't in yet (nor is the more expensive Poison spell). Echo Herbs aren't sold in shops yet which is an oversight on my part; I'll add some Echo Herbs to Kaipo's shop in the next version.

The Hand Axe is a legitimate thrown weapon, nice touch. Though I'm not sure giving the Dark Knight even more survivability with background usability as being such a great idea. I guess I'll see.

Did they change the way Magic Items worked in FF4A?  I noticed that Tellah seems to be dealing more damage with the Rod than Rydia was doing.
The Hand Axe reduces your Agility by 3 and only has 70% accuracy. The concept for the Hand Axe was that you'd only use it when the Shadow Blade couldn't do anything or when staying in the front row was too dangerous for Cecil. Maybe the current penalties aren't enough of a tradeoff, though...

Spells cast from items still have a fixed spell multiplier. It was probably just random variance, some monsters have Magic Evade now.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 26, 2015, 06:53:41 PM
I'd finished everything up until Antlion but had a hard time thinking of a good script for him...now I've got a good idea.

I've created a new AI command that lets a monster pick between one of three spells (+basic physical) randomly:
Code: [Select]
@New AI command that randomly selects one of three spells, then casts it
@Exceptions are IDs 0xC0 and 0xC1, which are linked to the two types of physical attacks instead
.thumb
push {r4,r5,r14}
mov r4,r0
mov r5,r1 @r5 = command parameter offset
mov r0,#0x3 @Picking one of three commands
ldr r2,RandomNum        @Generates a random number between 0 and 2
bl Longcall
ldrb r1,[r5,r0] @Loading spell ID to use
cmp r1,#0xC0 @(spell IDs 0xC0 and 0xC1 are for Red and White Fangs - no loss)
bne Physical_2_check
ldr r2,Physical_1
b Branch
Physical_2_check:
cmp r1,#0xC1
bne Spell
ldr r2,Physical_2
b Branch
Spell:
ldr r2,SpellCast
Branch:
bl Longcall
cmp r0,#0x0
beq Jump_false @Proceed to the next command
Jump_true:
mov r0,#0x0
strb r0,[r4,#0x19] @Not a consecutive command
b Store_jump_bit
Jump_false:
strb r0,[r4,#0x19] @The spell cast has already specified where to go next
mov r0,#0x1
Store_jump_bit:
strb r0,[r4,#0x1A]
pop {r4,r5}
pop {r0}
bx r0

.align 2
RandomNum:
.long 0x0805AF55
SpellCast:
.long 0x080863DD
Physical_1:
.long 0x0808642D
Physical_2:
.long 0x08086409
Longcall:
bx r2

These two things might be related.  :happy:
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Grimoire LD on July 26, 2015, 08:37:47 PM

The ingame bestiary in this version condenses multiple drops of the same item into one entry; the Sword Rat's actual drop list is Gold Needle x3/Steel Quill. That is a little confusing, so I might try to remove that behaviour.

Might not be a bad idea, I can see why they did it, but it is very misleading.

Quote
The Rod's magic works a little differently than in vanilla; the spell it casts has only 3 base power, but the Rod itself has a very high fixed multiplier, so it's supposed to be good against enemies with low magic defence. That said, it seems like FF4a multiplies a spell's power by 4 before subtracting Magic Defence, so it might be a bit overtuned; I'll reduce it to 2 (8) base power.

Multiplies a Spell's Power by 4? Hmm... I wonder how that differs from the original? I know there is something similar that happens there as I recall.

Quote
I could have sworn I increased everything's Attack in the desert and Underground Waterway. I must have missed it then; they will definitely become more threatening than they used to be. Toadgres could maybe use some more attack so that they're more of a threat earlier in their fights - they only use Blizzara when they're alone currently.

The faster Poison status isn't in yet (nor is the more expensive Poison spell). Echo Herbs aren't sold in shops yet which is an oversight on my part; I'll add some Echo Herbs to Kaipo's shop in the next version.

Well I do have a savestate right before Mist, so I could run through again, eventually. Ah, so the new
poison isn't implemented yet.


The Hand Axe reduces your Agility by 3 and only has 70% accuracy. The concept for the Hand Axe was that you'd only use it when the Shadow Blade couldn't do anything or when staying in the front row was too dangerous for Cecil. Maybe the current penalties aren't enough of a tradeoff, though...

Spells cast from items still have a fixed spell multiplier. It was probably just random variance, some monsters have Magic Evade now.

Right, Magic Evade is important, to keep in mind. I suppose it was just randomness. I think the -3 Agility is a good idea, but in reality I didn't notice too much of a difference in attack between the two.

I'd finished everything up until Antlion but had a hard time thinking of a good script for him...now I've got a good idea.

I've created a new AI command that lets a monster pick between one of three spells (+basic physical) randomly:
Code: [Select]
@New AI command that randomly selects one of three spells, then casts it
@Exceptions are IDs 0xC0 and 0xC1, which are linked to the two types of physical attacks instead
.thumb
push {r4,r5,r14}
mov r4,r0
mov r5,r1 @r5 = command parameter offset
mov r0,#0x3 @Picking one of three commands
ldr r2,RandomNum        @Generates a random number between 0 and 2
bl Longcall
ldrb r1,[r5,r0] @Loading spell ID to use
cmp r1,#0xC0 @(spell IDs 0xC0 and 0xC1 are for Red and White Fangs - no loss)
bne Physical_2_check
ldr r2,Physical_1
b Branch
Physical_2_check:
cmp r1,#0xC1
bne Spell
ldr r2,Physical_2
b Branch
Spell:
ldr r2,SpellCast
Branch:
bl Longcall
cmp r0,#0x0
beq Jump_false @Proceed to the next command
Jump_true:
mov r0,#0x0
strb r0,[r4,#0x19] @Not a consecutive command
b Store_jump_bit
Jump_false:
strb r0,[r4,#0x19] @The spell cast has already specified where to go next
mov r0,#0x1
Store_jump_bit:
strb r0,[r4,#0x1A]
pop {r4,r5}
pop {r0}
bx r0

.align 2
RandomNum:
.long 0x0805AF55
SpellCast:
.long 0x080863DD
Physical_1:
.long 0x0808642D
Physical_2:
.long 0x08086409
Longcall:
bx r2

These two things might be related.  :happy:

I actually hacked such a thing for default FFIV as well, tying it to an unused skill and giving most monsters four possible random actions to perform, even bosses. It did have limits though. It could only be single target.

But... then I got a bit crazy and worked myself into a corner with Job Classes and 90 new spells I put a lot of work on my plate and I couldn't actually complete that project. I could easily salvage the AI part, since it was meant to work in tandem with Chillyfeez's Enemy Leveling patch.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 26, 2015, 09:54:13 PM
(bestiary talk)

Might not be a bad idea, I can see why they did it, but it is very misleading.
It's done; it turned out to be another one-byte fix. I also fixed the save menu text error - that one was a find/replace mistake from when I was formatting the game script for reinsertion.

Right, Magic Evade is important, to keep in mind. I suppose it was just randomness. I think the -3 Agility is a good idea, but in reality I didn't notice too much of a difference in attack between the two.
I might take the Hand Axe to -5 Agility, then. Lowering Agility will also indirectly reduce its damage later since you won't have 16 Agility for an additional attack multiplier; makes it not so powerful by Mt. Hobs. Of course I would appreciate it if you ran through the updated Kaipo/Waterway section, but feel like you're obliged to do it; ROM hacking is a hobby in the end after all.

I actually hacked such a thing for default FFIV as well, tying it to an unused skill and giving most monsters four possible random actions to perform, even bosses. It did have limits though. It could only be single target.

But... then I got a bit crazy and worked myself into a corner with Job Classes and 90 new spells I put a lot of work on my plate and I couldn't actually complete that project. I could easily salvage the AI part, since it was meant to work in tandem with Chillyfeez's Enemy Leveling patch.

Yeah, under my system all three possibilities must share the same targeting. I ought to make a variant of this command that has the monster pick between three spots in the script to jump to.

I've seen/played some of your Combat Boost mod, I thought it was quite good. The new character commands were especially impressive and fun to play around with. It's too bad you got burned out on it; I can sympathize with giving yourself too much to handle.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Grimoire LD on July 26, 2015, 11:06:07 PM
Oh no, Combat Boost is alive and well. That's been making progress here and there. (Just I want to finish the Underworld before release as I had finished the Overworld the first time before an official release). It was my side project which... sort of became the main project for a while and I did really think about combining Combat Boost with it at first, but then I realized how much of a headache that would have been so I thankfully abandoned that line of thought before anything of the sort. Good thing I didn't. Combat Boost keeps things at a manageable level for me.

I think -5 Agility is a much better compromise and I would be glad to play through the desert and the Old Waterway again with properly boosted foes though at the same time don't forget to make risk hold reward. You may want to boost Exp. from enemies at some points so the game feels balanced and doesn't require grinding off of trash forever to survive later encounters.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 27, 2015, 08:44:07 PM
That's good to hear. I'll look forward to the next release then.

I'm still working on the Antlion battle, but once I have it finished I'll put out a new patch. The patch after that will cover up to Fabul or Mt. Ordeals. Difficult enemies will definitely be worth more exp and/or gil than they used to be to make them worth fighting. I don't want to make grinding necessary at any point, though it won't be pointless.

The prospective fixed Agility change would help there once I get around to it eventually; even if you're facing a tough boss ten levels too early, at least it won't be getting double turns on you.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Grimoire LD on July 27, 2015, 09:42:51 PM
That's good to hear. I'll look forward to the next release then.

I'm still working on the Antlion battle, but once I have it finished I'll put out a new patch. The patch after that will cover up to Fabul or Mt. Ordeals. Difficult enemies will definitely be worth more exp and/or gil than they used to be to make them worth fighting. I don't want to make grinding necessary at any point, though it won't be pointless.

The prospective fixed Agility change would help there once I get around to it eventually; even if you're facing a tough boss ten levels too early, at least it won't be getting double turns on you.

I can't believe I never thought about that but a boss with too high Agility can really screw up a run that doesn't grind. That's something I never considered but it seems so reasonable and basic. I can understand now why you would prefer to remove that from the equation!
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 27, 2015, 10:51:03 PM
That's the idea; playing FF4 DS, when I first entered the Tower of Babel I recall being a little put out at my party being wiped by a Flame Hound encounter before I could do anything.

I discovered two interesting details of FF4's battle mechanics while fiddling around with the Basilisk: Gradual Petrification has three stages, not two, and the Petrification timer only matters for this third stage - it still counts down but doesn't do anything. So for it to be lethal you need to sting your target at least three times before they can be petrified - and the timer itself is very long once you get up in levels. I'm going to change that so that each stage can be advanced to the next through the timer, which will be shorter too. It might be cause for concern now!

The other thing is that Edward's Salve/Heal command doesn't exactly use a Potion on your whole party; it subtracts a Potion but casts Cure instead. When I revamp Salve to scale better I'll have to figure out how that all works.
Title: Re: FF4 Advance (E) Hacking Notes
Post by: Kea on July 28, 2015, 03:08:46 PM
Alright, here is the new version which includes changes up to Antlion, updated enemies in the desert and Underground Waterway, and a slightly tweaked Octomammoth.

Download (https://www.dropbox.com/s/x95ogtesrj75ju4/FFIVa%28E%29%20hardtype.zip?dl=1)
The OP has been updated with this link and will always be current from now on.

I've also started taking advantage of two-line descriptions for equipment to explain their properties ingame. Observe:
(https://dl.dropboxusercontent.com/s/54ldvu7botzn4pt/ExpItemDescrs.png)

EDIT: Updated the download to fix a small bug: Antlion (and any boss) was immune to statuses applied by weapon hits due to a separate boss bit check; this check has been removed and so it is possible to apply Blind and Confusion to him.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on July 29, 2015, 01:06:52 AM
I am so envious of you that you have two lines to write a description and likely unlimited space! Haha!

So I decided to start a new game all in all, as I feel I may have grinded a little too much, not to mention you hadn't actually messed with Agility at the time (still not sure if you have). Interesting to see that you're reimplementing Gradual Petrification's timer. I think it was disabled because the GBA version gives no visual clarification of what stage it is in.

So starting up I see you put Echo Herbs into the shops now, great.

Any thoughts on what to do with the Dwarven Bread? As I'm sure you're aware Sight is useless.

Wow! Just wow! First battle I get the Goblin summon!

And it still looks to be it's rarest drop... hah.

Good to see the Bestiary is now showing the actual drops. Terrific work!

Eh? Sword Rat's are referred to as Magic Beast, is that a new race you made out of an existing one?

Heh, I like how the Eyemoths have an attack called Poison Powder which Blinds! I'm not sure if that's an unfinished change or if it was always like that.

Last time I fought the Mist Dragon I was at a grinded Level 16, this time I am at Level 12, let's see how different it turns out...

That's an odd change from the SNES version... when you reach the Mist Dragon, Suspicion is supposed to play, it adds tension to the scene. This is absent in FF4A for some reason.

Not very different. Ah well, still dealt 40 or so damage per hit and I imagine ColdMist is now much more powerful.

There we go! Desert Sahagins and Hundlegs now have respectable strength, dealing a decent 30-40 damage to Cecil per hit. Quick question though, does FF4A still use that awful attack/defense/magic defense table that FFIV uses or do they use their wider space to just put that into the monster's stats?

Barely survived through the desert! And that's how it should be. There is such a greater feeling of accomplishment when you face comparable odds.

Wow! The Baron Soldiers do not fool around! This is Combat Boost level of trickiness right here, hehe. Thank goodness for Hourglasses!

Did you increase the Exp. gain from the solo fight? I have to admit taking out the General with even just one soldier was rather tricky after the Hourglass wore off!

Alright, now I always use this time for a little bit of mandatory grinding for Rydia up until Level 10 so she can survive at a decent tick. It should be a more fulfilling task this time around.

Oh... I just noticed another significant change... there are no Phoenix Downs at shops... Is this an FFIII reference and will I need to be very careful with the use of my current Phoenix Downs?

Maybe it's because I just got done dealing 120 or so damage to the Sand Worm but the Cyclone only did one damage.

The Desert Sahagins with 4 Magic Defense are being dealt 48-84 damage with the Rod.

Geez! I go to cast Thunder on all Vile Shells to check the damage and I get hit with a new counter which puts my party to sleep! So well devised! I never noticed, until I saw that you gave them an attack called "Lick" that the thing sticking out of the shell was a tongue! I thought it was a claw or something.

An interesting little fact, you can run while your entire party is asleep in FFIV but not in FF4A meaning that it is likely a bug that you can do so in the original.

I am also glad to see some actual defense put on the Vile Shell.

Killer Fish at 17 Strength (possibly 3 multipliers?) are a much worthier foe now. They are designed to be the opposite of the Vile Shell and possess no defense but have high Magic Defense for this point, how interesting...

Rydia is now Level 10 so it is time to move on.

Tents are not sold in Shops anymore either... I will have to be careful from hereon out, thank goodness I've been healing at the Inn. This does make those lucky drops of Tents and Phoenix Downs from foes all the more meaningful though and it adds back in a bit of the survival aspect of the earlier FF's.

Yes, I just fought another Sand Worm who had a bit more HP, maybe 30 or 40 left and he dealt 14 and 16, I imagine it will be quite high if it ambushes you!


To foes with higher Magic Defense the Rod deals 24-42 which is a very fair amount for it being defended against. Good balancing.

You raised Life's MP cost to 20, making it more inline with FFIV DS, interesting choice and makes sense with the rarity of Phoenix Downs.

Do Vile Shell's secretly resist Lightning or something? It says they're weak to it, but it doesn't deal nearly as much damage as it does to the Killer Fish who have a much higher Magic Defense.

...Did Vile Shell's just react with Drain to Dark Wave? Oh my... I'll need to be more careful!

Well that was quite a joy, I don't think Tellah has ever nearly run out of MP on the way to the first save point!

Incidentally that water drop effect may be the only sound that is better on FF4A...

Gigantoad's seem dangerous. I didn't really give them a chance to fight, but the one turn one got did use Toad. But that may be because they were on their own.

Toadgre's have a bit more HP, a possibly random AI where they will use either Toad or Attack (maybe Blizzara's in there?) and have decent defenses all around. A foe to be dealt with immediately with its weakness.

I noticed you increased the MP cost of Chocobo as well, it seems you may have made Goblin a twinge better, it's difficult to say.

So I dealt with TinyMage's and Sahagins. TinyMage's real weakness if Dark Wave, they have no counter to it thankfully but if you give them time they will wreck the party with hard hitting Thunder spells!

Sahagin's have no treasure? That's... a little odd.

Wh-wha? Rod deals 1 damage to Zombies...? Did... Cecil just deal 105 damage with a Critical Hit to the Backrow Unarmed? I take it you changed the way Unarmed works then? Maybe they defended against the Rod so well because they have 12 Magic Defense?

Hand Axe is now a little weaker than the Shadow Blade and it reduces Agility by 5 making it a risk to equip. A much better tradeoff.

...Looks like Bomb Fragments were made more powerful, dealing 800-1000 damage to Mousse, though they may be x4 weak to Fire.

Hmm... is it such a good idea to have some of these rare drops be so worthless? It is something I tried to do with Combat Boost was to have every foe a drop worth getting. To me there would be no benefit to fighting Red Mousse again when they have nothing I'd actually want. Though I imagine a lot of this is still in the planning stages and more normal type foes will end up having a drop table more akin to the Sword Rat with a unique or powerful item.

Well I stupidly used magic on weakened TinyMage's and it wasn't enough to take them out so they proceeded to Osmose Tellah down to nothing... and I was in the waterfall section, so instead of using an Ether like a sane person may do I used Osmose on several foes to try and get back up, with some bumps along the way, in any event I did manage to snag a Silver Apple from an Alligator! Giving Rydia a crucial +50 HP!

Whew, it looks like OctoMammoth does some sort of desperation attack near the end, he must have attacked at least 5 times! He dealt 110 damage to Cecil but both Rydia and Tellah were under Blink so they were fine. - He was beaten at 17 Cecil, 14 Rydia, 20 Tellah

All in all a very satisfying boss, I love the remade area, so much more satisfying in every single way!

Did you fix that bug where Misses don't keep the Auto-Battle script going? Because I recall reading somewhere that was a bug in FF4A, maybe only the original version of it? Also when Tellah attacked barehanded the animation looked slightly glitchy.

I know it's not the Barehanded Graphic which is glitchy because I used Cecil to punch a couple of Zombies in the face.

Ruby Ring now protects against Poison? Good to know.

Hand Axe sells for 0 Gil still, hehe.

Well, I bought 99 Potions and I'll grind Edward up to Level 10 as I did with Rydia.

Well that was a little disastrous went back to the Waterfall and ran into 4 Toadgre's I use Dark Wave and my entire party is Toaded, thankfully I used Song of Toad and blasted them again with Dark Wave. Still... ouch.

...A Soma Drop from the Tiny Mages! Tonight really is lucky for me!

Edward is now Level 10 so let's head off to the Antlion's Den!

Adamantoise lives up to his name with great defense all around!

Yikes, you were not kidding about the Speed of that Petrification! Turned Rydia into Stone in roughly three turns. I'll need to head back to Kaipo to pick up some Gold Needles.

I see some random AI use here with Leshy using confuse, interesting idea.

Hmm, I wonder if the Exp. adjustment is shared here, a battle with a challenging Adamantoise and Basilisk only yields 100 some exp. at the end of it, where a battle with four Sahagins and two Tiny Mages is worth around 250, I'm not sure the benefits outweigh the cost here.

Looted the first room and then was forced to retreat, off to heal at Damcyan.

Wow, Leshy's have a bit of magic, using a Blizzard that dealt over 100-150 damage! Song of Silence is actually quite useful here!

Ah, Leshy's have that Spectral Robe...

Does the Dreamer Harp have x4 to Spirit or something? An attack dealt 84 damage to a Leshy.

I had my doubts but Edward is exceptionally useful here! His Dreamer Harp can put difficult foes to Sleep and his Songs are actually useful on certain foes.

I do think the combination of Paralyze/Gradual Petrify is a bit much though, especially since Basilisks don't yield anything that impressive anyhow.

I also feel that the Poison/Paralysis from the Yellow Jelly is not worth it. Because of their higher magic defense and HP they can't be wiped out with one Thunder spell, meaning that to take them out (really only for the Bestiary entry) you have to use attack items, and if you're unlucky multiple attack items. And their drop table, exp, and gil are not worth the effort in the end, especially considering the real possibility that they could Poison and Paralyze the entire party, let alone Paralyze the only character that can damage them.

So onto the Antlion...

Let's see... no Counter, interesting... Slow, Restore (ouch), Poison and a normal attack, should be interesting. Counter Horn... for a Summon? Hmm... he didn't do it the first time. Digestive Acid as well, this fellow really has the picnic basket of moves! Since he restores for 270 that must mean he has 2700 HP... Vampire as well, because why not? (A weaker version of Digestive Acid)

And the entire party is Paralyzed by both Gaze and Entangle...

And I lost... Well, let's try that again.

Talk about an intense fight! His random AI continually keeps you on your toes but you can mitigate a few of his tricks. First, equip Ruby Rings, neutralizing Poison is a god-send (and probably part of the reason why you gave Ruby Ring poison resistance) they also give some much needed Magic Defense and Evasion to Rydia and Edward who can even shrug off a few of his attacks due to this evasion. All in all it is an exciting battle! You never know when he'll bust out with Restore and undo your hard work or use Entangle and force you to turtle while (likely Rydia) is incapacitated.

My levels were Cecil 18, Rydia 15, Edward 12.

I am Loving this mod so far! You are bringing FF4A into the next generation of FFIV hacking standing strong with the likes of Unprecedented Crisis and Threat From Within!

 :edit: I was on my way out of the Antlion's Den and ran into an encounter with 2 SandWorms, after dispatching them I got Another Silver Apple!
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on July 29, 2015, 12:26:03 PM
Board ate my last post, so I'll make this quick:

-I'll try to make the stages of Gradual Petrification visible somehow; I do want it to use the timer since it's otherwise not much to worry about.

-Not sure what to do with Dwarven Bread. Might make it into a rare Protect-casting item.

-Rare drops are a little more common than usual:
#1:    50% -> ~44.5%   0x8C10A 7F -> 72
#2: 31.25% -> 31.25%   0x8C12C CF -> C2
#3: 17.19% -> 18.75%   0x8C134 FB -> F2
#4: 1.652% -> ~5.08%

And Sand Worms have a base 15% chance to drop an item at all, owing to their rarity. So it's easier to acquire rare drops than it used to be.

Magic Beast is supposed to replace Reptiles, but I might make it into a "Flying" family instead, tie Arrows/Lances to that and free up the Wind element. Not sure yet.

Monsters in FF4A have their Defence/Evade/Evade M values stored in their own data, thankfully.

Do you think the Baron Soldiers battle is too harsh? I don't want a mandatory fight to require using the Hourglass since it is a missable item, and this battle must be fought before you can freely enter Kaipo. As for your question I did increase the Gil reward from the General  - it makes sense for a royal officer to be wealthy after all. Experience is untouched IIRC.

Phoenix Downs and Tents will not be sold for a while, so you will want to conserve them for now.

Cyclone (aka Monster Tornado) uses the caster's Current HP/2 for damage, but I might change it into a regular Wind-elemental spell for Edge to use. I'll also have to think about what to do with abilities that damage based on the target's Max HP (Flame, Piercing Laser, etc).

Vile Shells had 99 Magic Evade and 3 MDF multipliers, so they defended well against anything but the Rod magic. I've toned that down, since they've already got a counter to magic anyway.

Toadgres cast Toad in response to damage and MT Blizzara when alone. I have no idea why Cecil did 100 damage on an unarmed critical, but remember that monsters don't have back rows in this port. Zombies are immune to the Rod magic thanks to their 12 MDF.

I wasn't sure what to give Red Mousses and Sahagins that would be interesting and not overpowered. Originally Sahagins, Leshies, Gargoyles and Domovois had not drops due to appearing in scripted/Fabul battles (I assume that's why), so their drops had to be invented out of whole cloth.

Chocobo costs more MP since it pierces Magic Defence and ignores Magic Evade; I'll have to check if the other summons have the the same behaviour (I assume not, since Mad Ogres take little damage from them).

FF4A 1.1 fixed the Tellah/Edward bug I believe. I'm aware of the unarmed graphics thing, it's probably related to my repointing the weapon animation table. Should be an easy fix.

Agreed on the Yellow Jellies and Basilisks, I'll tone down their attack statuses. The Basilisk Paralyzing is a remnant of when they had no petrification abilities, but it's too much for an early game monster vs. three party members. The Yellow Jelly x4 encounter will probably be replaced with something else since it's almost a repeat of the Red Mousse encounter. I didn't consider that enemies in Antlion cave appear in fewer numbers than the Waterway enemies, so I'll adjust their xp rewards to compensate.

Edward's harps were, for some reason, not classified as Back Row OK weapons. Now that I've changed that Edward might be a little too close to Cecil damage-wise, so I'll be sure to tweak the harps' attack power.

Glad you had fun with Antlion, I enjoyed writing and designing his AI script. Here it is in full, for reference:
Code: [Select]
Condition: Status(Confusion){
No Interrupt:
(
Digestive Acid
Digestive Acid
Digestive Acid
Set Target: Self
Attack
Attack
)
}

React: Summon, Dark Wave, Condition: (HP < 550):
{Counter Horn, Counter Horn, Entangle}
React: Magic{
Shell
}
   Action Script:
Poison
{Glance, Digestive Acid, Attack}
{Restore,Restore,Protect}
{Slow,Slow,Attack}
{Attack,Vampire,Entangle}
{Attack,Digestive Acid,Attack}
Attack
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on August 02, 2015, 01:17:14 PM
Still plugging away at this...mostly working on more ASM edits to the battle logic when I have time. One such edit makes units not evade spells cast by their allies unless that ally is Confused. Additionally, Cure/ra/ga/ja and Esuna will never be evaded unless the target is Undead. Before, player characters would never evade spells cast by player characters, and monsters would always attempt to evade spells, even those they cast on themselves. Antlion won't dodge his own Protect spells anymore!

Statuses inflicted by physical attacks have a different formula too; the success rate is now
Code: [Select]
(Attacker Int - Defender Spi + 70) out of 150...for each hit attempted. I want to try the same sort of thing for Solo hit status spells but haven't been able to come up with a formula that satisfies me.

Spells that inflict multiple status effects at once will no longer be thwarted by resisting just one of their effects. Equipping a Twist Headband will only stop Bad Breath from confusing you; you'll still be a blind mute poisoned toad.

The unarmed graphics bug continues to mystify me, even after stepping through all of the relevant ASM routines. As long as it looks fine for Cecil and Yang I'm content to leave it alone for now.

I hope to have a version in a few days - I have lots of ideas for the Fabul siege  :laugh:.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on August 02, 2015, 02:57:54 PM
Still plugging away at this...mostly working on more ASM edits to the battle logic when I have time. One such edit makes units not evade spells cast by their allies unless that ally is Confused. Additionally, Cure/ra/ga/ja and Esuna will never be evaded unless the target is Undead. Before, player characters would never evade spells cast by player characters, and monsters would always attempt to evade spells, even those they cast on themselves. Antlion won't dodge his own Protect spells anymore!

Statuses inflicted by physical attacks have a different formula too; the success rate is now
Code: [Select]
(Attacker Int - Defender Spi + 70) out of 150...for each hit attempted. I want to try the same sort of thing for Solo hit status spells but haven't been able to come up with a formula that satisfies me.

Spells that inflict multiple status effects at once will no longer be thwarted by resisting just one of their effects. Equipping a Twist Headband will only stop Bad Breath from confusing you; you'll still be a blind mute poisoned toad.

The unarmed graphics bug continues to mystify me, even after stepping through all of the relevant ASM routines. As long as it looks fine for Cecil and Yang I'm content to leave it alone for now.

I hope to have a version in a few days - I have lots of ideas for the Fabul siege  :laugh:.

These are some fantastic changes. I especially like the idea of a more intelligent person being able to use their weapon with more efficiency thereby inflicting foes with the weapon's special attributes. In that respect it would be the same to defend against these would be to one's Spirit or "Will". Good work!

Solo hit status spells... What spells count as solo hit status spells? I was always under the impression that it was applied for each magic multiplier?

Your plans for the Evasion sounds like it would be great in the SNES version as well, but i haven't really looked into it.

I am so glad to hear you fixed the multiple status protection! Will this also work for the Golbez fight to make sure you can't be... i think it was Mute which prevents you from being Paralyzed?
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on August 02, 2015, 09:59:03 PM
For Solo hit spells, I referred to Deathlike's Algorithm FAQ (http://www.gamefaqs.com/gba/929937-final-fantasy-iv-advance/faqs/54945); basically, spells with the Solo bit force the Magic Attack Multiplier and Magic Defence Multiplier to 1; it's used mainly for status spells, HP-based magic and other spells with similarly binary effects.

Poison preventing Paralyis being applied is a separate issue with status priority. The priority goes roughly like this:
Code: [Select]
Death -> Petrify -> Toad -> Mini -> Pig -> Silence -> Blind -> Poison -> Curse -> Float -> Paralysis -> Sleep -> Confusion -> Berserk -> Gradual PetrifyThough some statuses will ignore priority. I will fix that by the time the mod gets around to the Golbez fight (and it will be a fight!)
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on August 04, 2015, 12:51:48 AM
I managed to fix the unarmed graphics bug; it turned out to have been caused by an edit I had made to weapon animation code to allow for more than 325 items.

While trying to make Cyclone usable by player characters, I also discovered that FF4 Advance has a system, completely unused, for making a spell with the default "Magical damage" formula vary its base power according to the caster's current HP. All spells in vanilla that operate off of caster HP use a simple Damage = CurrentHP / Divisor, modified by elemental attributes. By assigning a nonzero value to a spell's alternate damage byte, one can make a spell whose power is:
Code: [Select]
Power = Current HP / Alternate power
This has the distinction of factoring in the caster's Intellect and the defenders' magical defences.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on August 05, 2015, 11:25:56 AM
I managed to fix the unarmed graphics bug; it turned out to have been caused by an edit I had made to weapon animation code to allow for more than 325 items.

While trying to make Cyclone usable by player characters, I also discovered that FF4 Advance has a system, completely unused, for making a spell with the default "Magical damage" formula vary its base power according to the caster's current HP. All spells in vanilla that operate off of caster HP use a simple Damage = CurrentHP / Divisor, modified by elemental attributes. By assigning a nonzero value to a spell's alternate damage byte, one can make a spell whose power is:
Code: [Select]
Power = Current HP / Alternate power
This has the distinction of factoring in the caster's Intellect and the defenders' magical defences.

I am so jealous of such capability, hehe. These advancements they made to the game system though strangely enough seemed to go nearly completely unused. Does FF4A have more ability slots than FFIV, or is it still set to BF?
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on August 05, 2015, 12:44:29 PM
AFAIK FF4A has the same number of ability slots as the original (the Lunar Ruins commands like Dbl Jump, Miracle, Deadly etc share a slot with the commands they upgrade from), but it would probably not be too arduous to expand the number of possible commands.

I've finished up Mt Hobs and the Mom Bomb, but sorting out the item drops of Bloodbones has gotten me sidetracked towards recoding spellcasting items. In the base game, there are three weapons (Abel's Lance, Lightbringer and the Fiery Hammer) that can cast a spell to follow up a successful physical hit. Of course, these items are hardcoded by their item IDs to be able to cast a spell; not only that, the spell ID they cast is hardcoded, the spell formula to use is hardcoded, and the actual spell routine to use is hardcoded too!  :lame:

Abel's Lance in particular is notable for being able to proc Tornado on bosses; that's because the "was target hit?" byte is not reset from the physical attack preceding the Tornado spell, so even though it fails the Boss Bit check it succeeds anyway. So, I'm going to have to reinvent this system to make it more generalized.
Title: FFIVA Mod - Alpha 3
Post by: Kea on August 06, 2015, 09:47:01 PM
Alright, the patch up to Fabul is completed - download it here (https://www.dropbox.com/s/x95ogtesrj75ju4/FFIVa%28E%29%20hardtype.zip?dl=1).

Most of the time in this one went into backend changes; for instance, any weapon can cast a spell after attacking, with its own chance of doing so and the option of making the spell bypass magic evasion and the boss bit. Only two weapons in the demo so far make use of it (both optional rare drops), but you'll be seeing a little more of them later on.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on August 07, 2015, 12:19:21 AM
Just heads-up...I missed a few things in the last minute: in particular flyers weren't weak to arrows and lances, and there were some text mistakes from changing the Projectile element to Wind. Re-download the patch to fix those mistakes.   :sad:
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on August 07, 2015, 08:01:02 PM
I am glad to hear that you've managed to incorporate your own version of "magic weapons" into FF4A. I wonder is it similar to how I did it? That was done through it using the default magic of the weapon. The SNES version had a bit of a trick with that though. If the item's power is labeled as 0 the spell would not activate when used as an item. But when spells are called through normal attack they run through the normal routine instead of the magic item routine which uses that preset power. It lent itself to being useful as per the Wisdom/Will of the user itself.

I have a bit of time tonight so I will play through up until... wait a second, is this up until Fabul, as in Fabul Battles? Or does this patch end at Fabul Castle proper?

 :edit: Well, looks like the Edward vs Sahagin fight wasn't any different.

No real training for Rosa before Mt. Hobbs since she does well at Mt. Hobbs anyhow.

Well, first battle against Bombs and GrayBombs went pretty terribly. I managed to win, but it hurt quite a bit.

Time to leave and head back to Damcyan to heal.

Well, at least the Bomb Summon can be obtained before the Moon in this.

I won my first battles against Cockatrice pretty handily, was the Gradual Petrification slightly scaled back? I expected both of those afflicted were going to be turned as such by the end of the fight..

Bombs are susceptible to Sleep and Confusion... but the wonky aiming of this version threw me off enough that putting them all to sleep didn't buy me as much time as I had hoped, only myself to blame on that one though.

Pray doesn't seem that great still...

It would appear I got lucky the first time fighting the Cockatrice since they can seem to randomly use Peck.

Finally, Spirits! Terrible RNG for me, at least a dozen battles of nothing but Bombs and Cockatrices.

Oh, the Spirits have Ghoul Rings as their common drop? It may be worth hanging around trying to find one.

Either Lamia Harp is Holy Elemental or it is strong against Spirits!

Ah, you must have made Gargoyle's resistant to Petrify... which makes sense considering they're Gargoyles.

Flying is now its own type, hmm? What was replaced for that I wonder?

That would leave Skeletons to find...

No treasure from the Skeletons? That seems a bit odd considering they're wearing Armor and are wielding a Sword. They deal massive damage to Cecil who is clearly weak to Darkness (is there a way to set a x4 Weakness to an element in FF4A? Because that seemed to be about as much damage as they were dealing).

Still grinding here a bit, but I need to take some time out to eat. I'll get back to it afterwards.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on August 07, 2015, 08:12:24 PM
For my magic weapons, I piggybacked off of the pre-existing system used for the Lunar Ruins weapons; it casts the spell normally, using the wielder's Intellect or Spirit. I hadn't realized the same thing was possible in the SNES version though on reflection I can see how you could edit the battle code so that certain weapons replace their physical attack with a spell. My version only allows for spells after the physical attack as yet.

This patch is complete through to the end of the Fabul battles, yeah. If it was just the Mt. Hobs stuff that was new it would hardly be worth releasing!

I managed to make Dwarven Bread into a Protect-casting item, which turned out to require some minor edits to these routines:

Code: [Select]
$06C1FC: Item usability routine (Field)
-Check if Item ID is 0xE6 (Dwarven Bread) - if not in dungeon, usable
-Check if Item ID 0xE5 (Emergency Exit) - if in dungeon, usable
-Because of these hardcoded checks, these two items can be considered usable regardless of what their item data says, which can crash the game if you remove their field effects and attempt to use them
-If not one of those two, calls:
   $06CE7C: finds item's entry in Item Data
        -Checks item's general data to determine if it is usable in the field

$08C562:
Applying Protect and Shell buffs:
-If at least one hit was successful:
-If spell ID =/= 0x5 (Protect), increase MDF by 3; otherwise increase DEF by 5
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on August 07, 2015, 11:20:25 PM
For my magic weapons, I piggybacked off of the pre-existing system used for the Lunar Ruins weapons; it casts the spell normally, using the wielder's Intellect or Spirit. I hadn't realized the same thing was possible in the SNES version though on reflection I can see how you could edit the battle code so that certain weapons replace their physical attack with a spell. My version only allows for spells after the physical attack as yet.

This patch is complete through to the end of the Fabul battles, yeah. If it was just the Mt. Hobs stuff that was new it would hardly be worth releasing!

I managed to make Dwarven Bread into a Protect-casting item, which turned out to require some minor edits to these routines:

Code: [Select]
$06C1FC: Item usability routine (Field)
-Check if Item ID is 0xE6 (Dwarven Bread) - if not in dungeon, usable
-Check if Item ID 0xE5 (Emergency Exit) - if in dungeon, usable
-Because of these hardcoded checks, these two items can be considered usable regardless of what their item data says, which can crash the game if you remove their field effects and attempt to use them
-If not one of those two, calls:
   $06CE7C: finds item's entry in Item Data
        -Checks item's general data to determine if it is usable in the field

$08C562:
Applying Protect and Shell buffs:
-If at least one hit was successful:
-If spell ID =/= 0x5 (Protect), increase MDF by 3; otherwise increase DEF by 5

A good use for an item called "Dwarven Bread" considering you'd expect it to make the eater more "hardy" so to speak, a good call.

As to Magic Weapons, that's how mine works as well. It does the normal attack, then 25% of the time it will use the weapon's assigned magic, drawn from the normal magic casting routine. I would like to include some Wisdom/Will set up though. I wrote it right into Fight's routine.

Good to have confirmation on the length of the patch, now back to it!

Rosa's now Level 15, so though I didn't get the Ghoul Ring, it seems a good time to move on.

Pyro, eh? Was not expecting that! Did deal some respectable damage.

Firaga?! Ouch! Well, everyone survived, but still... ouch.

Explode thankfully did not do too much damage. Now onto the mop-up...

Phew, and dealt with. The bombs were taken care of with Sleep, an Antarctic Wind and general attacks from thereon out.

And I am out of Mt. Hobbs, onto Fabul!

Ah, the Steel Quill is more easily obtainable Gatlinger's...

A Silk Robe from Fabul, that's a new item.

Yang has reached Level 14 where he gains another Attack Multiplier which seems like a good place to stop grinding.

Interesting new formations here, The Gatlingers work well rather than a... I think a Sahagin and the two Bombs with the next squadron of soldiers was a nice touch.

Grr... TOSE... there used to be some special code that prevented Edward from Hiding during the Fabul fights... looks like TOSE never caught that or something.

Oh, the Captains stay and fight? Good to know.

Wow, a Treant?! That is actually notable. They are not easy foes for this point. Thankfully they have a crippling weakness to Fire.

And killed by the Treant because I wasn't expecting a Stop counter which just happened to hit Yang... back to the start of this then.

Wow, barely survived. Because of TOSE Edward went hiding and pretty much got Yang killed, during the Bombs and Soldiers battle. I used an item and tried to persevere through it, Cecil was down to 200 HP or so, but the battle was won. The Treant fight started and I immediately brought Edward back from Hiding where the Treant killed him, Cecil used a Bomb Fragment, then he hit Cecil and Cecil was down to 77 HP. After that I hit him one more time and he fell. I knew the next fight would not be easy, well it was 6 Domovoi but Cecil outsped them all and used the Zeus' Rage the next fight was terrifying to look at, but after an Hourglass, Hi-Potion, and Antarctic Wind, I used Dark Wave, and finished off the Captain and General in piecemeal. Cecil managed to win three battles all on his own purely through the use of items. Phew, that was intense!

And with that the first part of the game is over.

Cecil 20, Rosa 17, Yang 14, Edward 18, Rydia 19

Next will be Mysidia and Mt. Ordeals.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on August 08, 2015, 03:40:35 PM
I hope you liked the siege! I wanted to make the battles more closely match the story, ie being pushed back and overwhelmed by an unstoppable army. Each encounter is supposed to be tougher than the last, except for the 6x Domovois which is a breather before the last fight. About the Treant battle, it was hard to come up with an enemy that was "out of your depth" yet still beatable, and vaguely humanoid. For the next time, they're vulnerable to Confusion which makes them petrify themselves. Once I implement the fixed Agility system, I'll be able to more freely include out-of-depth monsters without having them wipe the party before you get a turn.

I think I can make Edward's Auto-Hide disable during battles that can't be run from; will have to look into it.

Bomb Fragments et al used to have 3 power; now they have 6. That might be a bit too much, so I'll reduce them to 5. Hourglasses will be getting a nerf too; originally they lasted 50/100/200 ATB units, which is an absolutely ridiculous length for something that targets all enemies (Stop only lasts 10 ATB units for comparison). Something like 5/15/50 for Hourglass/Silver Hourglass/Gold Hourglass would be good, I think.

I think I'll wait to release the next version of the mod until it's up to Cagnazzo, or maybe the Magnetic Cave + Eblan castle.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on August 08, 2015, 07:06:04 PM
I wouldn't say the power of the Battle Items need lowered, all things considered they only dealt 200 or so damage to all enemies and once you have a dedicated mage those numbers are par for the course, not to mention that's roughly how much a normal hit does and these are rarish items, it should be something the player feels could save them in a time of crisis instead of rolling their eyes at another useless battle item (see: original FFIV)
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on August 08, 2015, 10:09:20 PM
Hm, you may be right. I suppose it's better to have them be a little too strong than the other way around, they are consumables after all. I'm still sticking to the Hourglass numbers though.

So as you've seen with the Magic Beast type, I'm rearranging the monster families in this game. Anybody who's played FF4 probably knows that monster types are very unevenly distributed (cf Mythril equipment defending against a nearly nonexistent Spirit family). Here's the specific changes being made:

Mech -> Construct
Basically this is to include Golems and any artificial enemies in this family. There will also be some new Mech-type enemies in Zot for Cid to smack around.

Reptile -> Magic Beast
Reptiles are actually fairly common throughout the game, but hardly anything actually interacts with them, and it overlaps with Ice weakness a little. Most animal-type monsters except birds, fish and insects will go into this one, making it fairly common up until the Lunar Subterrane.

Mage -> Humanoid
Again, expanding this family to include human and human-like enemies such as Arachnes, Giants and Ogres. This family becomes almost ubiquitous now, almost every dungeon past Mt. Ordeals has at least one.

Giant -> Flying
Giants, along with Flans, were a very small family, so I chose this one to cut and replace with the Flying family to free up the Wind element. Just about everything with wings is part of this family, though it becomes somewhat less common as you go on. Creatures in this family were shifted to the Humanoid or Construct families, whichever made sense.

The Spirit family will be seeing some new and some not-so-new members too. Overall there should be a greater variety of monsters running around throughout the game, and more specialized weapons designed to take them on.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on August 09, 2015, 12:53:27 AM
I love the sound of that new plan for races! Also don't worry about the Hourglasses, yes they Need nerfed. A freeze of 50 ATB is Ridiculous!! That's 5 Meteo spells! Combat Boost has only one HourGlass Item the rest... well I still haven't completely decided on what I want with the other two item slots.

In FF4A I imagine you have much more than FF monster slots, with all of the new monsters running about the Lunar Ruins?
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on August 09, 2015, 11:32:42 AM
In FF4A I imagine you have much more than FF monster slots, with all of the new monsters running about the Lunar Ruins?

Indeed, with 286 monsters in the game, monster IDs are a halfword. Expanding the number of monsters is a little tricky; you'd have to replace the base text index used by monster names, rewrite the AI loading code (and that's another thing, the pointer table for AI routines is also used for events so it's not so easy to expand), and possibly restructure the Bestiary data if you want them to show up as regular monsters there.

Then there's monster sprite definitions; the first 286 entries correspond to the default sprites of all monsters, but the next 76 entries are used for alternate forms of monsters (eg Octomammoth losing tentacles, Odin raising his sword...). So if you wanted to add new monsters, it would be better to skip 76 monster IDs and start at monster No. 363.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on August 09, 2015, 12:09:48 PM
In FF4A I imagine you have much more than FF monster slots, with all of the new monsters running about the Lunar Ruins?

Indeed, with 286 monsters in the game, monster IDs are a halfword. Expanding the number of monsters is a little tricky; you'd have to replace the base text index used by monster names, rewrite the AI loading code (and that's another thing, the pointer table for AI routines is also used for events so it's not so easy to expand), and possibly restructure the Bestiary data if you want them to show up as regular monsters there.

Then there's monster sprite definitions; the first 286 entries correspond to the default sprites of all monsters, but the next 76 entries are used for alternate forms of monsters (eg Octomammoth losing tentacles, Odin raising his sword...). So if you wanted to add new monsters, it would be better to skip 76 monster IDs and start at monster No. 363.

Oh... oh wow that sounds needlessly complicated and how did they tie the AI routines into proper events? That just... sounds so bizarre, and they turned the "change form" monsters into full monster entries? That just seems pointless... hah. Ah well, just like FFIV then you still have all of those programmers to axe for new monsters.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on August 09, 2015, 12:14:44 PM
The changed forms aren't new monsters in the sense that they have their own complete data; it's just that they take up spots in the sprite table.

Here's the struct itself:
Code: [Select]
0x0C bytes per entry:
$00-01: Sprite ID; what graphics/palette to load
$02: Attack Shading:
00 - Normal (black/outlines)
01 - Entire sprite
FF - None? (character enemies)
$03: Number of sprite tiles to read horizonatally?
$04: Number of sprite tiles to read vertically?
$05: Sprite's drawn width
$06: Sprite's drawn height (bad numbers causes sprite to be cut off/broken up etc)
$05-06 are only different from 03-04 in Dr. Lugae's case, where he changes sprites at start of battle
(not that it actually makes a difference?)
$07: Unused?
$08-0B: Pointer to data in 0x0801C--- region, or 00
Used for most Lunar esper alt. forms - special tile/palette arrangement
Allows each tile to have its own palette?
If you look at the sprites for the Lunar espers and Zeromus EG, they have more colors than other monsters; that's thanks to the $08 pointer.

This is what the end of the sprite list looks like:
Code: [Select]
Soldier Monk
Super Monk
Drillmaster
Melt Bomb
Goblin (Super)
Palace Guard
Dark Kain
Bandit
Specter
Dummy (Goblin)
Dummy (Goblin)
Dummy (Goblin)
Dark Bahamut (Mega Flaring) 2
Lunar Leviathan (turned away)
Mist Dragon (mist)
Cagnazzo (hiding)
Cagnazzo (Torrents)
Barbariccia (Wind shield)
King of Eblan (sane)
Queen of Eblan (sane)
Rubicante
Odin (Sword up)
Odin (Charging)
Leviathan (forward)
Bahamut (Mega Flaring)
Demon Wall (2)
Asura (2)
Asura (3)
(Tiny snake thing?)
Titan (Quaking)
Egg (Hatching)
Chocobo 1
Chocobo 2
Shiva 1
Shiva 2
Ifrit 1
Ifrit 2
Ramuh 1
Ramuh 2
Sylph 1
Octomammoth 2
Octomammoth 3
Octomammoth 4
Octomammoth 5
Octomammoth 6
Octomammoth 7
Octomammoth 8
(Pig)
(Toad)
(Midget)
Momb Bomb (Exploding)
Mist Dragon (Summon?)
Dr. Lugae (Transformed)
Demon Wall (Front only - 1)
Demon Wall (Front only - 2)
Demon Wall (Front only - 3)
Demon Wall (Front only - 4)
Demon Wall (Front only - 5)
Demon Wall (Front only - 6)
Demon Wall (Front only - 7)
Demon Wall (Front only - 8)
Demon Wall (Front only - 9)
Demon Wall (Front only - max)
Sylph 2
Sylph 3
Lunar Bahamut (Mega Flaring)
Lunar Leviathan (backward)
Lunar Odin
Lunar Odin (charging)
Lunar Asura 2
Lunar Asura 3
Lunar Titan (Quaking)
Lunar Dragon (Mist)
Lunar Ifrit (Flaming)
Lunar Ramuh
Lunar Ramuh (Zapping)
Lunar Shiva
Ifrit (Boss2)
Shiva (Boss2)
Titan (Boss2)
Ramuh (Boss2)
Super Monk (2)
Super Monk (3)
Soldier Monk (2)
Soldier Monk (3)
Drillmaster (2)
Drillmaster (3)
Dark Bahamut

The worst part? Monsters that start in one form, move to another, then change back to their previous form use three different sprite entries: Lunar Odin uses different sprite entries for before raising his sword and after lowering it, and Dark Bahamut does the same for his Mega Flaring. It's crazy.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on August 11, 2015, 10:56:03 PM
One small thing while I work on Mt. Ordeals....

The routine at $09C304 handles charge times for all abilities, based on a byte table at $0F94E4:
Code: [Select]
$0F94E4 - One byte per command; 0x21 bytes in total
-Bottom nibble is base charge time
-Top half is bitfield:
00 - Use (ATB time)/(base charge timel), modified by Agility divisor
10 - Use base*(ATB time)
20 - Use base charge time
40 - Use spell's charge time (Magic, Summon, Ninjutsu etc)

Of all abilities, the second part of Twincast has 0x14 as its value, the only command that has bit 0x10 set. Its unique formula to determine its charge time looks like this:
Code: [Select]
Charge time = min((500 / (Agility*10),1) * 4 At the point when you first recruit Palom and Porom, Twincast will have a charge time of about 20-28 units. That's over twice the charge time of Meteor, applied to both twins! :scared: Twincast will have a not completely insane charge time (of 8 units - almost as much as Meteor) when you get the twins back at the endgame, but by then Comet and Pyro are laughably weak.

This formula is used for both twins involved, so whichever one has more Agility is the one that will cast the spell (so, Porom usually).

My mod will likely make Twincast have a fixed charge time, so you might consider using it sometime.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on September 01, 2015, 10:18:27 PM
It's been a while, but I'm not quite dead yet. I went on vacation and isolated myself from computers for a while, and after I finished up the Scarmiglione battles took a break from this game to avoid getting burned out.

I should have the mod up to Cagnazzo or the Dark Elf finished in a week or so.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on November 05, 2015, 04:40:31 PM
Well that took quite a lot longer than a week.  :blush:

But I've finally finished up to Cagnazzo, who has the most complicated AI script of any enemy so far - 352 bytes in all. I had a lot of fun designing his and Scarmiglione's fights, so I hope you have just as much fun battling them! :finger:

In engine news, I've implemented a system for equipment to run custom ASM routines at the start of battle; this allows for equipment that sets status effects like Reflect, Haste or Image, or makes the wearer Undead, and things like that. I haven't figured out how to make permanent status effects for a 'true' Reflect Ring, but it's getting there.

Regardless, here is the patch (https://www.dropbox.com/s/x95ogtesrj75ju4/FFIVa%28E%29%20hardtype.zip?dl=0). Complete up to beating Cagnazzo and looting Baron Castle. My next task...is to play Threat From Within, because it's looking really cool from what I'm reading.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on November 05, 2015, 09:08:18 PM
Well that took quite a lot longer than a week.  :blush:

But I've finally finished up to Cagnazzo, who has the most complicated AI script of any enemy so far - 352 bytes in all. I had a lot of fun designing his and Scarmiglione's fights, so I hope you have just as much fun battling them! :finger:

In engine news, I've implemented a system for equipment to run custom ASM routines at the start of battle; this allows for equipment that sets status effects like Reflect, Haste or Image, or makes the wearer Undead, and things like that. I haven't figured out how to make permanent status effects for a 'true' Reflect Ring, but it's getting there.

Regardless, here is the patch (https://www.dropbox.com/s/x95ogtesrj75ju4/FFIVa%28E%29%20hardtype.zip?dl=0). Complete up to beating Cagnazzo and looting Baron Castle. My next task...is to play Threat From Within, because it's looking really cool from what I'm reading.

This weekend seems pretty open for me, I'll get back to this at that time. I'm always glad to see an update!
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on November 06, 2015, 06:48:26 PM
That's some impressive ASM to give equipment custom ASM routines! I doubt there's enough room in the original FFIV for something that expansive. Unless we're referring to a rather small subset (see Avenger)

Oh right, should I restart my file? Or am I safe to continue on from Fabul?
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on November 06, 2015, 07:19:45 PM
You should be good to go from Fabul; there shouldn't be anything that breaks.

And thank you. The way the custom equipment ASM works is that after setting elemental and racial attributes from equipment, my new code runs through ever piece of equipment and checks for a (formerly unused) index byte in that item's item data, then uses that byte to index to a pointer table to ASM routines; so any item with an index byte of 1 will run he same code.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on November 07, 2015, 02:35:00 PM
Alright, let's get back to it then! It's been a while and I will probably be a bit rusty.

Whoa, whoa, what? Augments Ice Magic when equipped?! I had no idea you added in FFV style rods! That's been a desire of mine to do for FFIV for a long time, good thinking!

I'm glad to see the Healing Staff casts Cura now instead of less than 20 Heal.

I cannot get over some of the GBA script; "You are that boy from before!" What...? Cecil is a man of 19-20. Also some of the things the mages say seem odd. Just a commentary on the quality of the translation in that regard.

Also the instrumentation in Mysidia is the first iteration of the "kooky" (With the odd bird sounds and unfitting instruments in certain spots) style instead of the mysterious style which I had felt was what they were going for in the original.

Palom's portrait looks pretty good... but Porom's is about as bad as Rosa's.

"Baron shall burn in the fieiriest pits"
 One: I'm pretty sure that's spelled wrong.
Two: The original text says nothing about it. The "Never forgive nor forget..." sign from the original makes a lot more sense. That one is just too over the top. Considering that sign never changes.

Gaia Gear raises Strength by 5 now, eh? I'm curious to know what the Kenpo Gi does now then.

Hmm, Healing Staff has no Spirit boost, hah.

Well, time to make my way to Mt. Ordeals.

(Flips through Bestiary...) Venom Dagger? That looks like a new item that wasn't in an earlier version.

Seems that Zu's are still susceptible to the Deathbringer. It seems its Exp. was greatly decreased as a result though.

I don't feel comfortable ascending Mt. Ordeals until the Twins are at Level 15 at least so let's do some grinding.

Hmm, the Healing Staff says it casts Cura but it's still the useless 20 HP Heal from the original.

Hmm... were there always Zombies in normal fights outside of Mt. Ordeals?

Bloodbones are definitely a tougher customer with seeming resistance to Ice and Lightning and normal damage from Fire (or just high Magic Defense) and their Absorb attack can be tricky. A Decent-ish chance to drop the Venom Dagger though.

Alright, onwards to Mt. Ordeals!

...The Souls know Summon? Oh that will make this quite a bit more annoying, thankfully they can be Silenced, that doesn't stop them from using Summon however.

The enemies here are rather brutal. I may want to head back to Mysidia to buy a Crossbow and Holy Arrows for Porom. The Hand Axe can at least deal some physical damage but the Souls have high Physical Evasion so it seems almost a necessity to use a Level-2 spell to take them out.

Alright, went back to Mysidia and got Porom equipped with the Crossbow and 50 Holy Arrows with decent precision (thank you for making that viable option by the way)  so maybe now it won't be so resource costly to defeat Bloodbones and Souls.

Well, that would figure... when I go back to Mysidia to better prepare myself I get to the Tellah event without any battles at all, heh.

I can't say how useful Tellah will be with his Level 1 Spells, but his high level White Magic like Cura, Blink, and Life will definitely come in handy!

Seems like Porom can really pack a punch with those Holy Arrows and Crossbow, you've really managed to make the Twins the stars of the show here, even Tellah is support.

Need to go back to Mysidia again to properly equip Tellah.

Oh hey! Random battle Cockatrice Summon, great!

Interesting, the Souls have a really good chance to drop the Spectral Robe, hmm...

Bio is now quite expensive. Good. It needed balanced.

Some Mythril Gloves from a Ghoul/Revenant encounter, good to see!

Oh... Bio deals 1 damage to Undead... reasonable enough.

Lilith can be turned into a Pig? I used it with only 2 MP remaining, yeah I'm in pretty dire straits up here.

I was more than halfway there so I made a break for the Summit. Still need to go back down to get a chest though.

Instant Game Over Quake from Scarmiglione... hah.

 :edit: Alright, found a bit more time to play this and I managed to beat Scarmiglione, I feel kind of stupid for not realizing it before that Bluff is key otherwise time will elapse and he will insta-kill the party.

Hmm, sort of surprised that Scarmiglione 2's Cursed Elegy doesn't really do anything but Slow still.

Few, fully Bluffed Palom (4 turns of his) and two Fira's finished the job. Overall I found the second phase easier than the first. But that may be because I wised up to the proper strategy.

I do sort of feel I wasted 8000 GP on the Knight's Armor though. The Gaia Gear's Strength of +5 seems much more preferable in most respects than the plus extra 5 defense that the Knight's Armor provides.

But this seems like a proper stopping point! I'll end it here for today.


Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on November 07, 2015, 05:16:01 PM
The GBA script is definitely odd in places, to say the least. I've been thinking about making changes to it actually, but that seems to fall outside the scope of this hack. Maybe it'll be a separate patch.

Alright, let's get back to it then! It's been a while and I will probably be a bit rusty.

Whoa, whoa, what? Augments Ice Magic when equipped?! I had no idea you added in FFV style rods! That's been a desire of mine to do for FFIV for a long time, good thinking!
Hah, coding this was much easier than I'd feared. Specifically, element-boosting equipment increases the base power of the appropriate element by 33% when castin. Attaching elemental boosts to the fire/ice/bolt rods makes them worth buying, since casting basic magic for free loses its lustre pretty quickly.

Hmm, Healing Staff has no Spirit boost, hah.
Hmm, the Healing Staff says it casts Cura but it's still the useless 20 HP Heal from the original.
It's a little confusing, but the Healing Staff functions like its FF5 incarnation; it casts Cura after attacking. IIRC the extended description mentions this, but the second line never shows up on the Equipment menu.

Hmm... were there always Zombies in normal fights outside of Mt. Ordeals?

Bloodbones are definitely a tougher customer with seeming resistance to Ice and Lightning and normal damage from Fire (or just high Magic Defense) and their Absorb attack can be tricky. A Decent-ish chance to drop the Venom Dagger though.

Alright, onwards to Mt. Ordeals!

...The Souls know Summon? Oh that will make this quite a bit more annoying, thankfully they can be Silenced, that doesn't stop them from using Summon however.

The enemies here are rather brutal. I may want to head back to Mysidia to buy a Crossbow and Holy Arrows for Porom. The Hand Axe can at least deal some physical damage but the Souls have high Physical Evasion so it seems almost a necessity to use a Level-2 spell to take them out.
The Zombies outside Ordeals are new, the idea is that the whole area has undead running about.

The Souls only use Summon when all other enemy types are defeated (there's a new-ish encounter that takes advantage of this, he he), so you can stop them from doing that by just killing them first. They're also vulnerable to Tellah's Stop.

Alright, went back to Mysidia and got Porom equipped with the Crossbow and 50 Holy Arrows with decent precision (thank you for making that viable option by the way)  so maybe now it won't be so resource costly to defeat Bloodbones and Souls.

I can't say how useful Tellah will be with his Level 1 Spells, but his high level White Magic like Cura, Blink, and Life will definitely come in handy!

Seems like Porom can really pack a punch with those Holy Arrows and Crossbow, you've really managed to make the Twins the stars of the show here, even Tellah is support.

Bio is now quite expensive. Good. It needed balanced.

Oh... Bio deals 1 damage to Undead... reasonable enough.
Bio is now a Dark elemental spell and the undead monsters here are immune to that element, so it's not as useful as it normally is. All of the undead monsters here except for Souls are highly resistant to magic, but they're also doubly weak to Holy so Porom with Holy Arrows can sometimes OHKO Revenants. Alternatively, Palom casting Fira with the Fira Rod has enough power to punch through their magic defence, since the zombies here are also doubly weak to fire.

Instant Game Over Quake from Scarmiglione... hah.

 :edit: Alright, found a bit more time to play this and I managed to beat Scarmiglione, I feel kind of stupid for not realizing it before that Bluff is key otherwise time will elapse and he will insta-kill the party.
I don't know if you never encountered this or if it's bugged somehow, but if you kill all of the Skullnants, Scarmiglione will switch to a different pattern without Quake; that spell's there to discourage leaving just one Skullnant alive while you beat on the boss.

Hmm, sort of surprised that Scarmiglione 2's Cursed Elegy doesn't really do anything but Slow still.

Few, fully Bluffed Palom (4 turns of his) and two Fira's finished the job. Overall I found the second phase easier than the first. But that may be because I wised up to the proper strategy.

I do sort of feel I wasted 8000 GP on the Knight's Armor though. The Gaia Gear's Strength of +5 seems much more preferable in most respects than the plus extra 5 defense that the Knight's Armor provides.

But this seems like a proper stopping point! I'll end it here for today.

Cursed Elegy slowing the whole party is a pretty serious debuff, it makes it harder to keep up with his offence, especially his Lightning -> Earthquake sequence...or at least that's the idea. Maybe I should make it turn your party Undead. Now that would be debilitating!

As for Gaia Gear vs. Knight's Armor, I just forgot that Cecil can equip the former. Don't forget that the Knight's Armor gives +3 Spirit - with all of his Paladin equipment Cecil has a little more Spirit than even Porom (sans a Ghouls Ring) has.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on November 07, 2015, 11:07:05 PM

Quote
It's a little confusing, but the Healing Staff functions like its FF5 incarnation; it casts Cura after attacking. IIRC the extended description mentions this, but the second line never shows up on the Equipment menu.

Yes, I read tha,t and everytime I tried to attack it would miss, especially since Porom is in the backrow. You may want to adjust the weapon's accuracy.

Quote
I don't know if you never encountered this or if it's bugged somehow, but if you kill all of the Skullnants, Scarmiglione will switch to a different pattern without Quake; that spell's there to discourage leaving just one Skullnant alive while you beat on the boss.

Oh no, I saw that. It seemed to lead to an impossible scenario so I avoided it at all costs. I killed two of the Skulnants and went from there Bluffing with Palom several times before attacking Scarmiglione since he's the only one who can put a dent in Scarmiglione's HP without a rather nasty counter. (Osmose isn't too bad to deal with)


Quote
Cursed Elegy slowing the whole party is a pretty serious debuff, it makes it harder to keep up with his offence, especially his Lightning -> Earthquake sequence...or at least that's the idea. Maybe I should make it turn your party Undead. Now that would be debilitating!

Maybe... but by then the battle was a foregone conclusion. I had Bluffed Palom appropriately and since he countered with that only after he was hit with a 3000 Fira, he couldn't really stand against another 3000+ Fira.

Quote
As for Gaia Gear vs. Knight's Armor, I just forgot that Cecil can equip the former. Don't forget that the Knight's Armor gives +3 Spirit - with all of his Paladin equipment Cecil has a little more Spirit than even Porom (sans a Ghouls Ring) has.

Indeed, but that tradeoff... is not worth it, it really never is. Cecil is primarily a physical attacker so the objective is to increase his Strength as high as it can go in a quick manner. There are some hacks which discourage this (Unprecedented Crisis has Cecil as largely support). I think if the Knight's Armor did something else special it would have more use, but the slightly more defense and the Spirit just doesn't seem like a good tradeoff. This isn't a knock against your mod in anyway, the original game also has this issue when the Kenpo Gi becomes available in Baron.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on November 08, 2015, 12:06:12 AM
Hmm, the Healing Staff has 80 accuracy already. It can't hurt to put it at 99.

Seems like stacking Bluff with Palom is even more effective than I had supposed. Short of making the bosses straight-up immune to magic (which I definitely don't want to do) or having them all be races against time there's not much you can do to stop that. Maybe I can recode Bluff to only work once per battle...

It's difficult figuring out the right balance between equipment, especially for Cecil who has such a diverse selection. It's definitely true that reaching an additional attack multiplier is worth more than a few points of defence, especially early on when an extra multiplier is much more significant. I was leery of giving the Knight's Armor too much defence since I worried it would make Cecil practically immune to physical attacks that would take huge chunks out of the squishier characters, but maybe it's worth giving it a go anyway.

Could always give it status protections. Blind or Curse immunity would come in handy later...

e: Thank you for the criticism by the way. I try to look at my changes from several different angles, but inevitably you end up missing something.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on November 08, 2015, 11:11:39 AM
Hmm, the Healing Staff has 80 accuracy already. It can't hurt to put it at 99.

I think the issue more lies on backrow accuracy. Is is possible in the GBA version to make a weapon have full accuracy in the front and backrow? Because I recall several oversights associated with that in the original FF4A.

Quote
Seems like stacking Bluff with Palom is even more effective than I had supposed. Short of making the bosses straight-up immune to magic (which I definitely don't want to do) or having them all be races against time there's not much you can do to stop that. Maybe I can recode Bluff to only work once per battle...

Recoding Bluff is not a bad idea. Somewhere in the RAM is the initial modified stats of the characters in the SNES version if you add +16 from that value instead of his main stats you should be able to stack it just once... but are you sure that wasn't the intended method? There's nothing else that can really hurt Scarmiglione to any great extent and it's not as if Bluffing makes it a cake-walk. Without Bluff it becomes an extremely costly affair all around as I can make out as Palom deals maybe 500 with each Fira with no one else being able to contribute any damage due to non-existent damage capability (Tellah) or Scarmiglione's high Defense (Porom). With such limited Phoenix Downs you need to choose every single move carefully and the path of least resistance without any unlucky Thundara's wiping out the healers through use of Physical Attacks seems the right way to go.

Quote
It's difficult figuring out the right balance between equipment, especially for Cecil who has such a diverse selection. It's definitely true that reaching an additional attack multiplier is worth more than a few points of defence, especially early on when an extra multiplier is much more significant. I was leery of giving the Knight's Armor too much defence since I worried it would make Cecil practically immune to physical attacks that would take huge chunks out of the squishier characters, but maybe it's worth giving it a go anyway.

Could always give it status protections. Blind or Curse immunity would come in handy later...

In FFIII Knights had the "Guard" command which made all damage done to them to 1 Damage. Is it possible to create some custom ASM to make Defend do that for the Knight's Armor? It would be a neat reference is nothing else, since the price tag of 8000 GP is rather steep for this point in the game.

Quote
e: Thank you for the criticism by the way. I try to look at my changes from several different angles, but inevitably you end up missing something.

No problem. I know how difficult it is to balance FFIV and make it engaging, but at the same time make it a challenge.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on November 08, 2015, 10:08:30 PM
Currently, back row compatibility is determined by item type/icon. I've fixed the out and out bugs with that system, but it would be nice to have a more robust way to determine back row compatibility. Or I could rework how attacking from the back row works in the first place. Make it halve your Attack Multiplier instead of your Precision. Basically become even closer to FF5.  :happy:

I don't remember what I was thinking giving undead Scarmiglione 15 defence; that's going to get reduced. He is double-weak to Holy, so Porom with the Holy Arrows gets quadruple attack against him. Still, no reason to make attacking with her any less effective. I still think I might make Bluff a one-time buff, but increase the bonus from 16 to 20 Intellect and allow it to go beyond 99 Int. That would be pretty easy to code, just have to expand the Bluff routine. Party stats for all characters are stored in a separate place from their in-battle stats like in the SNES version, although all characters have their stats stored permanently unlike what I hear the SNES version does with its 'shadow party'.

Making the Knight's Armor turn Defend into Guard would be possible in some ways: I can simply edit the physical damage routine to additionally check for Knight's Armor equipped when the target is defending, and reduce damage to 1 or quadruple effective defence in that case. Making it change the command's text to Guard would probably be possible too. That's already done by the Lunar Ruins equipment, after all. Might be a little OP, but it's worth a shot.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on November 10, 2015, 11:22:51 AM
Currently, back row compatibility is determined by item type/icon. I've fixed the out and out bugs with that system, but it would be nice to have a more robust way to determine back row compatibility. Or I could rework how attacking from the back row works in the first place. Make it halve your Attack Multiplier instead of your Precision. Basically become even closer to FF5.  :happy:

That's what I did for Combat Boost, I got rid of the accuracy hit for being in the backrow and instead just halved damage. This makes the myriad of Spell Weapons more useful all around.

Quote
I don't remember what I was thinking giving undead Scarmiglione 15 defence; that's going to get reduced. He is double-weak to Holy, so Porom with the Holy Arrows gets quadruple attack against him. Still, no reason to make attacking with her any less effective. I still think I might make Bluff a one-time buff, but increase the bonus from 16 to 20 Intellect and allow it to go beyond 99 Int. That would be pretty easy to code, just have to expand the Bluff routine. Party stats for all characters are stored in a separate place from their in-battle stats like in the SNES version, although all characters have their stats stored permanently unlike what I hear the SNES version does with its 'shadow party'.

Wow. Go beyond 99 Int? That would be pretty neat and would make Palom very unique to stand up against Rydia's unmitigated Summon superiority over Black Magic. Great thinking!

Quote
Making the Knight's Armor turn Defend into Guard would be possible in some ways: I can simply edit the physical damage routine to additionally check for Knight's Armor equipped when the target is defending, and reduce damage to 1 or quadruple effective defence in that case. Making it change the command's text to Guard would probably be possible too. That's already done by the Lunar Ruins equipment, after all. Might be a little OP, but it's worth a shot.

I think increasing Defense rather than 1 damage and done is probably the better option, yes. Having it x3 defense or something similar could work well. 1 damage would be quite overpowered, especially when combined with Cover.

Alright, let's get back to it! Before I leave Mt. Ordeals I do want Cecil to be at 20 though.

Hey, a Silver Apple from a fight with two Lilith, quite nice!

Oh, I forgot to ask. Did you do anything to make Cry useful? I don't know if this was changed in the GBA version, but in the SNES version Cry decreased a stat, that is all but unused for most matters by a minuscule amount. Judging by nothing really happening here, it doesn't look to have changed.

Fantastic a Ghoul Ring! My luck is really up there tonight.

Ah, "Intellect" is spelled wrong in that description. Also the description claims that Intellect and Spirit both go up by 5, but they increase by 8.

Was the formula for Rod damage changed or something? From the backrow Palom equipped with the Ghoul Ring just hit a crit for 600+ damage, with 3 Strength.

Wonderful! A Spectral Robe!

Hmm, Clothes raise Agility by 3? Nothing mentions this, neat though.

A Mythril Knife from some Skeletons, nice.

Hmm, is there any given reason Tellah can't equip the Spectral Robe? It seems sort of odd.

...I think I found that encounter where you used Summon to quite a different effect. 5 BloodBones, hmm...

Oh, Cecil learns Protect, quite nice.

Well, Cecil is now Level 20 and I walked out of there with a Spectral Robe, Ghoul Ring, Mythril Gloves, and Mythril Knife, unfortunately did not pick up the Venom Dagger, Cursed Ring, and Power Armlet.

Need to head out for now but it was a fun bit of grinding.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on November 10, 2015, 01:10:44 PM
I think increasing Defense rather than 1 damage and done is probably the better option, yes. Having it x3 defense or something similar could work well. 1 damage would be quite overpowered, especially when combined with Cover.
Tripling defence sounds good; that will make Cecil in full armor immune to most physicals in the Baron revisit, including Baigan's attacks, while Defending. Turns out the coding for that and the revised Bluff didn't require any special stuff, so they're ready now to be put in the next version.

Alright, let's get back to it! Before I leave Mt. Ordeals I do want Cecil to be at 20 though.
Hah, it's a little surprising to me how much grinding you do. Personally I avoid it as much as possible; making random encounters more rewarding is partly why I'm adding more rare drops and making rare drops themselves a little less rare.

I haven't touched Cry yet, no. All it does in the GBA version is make it easier to run, which isn't all that useful. I might make it cut monster evade and magic evade, now that they use those stats, to provide an option for cutting through dodgy monsters.

Fantastic a Ghoul Ring! My luck is really up there tonight.

Ah, "Intellect" is spelled wrong in that description. Also the description claims that Intellect and Spirit both go up by 5, but they increase by 8.
My bad, those mistakes will be fixed.
Was the formula for Rod damage changed or something? From the backrow Palom equipped with the Ghoul Ring just hit a crit for 600+ damage, with 3 Strength.
By chance, was Palom attacking a Zombie/Ghoul/Revenant with a Fire Rod? Those monsters are doubly weak to Fire, so Palom's attack would become (Attack + WeaponAttack/2)*4, so you may have just gotten very lucky with all your hits landing, but I'll take a look at the damage formulas again. I haven't messed with the physical damage calcs themselves, but you never know...

Hmm, is there any given reason Tellah can't equip the Spectral Robe? It seems sort of odd.
None I can think of, it's probably just an oversight. I'll fix that.

Oh, Cecil learns Protect, quite nice.

Well, Cecil is now Level 20 and I walked out of there with a Spectral Robe, Ghoul Ring, Mythril Gloves, and Mythril Knife, unfortunately did not pick up the Venom Dagger, Cursed Ring, and Power Armlet.

Need to head out for now but it was a fun bit of grinding.

Cecil's spell list will be getting expanded a bit compared to vanilla. He'll still be hindered by low MP and middling Spirit without equipment, but he can keep up as a secondary healer/supporter.

If you want, you can redownload the patch (https://www.dropbox.com/s/x95ogtesrj75ju4/FFIVa%28E%29%20hardtype.zip?dl=1) with the updates I've applied; it includes the changes to Bluff, the new Knight's Armor Guard (sans command text for now), and fixes the typos and Spectral Robe mistake you mentioned.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on November 12, 2015, 12:37:29 PM
I think I might have discovered why you were having such trouble with Scarmiglione's first form: for some reason, empty hands were set to make you weak to Thunder. So Palom, Porom and Tellah would take major damage from his Thundaras for no discernible reason. I've fixed that little mistake and updated the patch, if you want to redownloads.

The next patch will cover everything up to your first visit to the underground and the fight with Golbez, which means that I'll have to get on with expanding the monster data tables. That will be a lot of work, although hopefully it won't take two months like this last update did...
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on November 16, 2015, 10:30:13 AM
That would be the reason it would seem, yes. I'll redownload this then and continue from there (I don't think I have a savefile close to Scarmiglione to try him again though)
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on November 16, 2015, 10:45:19 PM
W/E, that's all right. I didn't make any other changes aside from reducing the second form's defence.

Progress-wise, I managed to insert my first new monster!  :childish:
(http://puu.sh/loqVG/aa79e706ed.png)
It turned out to be pretty easy, mostly just repointing data tables, but I did have to do some surgery to the Bestiary's monster GFX loading routine to make it play nice. The new monsters don't yet appear in the Bestiary, but adding them in by hand will be tedious so I'll see about trying to automate the process.

With new monsters being a possibility, there will be some secret monsters appearing in little-traveled areas of the world. Think of FF5's Prototype island, or the Peninsula of Power in FF1. Not going to say where exactly, but exploration will be rewarded with more than the usual groups of Golbins and Treants.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Grimoire LD on November 17, 2015, 11:47:12 PM
Excellent! I'm glad to see you figured out how to make custom monsters in FF4A. I'm looking forward to seeing what you can do with that.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on November 20, 2015, 09:44:51 PM
I have a few ideas...you might even see some of them in the next few dungeons! Well maybe not the Tower of Zot, that place has almost too many enemies - 12 introduced in there, and only two or three of them appear anywhere else.

I've finished working on everything in the Magnetic Cave but the Dark Elf. Right now, I'm taking a break from that to try something else: making Protect and Shell fully fledged status effects that reduce damage taken, instead of incremental stat buffs. I know I can free up one status effect bit by removing the status bit for Reflect; that status writes a separate byte to unit RAM data to track its duration, so it's possible to make everything related to Reflect check only that byte. I'm still looking for a second status effect to replace in this way (Stop is another candidate), although there's always the option of writing to a completely unused byte if I can find one.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: chillyfeez on November 20, 2015, 10:46:58 PM
It'd take some doing, but what about death status? At least in the SNES version, there are a ton of things that ref the bit,  but it's definitely redundant, since you can technically just ref HP instead. Likewise for "critical," now that I think about it... And probably easier as it's not referenced in nearly as many places.

Here's another thought... I don't know what the GBA RAM looks like, but SNES ffiv has a HUGE block of completely unused RAM in the late 7E's. In the NSES version, the critical bit could very easily be relocated to that block, as it's only referenced in battle, which would leave the normal bit available for protect or shell. Of course if GBA uses less RAM, or actually uses more of the RAM it uses, then that's a moot point.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on November 21, 2015, 12:08:17 AM
The 'critical HP' bit makes sense, yeah. I should have thought of that from the start. It's only referenced in three places (once to apply it and twice to check for it and Magnetic Paralysis), so with a little bit of code expansion I can free that up too.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on November 24, 2015, 09:53:50 PM
Alright, the new status effects for Protect and Shell are (almost - they don't display on the status effect list) complete! I had a rough time finding every little situation that called the critical HP bit - in one version, characters who died and were revived would start playing their spellcasting animation - but I think I've got everything. For the moment, Protect reduces damage from physical attacks by 33%, and Shell does the same for regular damage spells. I might make it reduce the accuracy of status spells by 33% as well, not sure yet.

Another thing I'm thinking of doing is removing the 50% cut to accuracy imposed when physically attacking to or from the back row, leaving just the 50% reduction in damage (or vice versa, leaving in half hit but removing half damage), or making the penalty a flat -20 to accuracy. Having to deal with half hit and half damage is a bit too much IMO, and makes your physical fighters extremely durable in the back row, since they'll take 75% less damage on average. Though that doesn't hold a candle to the original's effect of doubling defence.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on December 13, 2015, 05:54:02 PM
Finished the Dark Elf/Dark Dragon battle a couple of weeks ago - the concept for the Dark Elf half is completely new - but I've gotten hacker's block on the Tower of Zot. Instead I've been brushing up on 6502 Assembly and hacking FF3j, another of my favourites.

As part of changing the Dark Elf/Dragon battle I've made yet more systemic changes: Dispel is unusable by monsters by default as it lacks an effect formula, so a new formula was created by modifying Black Hole to accept targeting parameters. Sap now inflicts 1 + (Current HP/128) damage per tick; Bio-induced Sap doesn't last long enough for it to be nasty, but there's a few Sap-inducing things I intend to introduce that will make good use of it. Additionally, units that absorb the Darkness element will instead be healed by Sap.

I also came up with a solution to the problem of determining when units should attempt to resist spells: magic spells can now be set to ignore MDF, ignore M Evade or both; this lets buffing spells not worry about missing without making spells reflected or cast by Confused monsters doing more damage than intended. And, it allows for damaging spells that cut through your defenses.

Finally, Goblin has a new formula; its base power is determined by the target's level. There's a random element so it won't be consistently powerful later on, but it's a fun and cheap way of doing damage if you have it.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Swordmaster on August 29, 2016, 08:35:30 PM
Greetings, mina-san.  ::bows::  I have been silently observing this forum for years.  However, I must have gained a level and learned a skill to overcome my social anxiety.   :blush:

The reason for my post is this:  I have greatly enjoyed this FF4A hack, Kea-san.  I was wondering if you were still working on it.  It has been a really long time since a post was made in this thread.  I wanted to let you know that you have at least this one fan.


 :edit: Um... is there a reason I am a Mist Dragon?  lol
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: chillyfeez on August 29, 2016, 09:22:12 PM
The monster that represents you is directly related to how many posts you've made on the forum.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Kea on September 04, 2016, 06:54:22 PM
Hey Swordmaster, thanks for sharing your thoughts. Unfortunately I haven't done much work on the hack since my last post here. Part of that was having doubts about how interesting the hack's concept really was and how well FF4's engine was suited to the type of gameplay I want to create (plus how it's slow and laggy in general). I also had trouble focusing on just making progress with the hack as opposed to worrying about small details and minor ASM enhancements. I ended up shifting my attention to FF1-Dawn of Souls and privately working on a hack for that. I might post about that one once it's done.

But the real reason I haven't posted much is that I've been busy this summer, and I'm going to be busier in the months to come, so I can't guarantee that I'll have another release out soon...we'll see. It's not a very encouraging report, but I thought I should explain the long absence.
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: Swordmaster on September 06, 2016, 11:28:43 PM
Arigatou gozaimasu, Kea-san.  ::bows::  I truly thank you for the update and for all you've done.  I found your hack incredibly interesting, and have been following this thread since the first post.  I played through every iteration upon release.  I think what sets it apart from other FF4 hacks are all the additions you've made.  It's like... the game is more fleshed out than vanilla.  I'm probably not explaining this well.  The changes you've made just really resonate with me, I guess.  I also love the fact that there are more ultra rare items to be won.  Before knowing about this hack, if anyone had asked me "If you had a choice of one thing to change or add to make FF4 more enjoyable, what would it be?"  My answer would be more ultra rare items from more monsters throughout the game.

Sorry for being so "wordy" and for the terrible job of explaining.  I really appreciate your work, and I will check out anything you release in the future.

By the way, I'm a bit of a grammar Nazi... or maybe "spelling Nazi"?  Anyway, I noticed several typos in your hack.  If you want, I could give you bug reports via screen shots next time I try out a project of yours.  I have helped out the guys over at Dynamic-Designs a few times in the past.  I am known as SwordmasterAbel over there.  That goes for anyone else reading this.  Threat from Within is especially riddled with typos, though admittedly I've only played about an hour of that one so far.   ...I hope I haven't offended anyone.  I have a bad habit of saying whatever I'm thinking, even via typing.   :blush:

Ok, I'm getting off topic, so I shall end this post.  Thanks again, Kea-san.  And thanks to anyone else reading this nonsense.  lol
Title: Re: FF4A (E) Hacking Notes and Mod
Post by: chillyfeez on September 07, 2016, 12:40:39 AM
I'd love to have someone "copy edit" TfW if you're legitimately offering.
You do realize what you'd be getting yourself into, right?
  :wink: