Board of Slick

Library of the Ancients => Final Fantasy IV Research & Development => Topic started by: MGE on January 14, 2018, 10:01:40 AM

Title: [Introduction] + FF4 MGE - ver0.40 + [Hack Help] Imp Caller Orb crashes game?
Post by: MGE on January 14, 2018, 10:01:40 AM
Hello all,

My name is Mike, of MGE (Mike's Gaming Experiments).  I've been working on a FF4 hack for while now - a primarily difficulty and game play one, however I've run into a few roadblocks with ff4kster, so I'm going to be attempting to learn how to edit the hex code directly.

The current version of my hack is below, if any of you are curious.  I just wanted to say thank you for all the wonderful work you've done on this game.  This forum is a wonderful repository of knowledge, and I've used it many times.  I hope I can finish this hack and share it with you and others soon.

At the moment I'm having an issue with Caller Orbs (items that teach summons).  My Imp item crashes the game.  The dialogue box appears when Rydia is in party, but the music does not change, the screen turns to garbage and the current song continues playing.  I looked through the Events in ff4kster, but I could not find a corresponding call for this issue.  I never intentionally changed anything to do with this item, (though the Imp spell is changed) so I'm not sure why this doesn't work.

Any help would be appreciated.


https://drive.google.com/file/d/1JcejR7br8oieJx3Oh7L2kH4hSHVLUzdD/view?usp=sharing
Title: Re: [Introduction] + FF4 MGE - ver0.40 + [Hack Help] Imp Caller Orb crashes game?
Post by: Swordmaster on January 14, 2018, 03:47:10 PM
What exactly did you do to the Imp spell?  And did you alter Rydia in any way?
Title: Re: [Introduction] + FF4 MGE - ver0.40 + [Hack Help] Imp Caller Orb crashes game?
Post by: MGE on January 14, 2018, 03:54:55 PM
Hi Swordmaster,

Rydia's experience growth, initial stats and stat growth has been altered, but nothing else.  Her job remains the same, she joins during the Golbez fight as before and I did not change her "class".  She still has Fight, Black, Call and Item, and nothing else.

Jinn and Indra were removed from her initial summon offerings once she joins back.  Jinn, Indra and Titan are "learned' in the same way regular spells are learned.  This seems to work OK, but I'm wondering if changing that list has somehow messed up the pointer to the Imp summon?

The Imp spell's stats were changed a bit, and need to be changed further, but the spell is still in the same location on the spell list, as is the corresponding "effect" portion of the summon.

The Imp "item" has a description now, which was added by extending the item description space in the Features section, but nothing else.

I also just checked Bomb, Mage and the Rukh items, they result in the same crash.
Title: Re: [Introduction] + FF4 MGE - ver0.40 + [Hack Help] Imp Caller Orb crashes game?
Post by: chillyfeez on January 14, 2018, 05:48:22 PM
Hey, Mike.

So, I can't say how this happened to your ROM, but the crash is happening because part of the routine got Zeroed out. Specifically, it's the subroutine at FC600 (in LoROM), which is 7C600 if you open your ROM in a hex editor. Looking at what data are where, I can only assume you edited the Abnormal Status text a lot, and FF4kster accidentally bled the empty space at the end into that routine. But that's just a guess.

Anyway, what you need to do is open your ROM and a clean ROM side-by-side in a hex editor, and copy the three lines beginning at 7C600 from the clean ROM into your ROM. That should fix it.
Title: Re: [Introduction] + FF4 MGE - ver0.40 + [Hack Help] Imp Caller Orb crashes game?
Post by: MGE on January 14, 2018, 10:04:16 PM
Hey, Mike.

So, I can't say how this happened to your ROM, but the crash is happening because part of the routine got Zeroed out. Specifically, it's the subroutine at FC600 (in LoROM), which is 7C600 if you open your ROM in a hex editor. Looking at what data are where, I can only assume you edited the Abnormal Status text a lot, and FF4kster accidentally bled the empty space at the end into that routine. But that's just a guess.

Anyway, what you need to do is open your ROM and a clean ROM side-by-side in a hex editor, and copy the three lines beginning at 7C600 from the clean ROM into your ROM. That should fix it.

Chilly, you saved me!

I did exactly as you suggested and it works perfectly now.

Thank you so much.

Title: Re: [Introduction] + FF4 MGE - ver0.40 + [Hack Help] Imp Caller Orb crashes game?
Post by: chillyfeez on January 14, 2018, 10:23:54 PM
Happy to help!
 :happy:
Title: Re: [Introduction] + FF4 MGE - ver0.40 + [Hack Help] Imp Caller Orb crashes game?
Post by: Swordmaster on January 15, 2018, 08:24:06 AM
1000 times more helpful than I could have been, chillyfeez.

Yo, Mike... that is one nice staff you left lying around in Baron town.  Cecil and Kain are fighting over who gets to use it.
Title: Re: [Introduction] + FF4 MGE - ver0.40 + [Hack Help] Imp Caller Orb crashes game?
Post by: MGE on February 22, 2018, 06:21:42 AM
1000 times more helpful than I could have been, chillyfeez.

Yo, Mike... that is one nice staff you left lying around in Baron town.  Cecil and Kain are fighting over who gets to use it.

Haha, don't worry, it won't be there forever ;)

Since I would assume you gave the hack a look, if you should happen to lose the staff along the way, Cecil's Legend sword ain't too shabby either...
Title: Re: [Introduction] + FF4 MGE - ver0.40 + [Hack Help] Imp Caller Orb crashes game?
Post by: MGE on March 22, 2018, 11:33:29 AM
For anyone else who is working on a hack and is using FF4kster, this is a reoccurring problem for me.  I can edit the hex and restore functionality, but continuing to edit the file with FF4kster makes the same issue happen.

I am going to finish the hack as much as I can, then alpha and beta test, hopefully finding any bleed-through of code, then go back and polish the ROM.

Thanks again for the help!   :wink:

Title: Re: [Introduction] + FF4 MGE - ver0.40 + [Hack Help] Imp Caller Orb crashes game?
Post by: chillyfeez on March 22, 2018, 07:22:43 PM
yeah, it almost definitely has to do with the edits you made to the dialogue bank right before the bytes in question. Every time you save with FF4kster it does the same thing, wherein it accidentally bleeds that dialogue bank into that little bit of code that deals with caller's orbs.

Best thing to do: Start with a version of your ROM that works (with all the edits you've made thus far, plus the fix I helped you with); make a copy of the file; open the ROM in FF4kster; don't make any changes with FF4kster but save changes in FF4kster; use Lunar IPS to create a patch, using the saved-with-FF4kster version as the "base" and the original working ROM as the "edited." Then, every time you make edits with FF4kster, apply this patch afterwards.
A bit more work up front, but easier to deal with than hex editing every time thereafter.