Aslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;u=383;area=showposts;start=90e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index0abd.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;area=showposts;u=383e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index0abd.html.zxh^|OKtext/htmlISO-8859-1gzip0||Wed, 11 Mar 2020 10:54:21 GMT0 0Ph^3"| Show Posts - Kea

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Kea

Pages: « 1 2 3 4 5 6 7
91
Final Fantasy IV Research & Development / Re: Aim and Regen Commands
« on: July 17, 2015, 08:04:36 PM »
As far as I know, the only mechanical thing Aim does in any version is set your base hit to 255 for that attack. Couldn't help you with recoding it (little experience with SNES assembly).

Making Regen heal MP instead of HP should just be a matter of tweaking one or two bytes, but making it run off of the user's stats would require some rewriting.

92
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:

I have it using the Sword of Legend's palette here for clarity. Rearranged to start from a different offset, it looks like this:

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.

93
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.

94
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
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. 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:

Pages: « 1 2 3 4 5 6 7