øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1890.msg20080e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index29bd.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1890.15e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index29bd.html.zxb7g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ0P.ŽOKtext/htmlISO-8859-1gzip@øÕŽÿÿÿÿÿÿÿÿTue, 10 Mar 2020 07:01:13 GMT0ó°° ®0®P®€§²ð®a7g^ÿÿÿÿÿÿÿÿ*Ž Fun with Summons

Author Topic: Fun with Summons  (Read 6845 times)

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Fun with Summons
« Reply #15 on: November 22, 2013, 10:22:23 AM »
I wrote some code for a Phoenix summon:
Code: [Select]
A2 00 00 LDX #$0000
BD 03 20 LDA $2003,X
10 0F BPL $0F
29 7F AND #$7F
9D 03 20 STA $2003,X
BD 07 20 LDA $2007,X
18 CLC
7D 02 20 ADC $2002,X
9D 07 20 STA $2007,X
C2 20 REP #$20
8A TXA
18 CLC
69 80 00 ADC #$0080
AA TAX
E2 20 sEP #$20
E0 80 02 CPX #$0280
D0 DD BNE $DD
A9 40 LDA #$40
8D EB 29 STA $29EB
8D ED 29 STA $29ED
8D EF 29 STA $29EF
8D F1 29 STA $29F1
8D F3 29 STA $29F3
4C 88 D3 JMP $D388

The intention is for this to replace Odin, since he sucks and has a unique spell routine. This spell will perform an attack on all monsters and revive all fallen party members with an amount of HP equal to their current level (just a small amount so as not to be too cheap a move). Getting a phoenix image took a while.. had to sort-of copy from FFV, except FFV's summons are 4BPP, so I had to copy a picture from the web and open it in paint.. very complicated, but it works. I'll post some pics and explain the disassembly, later when I have the time.

Maybe a patch, too...

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Fun with Summons
« Reply #16 on: November 22, 2013, 10:29:29 AM »
Oh that is neat! Good work Chillyfeez, yes Odin is less than amazing in the default FFIV and fixing him to be less useless may not be fully worth it. Your idea to replace him completely is a solid idea.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Fun with Summons
« Reply #17 on: November 23, 2013, 03:56:12 PM »
OK, here's the complete disassembly with explanation:

Code: [Select]
$03/DB5F A2 00 00    LDX #$0000              ;Load Character slot 1
$03/DB62 BD 03 20    LDA $2003,x[$7E:2003]   ;Check status byte 1
$03/DB65 10 0F       BPL $0F    [$DB76]      ;If not dead, skip ahead
$03/DB67 29 7F       AND #$7F               
$03/DB69 9D 03 20    STA $2003,x[$7E:2003]   ;Remove Dead status
$03/DB6C BD 07 20    LDA $2007,x[$7E:2007]   
$03/DB6F 18          CLC                     
$03/DB70 7D 02 20    ADC $2002,x[$7E:2002]   
$03/DB73 9D 07 20    STA $2007,x[$7E:2007]   ;Add amount of current level to current HP
$03/DB76 C2 20       REP #$20               
$03/DB78 8A          TXA                     
$03/DB79 18          CLC                     
$03/DB7A 69 80 00    ADC #$0080             
$03/DB7D AA          TAX                     
$03/DB7E E2 20       SEP #$20               
$03/DB80 E0 80 02    CPX #$0280             
$03/DB83 D0 DD       BNE $DD    [$DB62]      ;Perform the previous steps on the remaining four Character slots
$03/DB85 A9 40       LDA #$40               
$03/DB87 8D EB 29    STA $29EB  [$7E:29EB]   ;This loads 40 into that mysterious "bitmask of status ailments set to expire"
$03/DB8A 8D ED 29    STA $29ED  [$7E:29ED]   ;portion of RAM. I don't know exactly what other purposes this area has, but I
$03/DB8D 8D EF 29    STA $29EF  [$7E:29EF]   ;do know that live characters have a 40 in their respective slots here, and
$03/DB90 8D F1 29    STA $29F1  [$7E:29F1]   ;dead ones have a 00. Interestingly enough, without adding 40 here, the
$03/DB93 8D F3 29    STA $29F3  [$7E:29F3]   ;character will come back to life, but will take no turns in battle.
$03/DB96 4C 88 D3    JMP $D388  [$03:D388]   ;Jump to damage determination routine (for target monster(s)).

You'll notice that, at the end, the Phoenix routine simply jumps to the normal damage spell routine (used for fire/ice/lit, etc.). One could, in theory, change this jump to any other spell effect, or could change the element from fire to something else (this is stored in the normal spell elemental data). Of course, doing any of that would alter what we've come to know as Phoenix.

There's also a patch and save attached, for those who want to see the whole thing in action. The patch should be applied to a FF2US v1.1 ROM. It will only turn Odin into Phoenix, so this can be patched in to any hack seamlessly.

I was thinking - story-wise, King Baron could join your party as Phoenix just as sensibly as he could join your party as Odin. After all, he has died and is sort-of coming back to life. I mean, Phoenix is a bird, not a guy, but Leviatan is a sea serpent and Bahamut is a dragon, but they both look like people when you talk to them, so obviously the game's mythology is cool with this idea.

Anyway, have fun!
« Last Edit: February 17, 2015, 10:20:56 AM by chillyfeez »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Fun with Summons
« Reply #18 on: December 30, 2013, 09:45:34 AM »
Umm.... don't use the above patch on any old hack. I don't know what I did, but it will screw up your hack. Somehow resets any edited events, and also makes the ROM uneditable with FF4kster. Gonna cost me a couple of hours of backtracking with my own work.
It works fine for proof of concept. If you wanna see a working Phoenix spell, it will do that. But do not patch it onto another project.
#$%$&@#

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Fun with Summons
« Reply #19 on: December 30, 2013, 01:57:42 PM »
Thank goodness I only tested it on a Test Rom rather than anything substantial. Phew, that's a bullet dodged. A shame that it doesn't quite work yet. Is it something to do with the way the graphics were input?

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Fun with Summons
« Reply #20 on: December 30, 2013, 04:47:11 PM »
My best guess... I think I might have done the edits on a 1.0 ROM but based the patch off of a 1.1, so the patch basically changes everything in the ROM to its 1.0 address.
This sounds like something I would do (most of my early hacking was done on 1.0 because of yousei's map editor), and explains why it ruins FF4kster compatibility.
I'm not quite sure why/how that would affect events, though, because event data are in the same place in 1.0 as in 1.1. Oh well. I'll re-do this patch eventually, but I've got a fair amount on my to-do list at the moment...
« Last Edit: December 30, 2013, 05:02:16 PM by chillyfeez »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Fun with Summons
« Reply #21 on: January 12, 2014, 04:58:46 PM »
OK, I really have no idea what's going on here...
I re-made the Phoenix patch (in the previous post, above). It no longer ruins FF4kster compatibility, and it doesn't seem to mess anything else up... except, for some reason it removes any changes made to the Opening Events. This is very odd, because in making this patch, I took two identical ROMs, made the Phoenix changes by hand on my hex editor (and the graphics on Tile Layer), and created the patch. I never touched the opening events... 
:wtf:
Well, whatever. This patch will work great, as long as you only patch it to a ROM that has untouched Opening Events.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Fun with Summons
« Reply #22 on: January 12, 2014, 06:30:31 PM »
Like many of us, I assume you were using the Opening Events as a "set-up" for what you needed at the time to test something? Or have you already gotten around to making your opening?

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Fun with Summons
« Reply #23 on: January 12, 2014, 06:54:19 PM »
No, I've got the opening events made. I pretty much have "the first chapter" completed - from the intro (which is not nearly as long as the original game's intro, but probably runs around seven minutes), the initial castle, first "dungeon," up to the first boss (which is not a final product yet).
The preview I'm working on will have all that, then will cut to an interactive "meet the cast," where you'll get to test each character and learn a bit about their backstories (most of them are future versions of already existing characters in the FFIV universe).

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Fun with Summons
« Reply #24 on: January 12, 2014, 07:09:41 PM »
I love what I'm hearing! I can't wait to try it out then!

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Fun with Summons
« Reply #25 on: January 12, 2014, 11:49:07 PM »
I love what I'm hearing! I can't wait to try it out then!

Seconded!

Nice work Chillyfeez; and thanks for the warning about the patch.  :wink:
"Now I know; and knowing makes it even more confusing..."

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Fun with Summons
« Reply #26 on: January 13, 2014, 02:37:54 AM »
Would this work?:

1. Make patch for opening events only
2. Apply summon patch to clean rom
3. Apply events patch to summon-patched rom
Let's dance!

LordGarmonde

  • Baigan
  • *
  • Posts: 271
  • Gender: Male
  • "Power only breeds war..."
    • View Profile
Re: Fun with Summons
« Reply #27 on: January 13, 2014, 02:43:36 AM »
I can't see why not...

...but at this point part of me is starting to think I can fly...  :tongue:

But I think I'm going to utilize that approach when I start building my mod - good call!
"Now I know; and knowing makes it even more confusing..."

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Fun with Summons
« Reply #28 on: January 13, 2014, 05:00:06 AM »
I think I may have figured it out. I did make a few changes using FF4kster - to spells, not events, specifically the Odin (now Phoenix) spells. I'm thinking that FF4kster, bless it's little automiton heart, when saving changes also looked at the event data and said, "this would be far more effecient if I..." So even though the events were not edited, the event data was.
Does this sound like a plausible scenario, Pinkpuff? If so, I'll take one more stab at this...
It's a testament to how useful FF4kster is - I had forgotten I even used it. I mean, why would anybody change spell data any other way at this point?

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Fun with Summons
« Reply #29 on: January 13, 2014, 08:00:15 AM »
That is almost certainly what is happening. FF4kster saves absolutely everything even if you've changed nothing. For most things, this results in no change, but for some things (definitely messages, and probably events as well), even though there is no functional difference in the gameplay, the underlying representation may not be identical to what was there originally.

For a while I have been thinking of going through and making it so that it detects when you've made a change to a section and only saves that section if something was changed in it. But that might not be for a while yet. It will probably happen around the same time that I go through and put in all the data bleeding safeguards.
Let's dance!