øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1754.msg18057e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index053d.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1863.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index053d.html.zx2Cg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ P[¦\OKtext/htmlISO-8859-1gzip8:Ö¦\ÿÿÿÿÿÿÿÿTue, 10 Mar 2020 07:51:36 GMT0ó°° ®0®P®€§²ð®0Cg^ÿÿÿÿÿÿÿÿª@¦\ Unknown info from FF4 that would be great to know

Author Topic: Unknown info from FF4 that would be great to know  (Read 17970 times)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Unknown info from FF4 that would be great to know
« on: September 10, 2012, 10:27:11 AM »
    During the process of creating a comprehensive ROM editor for FF4, I have been compiling a "wishlist" of sorts, of info that I would love to be able to program into the editor, but cannot due to the addresses and/or processes involved being not yet known to the community (or if it is known then I have not been able to find it despite considerable research).

    I will probably be adding to this list as I think of things or come across things as I continue my work on the editor, and if others have things they'd like to add to the list feel free to do so as well. And of course, if you happen to know some of this information I'm sure I'm not the only one who would love to know about it. The more information that is known and posted about this game, the better the editor will be when it is done.

    • Weapon properties:
      • Two-handed: There seems to be a flag that is set on all two-handed weapons, and unset on all one-handed weapons. However, changing this bit does not change the actual in-game behaviour of the weapon when you try to equip it. I'm assuming there's something in the "equip an item" code checking the index of the weapon to see if it's two-handed rather than checking the bit. Interestingly, the two-handed weapons do appear to be all next to each other index-wise, so it seems likely that it is a range being checked. Even if it were possible to change that range it would be a huge improvement.
      • Equips as bow / Equips as arrow: Much like the two-handed property, there are flags for "equips like a bow" (in the off hand, half attack power, etc), and "equips like an arrow" (half attack power, consumed when used... sometimes...) but changing the settings on these flags does not appear to actually change the behaviour of the weapon. Once again, the weapons with this property are all next to each other and it is probably checking an index range in the "equip an item" subroutine. Being able to even change the range on these would be great.
      • Auto-berserk: A property of only the Avenger, there seems to be no indication in the weapon data itself that this weapon causes its user to start Berserk. It's probably in the battle code or something but being able to turn it off, or even change it to a different weapon index, would again be a huge step up.

    • Armor equip slots: The armors have flags that seem to be set corresponding to what equip slot the armor goes in (Head, Body, Arms, Hand). However, like with the weapon equip properties above, changing these bits has no effect on what slot the armor actually can equip. I suspect that as above something is checking the index range, as once again, the armors of the same equip slot are all next to each other.

    • Key items: The game seems to treat some items as key items (they appear yellow in the item list and you can't drop them or sell them) and the item data does not seem to have such a flag corresponding to this property. It could be that there's a table or list of them somewhere; in any case being able to change this would definitely be a huge plus to anyone doing any kind of major hacking project.

    • Dark Wave parameters: There are lots of things that would be great to edit with commands, but this stands out as a notable example. Being able to change the amount of HP loss and/or damage dealt by Dark Wave seems like something that should be simple to do, it's just a matter of tracking down the right byte(s).

    • Spell casting animations: By this I mean, some spells when you cast them produce a green ring around your character and the black magic casting sound. Others produce white cubes and the white magic casting sound. As with the item properties above, it seems like these are hard-coded by index as there does not seem to be any flags in the spell data indicating this information, and the ones with like properties are next to each other in the list. It would be great to be able to change this property so that you can, say, replace a formerly black spell with a white one and not have it produce a black casting animation when your character casts it.

    • Out-of-battle effects of items and spells: There was some discussion in the thread for the editor that mentioned that these kinds of effects appear to be triggering map events of some kind. It would be great to know what spells are triggering what events, and even better would if it would be possible to edit which spells and items trigger which events.
Let's dance!

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Unknown info from FF4 that would be great to know
« Reply #1 on: September 10, 2012, 11:54:10 AM »
The equip as arrow flag does have an effect - it makes the item be consumed on your next turn after attacking. One of JCE's hacks had a weapon that broke using that.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #2 on: September 10, 2012, 01:55:11 PM »
Interesting list. I had noticed those bytes aren't enabled in the latest editor, likely because of the belief that they did nothing. Though having a "Weapon Durability system" like FFL does sound like an admittedly interesting idea if that's what the Arrow byte does.

Good finding on the Two-handed equipment, I did not notice that at all. The Key Items list may not be so difficult to find, since the Legend sword is the odd man out in the list.

I would imagine that the Dark Wave Command parameters would be around the other commands like Focus, Jump, Kick, that sort of thing... which to my knowledge we've not found a single one of these.

One of my personal curiosities is what the Dummy (Crash) for Cid was supposed to do. Several Japanese guidebooks apparently said it was something like "Airstrike", but using it clearly, does nothing of the sort. I wonder if it can be repaired or if it was just never completed.

Also what exactly is Item 60? The FAQ I've found lists it right after Artemis Arrows and has "??????" for all of its data. When I hack it into the game, it shows up as an unusable item with no name but here's the strangest part, if you take it into battle with you, after the battle it will be gone. It shows up as usable in the battle, but it just gives you the "Error" sound when you try to use it. What is this item even classified as, anyhow? It's clearly not a legitimate null item, since that's as expected 00. Might it deal something with Arrows? Since it is strange it would vanish after battle.




Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: Unknown info from FF4 that would be great to know
« Reply #3 on: September 10, 2012, 04:36:40 PM »
That item is used for the default evasion value for each armor slot when you don't have anything equipped in them.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #4 on: September 10, 2012, 06:04:18 PM »
Ah... for some reason I had thought that was tied into Item 00, so it seems that there's a default "No Armor" item as well.
Thanks for the information.

Also I've been using Cheat Engine to try and find some info. but its clear going by the older documents that this is not how the data is meant to be viewed. Would you happen to know of a RAM editor for the SNES? I've taken a few looks, but each have come up empty.

Deathlike2

  • Moderator
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #5 on: September 10, 2012, 10:28:39 PM »
  • Armor equip slots: The armors have flags that seem to be set corresponding to what equip slot the armor goes in (Head, Body, Arms, Hand). However, like with the weapon equip properties above, changing these bits has no effect on what slot the armor actually can equip. I suspect that as above something is checking the index range, as once again, the armors of the same equip slot are all next to each other.

I'm pretty convinced that most of the coding for this is probably terrible since something like this should be fundamentally pretty easy to do codewise, but very likely deadlines were responsible for it...

Quote
  • Key items: The game seems to treat some items as key items (they appear yellow in the item list and you can't drop them or sell them) and the item data does not seem to have such a flag corresponding to this property. It could be that there's a table or list of them somewhere; in any case being able to change this would definitely be a huge plus to anyone doing any kind of major hacking project.

If you are clever enough with a debugger, you may want to put many key items in the inventory, such as the Pink Tail and give some to the tail guy. A trace could probably provide some insight as to where they are being checked from. The Legend Sword is also one of them, and that will most certainly be part of the list, despite being in the middle of nowhere...

Quote
  • Spell casting animations: By this I mean, some spells when you cast them produce a green ring around your character and the black magic casting sound. Others produce white cubes and the white magic casting sound. As with the item properties above, it seems like these are hard-coded by index as there does not seem to be any flags in the spell data indicating this information, and the ones with like properties are next to each other in the list. It would be great to be able to change this property so that you can, say, replace a formerly black spell with a white one and not have it produce a black casting animation when your character casts it.

I know Phoenix did some work in this area regarding spell learning, but I'm unsure if he make sure the spell animations correlate... White, Black/Ninja, and Summon are all accessed by their index, so a trace regarding this is probably necessary.

Quote
  • Out-of-battle effects of items and spells: There was some discussion in the thread for the editor that mentioned that these kinds of effects appear to be triggering map events of some kind. It would be great to know what spells are triggering what events, and even better would if it would be possible to edit which spells and items trigger which events.

Some Event trigger examples:
Exit and Warp spells
Alert/Siren item - monster summon
Dwarfbread -  map overhead effect (same with the spell Sight)
Tent/Cabin - save/overworld animation
Summon items - Cockatrice, Goblin/Imp, Mage, Bomb
Flute/Whistle - Big Chocobo summoning
Emergency Exit - same as Exit spell in item form (except it won't cast Exit in battle - strange IMO)
I'm not sure if the SomaDrop+Apples are event items....
Magazine - does this need an explanation?

I think that covers most of it.

The equip as arrow flag does have an effect - it makes the item be consumed on your next turn after attacking. One of JCE's hacks had a weapon that broke using that.

Yea, I remember that. I wonder if it is tied to any code that gives you 10 of said item. All Arrows are usually given in that quantity... it could be strictly for arrows (not checking the bit, but the index range). I haven't exactly tested that out.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #6 on: September 11, 2012, 06:49:29 AM »
Welcome back Deathlike2!

As for events... as strange as it is and how simple it would be to write the Summon Learnings as events, they seem to be classified as something entirely different. The same follows with the Apples and Soma Drops. Sirens also don't seem to correspond with events it appears.

Good catch on the Big Chocobo Whistle though, not sure where the sound effect comes in as no event seems to deal with that (That is Event 4D).


EDIT: I've been doing a bit of testing with the 1E and 1F Commands to see if their 100% status still applied despite being used independent of their original attack, but on a Dark Sword it seems 100% or near 100% that if a status can be applied it Will be applied. I believe this also follows through with Harps, now I'm curious to know if there's some internal percentage chance for weapon types to apply their status.
« Last Edit: September 11, 2012, 07:59:11 AM by Grimoire LD »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #7 on: September 20, 2012, 12:50:52 AM »
Quote from: Deathlike2

The equip as arrow flag does have an effect - it makes the item be consumed on your next turn after attacking. One of JCE's hacks had a weapon that broke using that.

Yea, I remember that. I wonder if it is tied to any code that gives you 10 of said item. All Arrows are usually given in that quantity... it could be strictly for arrows (not checking the bit, but the index range). I haven't exactly tested that out.



I just tested this by giving the Shadow Sword an Arrow Byte. Unfortunately the game does not recognize the Shadow Sword as a consumable item so you can only have one equipped. When you do attack it vanishes like it was an Arrow. Finally placing it inside a chest will not give you 10, it will still only give 1.

darkmage

  • Phantom Train
  • *
  • Posts: 339
  • Skating the Razor
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #8 on: September 21, 2012, 05:25:12 PM »
One thing I would like to see as an option for this editor is for increasing the palette size for overworld/menu/battle palettes from the godawful 3BPP/8BPP limit. There's a method that was described in this post. It might involve expanding the ROM; I've never really looked at messing with FF4, especially after reading this board and learning what a gum-up the engine is. But having this might get me to look at it - time permitting, of course.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: Unknown info from FF4 that would be great to know
« Reply #9 on: September 26, 2012, 06:22:48 PM »
    • Out-of-battle effects of items and spells: There was some discussion in the thread for the editor that mentioned that these kinds of effects appear to be triggering map events of some kind. It would be great to know what spells are triggering what events, and even better would if it would be possible to edit which spells and items trigger which events.

    Finally found this! I've been looking for several weeks off and on but it seems my work has paid off. You should now be able to change what each out-of-battle Spell and Item does!

    This one was quite tricky to find. I started with a breakpoint on the secondary item pointer as I had with the Summon Items on the Magazine and sure enough I came across another SBC command. Ordinarily when subtraction are used in FFIV it's used to put things in an index. The first SBC I found was at 0x1A702 - Sure enough when I changed it the Event of the Magazine would change, but the changes were sporadic and there was no rhyme or reason. I couldn't fathom why this was. I put another breakpoint, I believe on the SBC at 0x1A702 to see where this was taking us to, and found another SBC down the line. This time it was an E1 at 0x01A854. This had rhyme and reason. I changed that to E2 and suddenly the Exit Item was now a Warp Item. This is because Because E5-E2=3 E5-E1=04. So I wrote down a list and came across a strange truth.

    The game looks at an index from 00-07 in order to activate specific events. I quickly recorded the eight events, then looked closer in the data and saw what I was subtracting was actually being stored somewhere and with that information I came across a "Secondary Event Identifier" at 7E1A03 - This is where the subtracted item was being stored and sure enough it matched up with my list.

    I set a breakpoint of Write on that, expecting to finally find the answer, but each attempt ended up in disappointment and loops. Then absent-mindedly today when I was tracing its data I accidentally set the breakpoint to Read or Execute and I found all of the information I need and where this sequence of 00-07 grabs its information. Here are the RAM values...

    8260 - 03
    8264 - 87 (Event Number corrsponding to Warp)
    8269 - 04
    826D - 86 (Event Number corresponding to Exit)
    8272 - 05
    8276 - FB (Event Number corresponding to Sight)
    827B - 06
    827F - 01 (?? Siren ??)
    8286 - DB (Event Number corresponding to Magazine)

    Here are the ROM values. (Still missing the Tent/Cabin oddly enough, even though they should have been included with the numbers, Siren might be something completely different.)


    0x464 - Warp
    0x46D - Exit (Includes Item and Spell)
    0x476 - Sight (Includes Item and Spell)
    0x486 - Magazine

    0x1B97 - Tent?

    It's not perfect and it's still a bit messy (I have no idea where Cabins and Sirens are, for instance) nor does it allow you to choose which items can use which event or spell for that matter. But it's a start, I guess)

    I'm honestly not sure what the point of this immediate information is as, if you really wanted to, you could just modify their base event to what you wanted, but hopefully this information will serve purpose down the line.

    Grimoire LD

    • FF4 Hacker
    • *
    • Posts: 1,684
      • View Profile
    Re: Unknown info from FF4 that would be great to know
    « Reply #10 on: January 10, 2013, 01:23:25 PM »
    Well it's been a while since I've done any real hacking in FFIV, and I wanted to get back into the groove of things. I managed to find the location of Ether's value (outside of battle) and how the game reaches it's value. All v1.1 ROM's for any ROM mentions.

    The first thing the game does is draw a value from

    0x0F9747 - A simple 01, then using the 0A ASM instructions at 01A604, 05, 06  (Which tells the game to continue to accumulate) it continues to boost that 01 to 02, 04, 08, 10, then it loads it somewhere else and accumulates it again to 20 and for it's final accumulation it adds 30.

    I was always under the impression that Ethers outside of battle also restored random amounts of MP, but no. It is a static 48 (AKA Hex 30) If you change the value at 0x0F9747 to 02, Ether1's will then restore 96 MP, and so on and so forth.

    In ROM this is located at...

    0x079947 - 01 to anything you like. I suppose in theory it should be possible to modify it's accumulation phase as well. but as of yet I'm not sure if any other item uses that. (or this 01 even)

     Hopefully I'll be able to find the rest of the other healing items in short order.

     :edit: Hmm... the more I look at this surrounding data, the more I see a pattern emerging...

    0x079947 - 0080 2001 6415 - Data involving Ether1
    0x07994A - 0080 2003 6415 - Data involving Ether2?

    And I see plenty of other similar data formations. I'll have to take a closer look at all of that.


     :edit: 2 Since I felt I had some good momentum going, I decided to look not just for healing items, but the stat boosting items.

    So far I've found Soma Drop's location... and within that given space another pattern emerged to show me the location of the Silver Apple (Golden is conspicuously missing...)

    This was done with a simple breakpoint on Rydia's Max MP that when it was written to. I was taken to the end of an instruction block, but becoming more familiar with this game's programming I had a feeling I could simply trace backwards slightly and find it (or at least find another lead) and indeed I did. It was just in the basic instructions without any crazy jumps or loops like they did with healing items.

    0x01A754 - Silver Apple's amount of HP Raising - 32 (50)
    0x01A761 - Soma Drop's amount of MP raising. - 0A (10)

    I'll see what's up with the Golden Apple if I can.


     :edit: 3 Well that didn't take long. Looks like, for whatever reason, Golden Apple is placed roughly 20 bytes above the other two stat items. Same data formation though.
    B1 60 18 69 64 00

    0x01A73A - Golden Apple's amount of HP Raising 64 (100)

    The aforementioned three are located in ROM at...

    0xA93A - Golden Apple - 64 (100)
    0xA954 - Silver Apple - 32 (50)
    0xA961 - Soma Drop - 0A (10)

     :edit: 4 Oh! I'm a fool! The data for healing items had already been found before. Ah well, at least the stat boosting item info is new (I think?)

     :edit: 5 Ah, here's something a bit interesting. I think you can very easily change what stat you want the stat boosting items to raise.

    09 00 B1 60 18 69 64 00 - That 09 00 At least is telling the game to write to HP.

    0D 00 B1 60 18 69 0A 00 - The 0D 00 is telling the game to write to MP.

    If you look at normal character data...

    09 of 40 Bytes is the Max HP Byte
    0D of 40 Bytes is the Max MP Byte

    So if my thoughts are correct you can increase any stat you like with these items. (If I'm not mistaken, maybe even change classes too) this will require some experimentation.

     :edit: Looks like I was right. Rydia eating the Soma Drop changed her name to Yang and gave her Kick.



    This does have very interesting applications if one wants to take the game in a new direction.... (Possibly, since it doesn't seem to kill Levels, have a set of 3 jobs you can change into at will.

    And even better because the game gives two bytes for these to play around with you can change Class and Character without any ill side effects (well they'll have the stats and equipment of the person they switched from, since you are changing only two bytes) but they'll have their own abilities at least. However the problem that you may have noticed by now is something I didn't take into account. It only increments, it doesn't set a value. Now there may be a way to change that, but as of now I could see these items as only working towards "class upgrades" or some such.

     :edit: 7 Well that issue is solved... truly the Heavens smile on me today. First byte change and boom, exactly what I'm looking for.

    0D 00 B1 60 18 69 0A 00 - All you have to do is change 60 to 00. That will get rid of the Increment and the game will read it as an overwrite. Now you can choose whichever 3 classes you like and switch to them freely (It should be noted that all that will accomplish is changing Sprite, commands, and available Equips,(possibly Level Ups as well, I haven't tested that) however you will still be equipped with whatever you had originally, (So say you wanted to change Cecil into a Mage, he would still be equipped with all of the Dark Knight gear if you used this method) Also there is no way (without making a special event place for it) for the game to know who belongs to what class. So if you use... Let's say a Mage book on Yang. That will be Yang, from now on, even if you only planned on having it be given to Cecil.

    Really this plan works out Marvelously for a Solo Mod, but when there's a party involved, yeah... things get messy. However you can still increase any basic stat you would like with this, just use... http://rb.thundaga.com/ and JCE's hacking document to change the stat you want to increase or set.

     :edit: As great as Geigers is, sometimes it's just so infuriating "not allowed to go into certain ranges where battle data is contained, grumble, grumble..." so back to Cheat Engine for now, which was not made for SNES games and makes actually doing much other than memory editing a bit tricky...

    However I looked up how the game puts various equipment on. The breakable bit, as earlier mentioned, does work for non-arrow items, but the issue is that the game will only ever equip one of an item on. But every inventory slot has an extra byte which would be used for diminishing uses of an item and setting that to 2 or above will show a plain number next to the item. This leads me to believe that it is looking at an index for the Arrows specifically, but if that range can be expanded to all weapons, well there might be an interesting game...


     :edit: 9

    I think you'll like this one, PinkPuff (for data purposes, I can't see too many people really making use of it's potential)





    No tricks here, just a little simple hacking (just one byte change actually)

    I was encountering difficulty discovering where the game was looking to decide whether to add a whole stack or just one to weapon counters, I then eventually found the start of the process at 0x01C12E I was at first searching for BNE (Break if Not Equals) since I thought that would be the defining amount and was indeed looking for item 54, which is Iron Arrows. Lo and behold it seems I was looking for CMP (Compare Accumulator with Memory) and noticed that 54. I changed it to 00 and every weapon (and only weapons) equipped
    became equipped in bunches. Which means that my Shadow Sword experiment from way back finally succeeded and you can make SaGa-esque weaponry now!

    Down the line I would like to try to make it to where using the weapon as an item would consume it. But that's that! I think with this you have a reason to include the "Break if used" byte included on weapons.

    The byte is contained at

    0x01C234 in RAM and in ROM at...

    0xC434 Just change the 54 to whatever index you like and the items will be equipped in bunches.



    Hopefully I can find the mystery to Two-Handed ness as well soon.
    « Last Edit: January 10, 2013, 07:17:22 PM by Grimoire LD »

    Deathlike2

    • Moderator
    • *
    • Posts: 3,538
    • I'm looking at you, bitch!
      • View Profile
    Re: Unknown info from FF4 that would be great to know
    « Reply #11 on: January 10, 2013, 06:31:50 PM »
    Short answer: Items outside of battle always use a multiplier of 12... or was it 8. I can't recall. I'm pretty sure it's 12.
    Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

    Video Demos: #1 #2 #3

    Dragonsbrethren

    • Forum Overlord
    • *
    • Posts: 1,820
      • View Profile
      • Dragonsbrethren Industries
    Re: Unknown info from FF4 that would be great to know
    « Reply #12 on: January 10, 2013, 07:09:30 PM »
    Very nice finds.

    Grimoire LD

    • FF4 Hacker
    • *
    • Posts: 1,684
      • View Profile
    Re: Unknown info from FF4 that would be great to know
    « Reply #13 on: January 10, 2013, 07:20:56 PM »
    @ Deathlike2

    Yeah, I think that's what all of that x2/x2/x2/x2 x x2/x2/x2/x2 that is going on there adds up to. It all ends up in Hex values in the end.

    @ Dragonsbrethren

    Thanks! I just also (like literally minutes ago) found how the game looks at Arrows and where that index starts and edited that into my previous post.

    JCE3000GT

    • Master of FF4
    • *
    • Posts: 1,429
    • Gender: Male
    • Vladof
      • View Profile
      • BlitzKrieg Innovations
    Re: Unknown info from FF4 that would be great to know
    « Reply #14 on: January 10, 2013, 08:17:58 PM »
    I at one time I found the info for the two handed and what item is on what slot data, lost the offsets in a hdd crash.  I believe it was an index range data format but I could be remembering incorrectly. I do know it exists...LOL!

    I planned on locating this info for my hack I'm working on right now actually...