Final Fantasy IV Research & Development / Spell Visual Effects
« on: December 27, 2014, 03:41:16 PM »Table of Contents
1. Spell Visual Table
2. Sprites
3. Keyframe Animations
4. Frames for Animations
5. Master Routines
øA slickproductions.org /forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;u=339;area=showposts;start=105 e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index89bd-2.html slickproductions.org /forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;area=showposts;u=339 e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index89bd-2.html.z x Ý›h^ ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ @> ìâ OK text/html ISO-8859-1 gzip 8:Ö ìâ ÿÿÿÿÿÿÿÿ Wed, 11 Mar 2020 08:22:13 GMT 0ó° °® 0® P® €§² ð® Ü›h^ ÿÿÿÿÿÿÿÿj1 ìâ
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.
Another update: animated tiles now actually animate!!
World map tile graphics are still a big mystery.
Not much has been documented. I delved into it a bit once for myself trying to make some custom spell animations, but I kept very few notes. Furthermore, I'm not really very well versed in how SNES actually interprets graphical data, so whereas I can look at the ASM and notice patterns and pointers, a lot of the finer points of it all elude me.
Any notes you have would definitely be useful and appreciated (but in a new thread).
On a tangential note - do you happen to know anything at all about world map graphics? Like, where the graphical data and/or tile assembly data are?
A0200-A07FF (148000-1485FF) World Map Tile Formation Data
A0800-A0AFF (148600-1488FF) World Map Tile Palette Pointers
A0B00-A0C7F (148900-148A7F) World Map Palette Data
A0C80-A0F7F (148A80-148D7F) World Map Tile Properties Data
...
E8200-ED5BF (1D8000-1DD3BF) World Map Tile Graphic Data (also used to construct pointers to town gfx)
I just scanned through the entire ROM in 3 bpp format and didn't see them. FF4.txt lists it at E8200 but that looks pretty tabular to me. Are they 4 bpp?Though what is this separate list and how do you differentiate it from mine?
Ah... now I'm confused. What are the other action routines then? This may be the first time I've heard of a numeric order given to the Action Routines. Maybe there's some different terminology going on here...?
This is some impressive and useful documentation! With this I might be able to think of some way to make my Item Lord command properly differentiate between a Single Targeted Battle Item and an All-Targeted Battle Item.
That this bit would cause Magic Defense Multiplier to always be 1 is strange. What this bit does when activated is it also seems to kill Magic Multipliers if not other multipliers, you should try it out for yourself to see the weirdness in it.
What it does from my experience...
It has a decent chance of missing, even at 127% Accuracy and lowers damage to very low amounts ranging from 40's to mid 1000's depending on the amount of the Power of the spell.
This documentation is on the 02 Routine which is the Damaging Spell Routine (as I'm sure you're aware) but it also screws up damage all around, whether that damage come from HP Sap, Draining HP, and Attack Based on Physical Attack Power, the only damage it seems to deal with properly are fractions of damage or damage based upon the caster's current HP.
[03:CC46] Spell Routine (Command 0x02)
Note: Item (0x1D) routine jumps into this too for most of the work.
----------------------------------------------
Sorry, I did not analyze the first chunk of the routine.
I believe part of it is looping targets to check for valid ones so that
it can calculate the divider used to split damage or healing.
The subroutine called at [03:CD33] for player Summon spells basically maps
to the Enemy Summon equivalent.
It replaces the caster's next subaction at $26D2, and sets $3584 to 1 as a flag.
To be honest, I did not know it overwrote $26D2 when I analyzed most of this,
so I may have some logic errors where the code tests for spell number ranges.
When Asura, it picks one of the 3 Asuras at random, and overwrites the
party target at $26D4 with 0xF8 (presumably to target all party?)
[03:CD3E]
Note: This is where the Item routine (0x1D) jumps in.
Starting around [03:D2CE] is where it looks to be checking for life-like spells.
[CE28]
if (num_targets == 0)
FAIL
if (spell targets only ALL of ally or enemy)
num_targets = 1 // Clarification: this is the split damage/healing divider
[CE42]
if (caster is a player)
{
if (caster.mp < spell.mp_cost)
FAIL
caster.mp -= spell.mp_cost
}
[CE7B]
if (using a spell, not an item)
{
if (caster has Mute and spell < 5F) // The "verbal" spells, perhaps.
FAIL
if (caster has Piggy and spell isn't Piggy)
FAIL
if (caster has Toad and spell isn't Toad)
FAIL
}
[CEB7]
hitrate = spell.hitrate
if (spell is a White spell)
hitrate += caster.will / 2
else
hitrate += caster.wisdom / 2
if (hitrate > 255)
hitrate = 255
if (caster has Darkness)
hitrate /= 2
if (caster is in slot 0)
hitrate *= 5 / 4
[CF01]
// I reordered this section a bit to make the logic easier for me to follow
if (is a weapon spell from the Item routine)
{
successful_hit_count = weapon_spell_multiplier // from table at 0F:9070
}
else if (using an item or <byte at $38ED, possibly flag for Grimoire item?>)
{
successful_hit_count = 8
}
else
{
if (spell has solo multiplier bit?) // top bit of effect index byte
attack_multiplier = 1
else if (spell is a White spell)
attack_multiplier = caster.will / 4 + 1
else
attack_multiplier = caster.wisdom / 4 + 1
successful_hit_count = calculate_multiplier(hitrate, attack_multiplier)
}
[CF3E]
Sorry, unknown stuff I did not complete.
Part checks for Wall reflecting.
Part also checks for some target statuses. Very incomplete notes:
If target is Hiding or Swoon, allow spell effects 0A (life) and 30 (I think Revive Monster?), but FAIL any others.
If target is Stone, allow spell effect 0B (heal status), but FAIL any others.
[D049]
// Note the game code uses a 2x biased integer for the elemental and creature "multipliers",
// so (1 means 1/2x, 2 means 1x, etc)
// and sets the top bit for absorb. Here I just use real numbers like 1, -0.5, for simplicity.
// The game initializes these memory locations for various calculations later; they are unused for the rest here though.
is_crit = false
elemental_multiplier = 1x
creature_multiplier = 1x
if (spell is a player Call spell)
power = spell.power * 8
else
power = spell.power * 4
if (caster and target are both PCs)
defense = 0
else
defense = target.magic_defense
[D0A9]
evasion = target.magical_evasion
if (target has Darkness)
evasion = 2 // I think it sets to 2, but that seems weird. Did they intend 0?
if (caster is in slot zero)
evasion *= 5 / 4 // This seems odd. Is it a penalty for spell use in the front?
defense_multiplier = target.magical_defense_multiplier
if (defense_multiplier > 0)
if (spell has top bit of elemental index byte) // <-- Here is the bit in question?
defense_multiplier = 1
if (target has Toad or Charging)
defense_multiplier = 0
if (target is a monster)
{
if (target.magical_defense_multiplier == 255)
{
evasion = 99
defense_multiplier = 99
}
}
successful_evasion_count = calculate_multiplier(evasion, defense_multiplier)
[D113]
if (caster and target are both PCs)
net_multiplier = successful_hit_count
else
net_multiplier = successful_hit_count - successful_evasion_count
<tests $2A35 if non-zero causes a FAIL>
if (net_multiplier <= 0 OR (target.is_boss AND spell has top bit of hit rate byte))
{
if ((spell is A0 [Explode]) or (5F <= spell <= 93) or (spell >= A9))
net_multiplier = 1
else
FAIL
}
[D162]
// if invincibility is on, and target is a monster. let monster target itself though
if (invincibility_counter != 0 AND target is a monster AND caster != target)
{
// more simply this means: everything but the Crystal fails.
if (using a spell)
FAIL
if (item is NOT the Crystal)
FAIL
}
[D17B]
<Sorry I didn't finish this part>
Eventually it jumps to the spell effect routine itself.
Byte 0:
bit 0: Layer 1
bit 1: Layer 2
bit 2: Same layer on opposite side (Transition or Bridge Layer)
bit 3: ?
bit 4: Closed door tile
bits 5-7: ?
Byte 1:
bits 0-2: ?
bit 3: Bottom half is in front of the character
bit 4: Load previous map at previous location (Location Trigger)
bit 5: ?
bit 6: Enemy encounters possible
bit 7: Check tile’s location in [Location Trigger Data]